[cli] feat: add benchmark CLI command surface - #265
Conversation
Add `osmosis benchmark submit <config.toml>`, which submits a managed benchmark run from an Osmosis-owned TOML contract following the train/eval mental model. The config is not a Harbor config: Harbor stays an internal execution detail, and the CLI never sees or transmits secret values — `api_key_secret` fields carry Platform secret record names that the platform resolves server-side. Secret and env collision checks are scoped per agent because the platform injects each agent's API key only into that agent's environment, so one agent's secret name may legitimately be another agent's literal env var.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Fix all with cubic | Re-trigger cubic
|
@cubic review |
@JoyboyBrian I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 13 files
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Tip: Review your code locally with the cubic CLI to iterate faster.
Fix all with cubic | Re-trigger cubic
|
@cubic review |
@JoyboyBrian I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 13 files
Confidence score: 2/5
- In
osmosis_ai/platform/cli/benchmark_config.py, the header guard only blocksAuthorization, so users can still commit or transmit secrets viaX-API-KeyorProxy-Authorization; this creates a concrete credential-leak risk in config and CLI traffic—expand validation to reject credential-bearing headers (or require secret-backed references) before merge.
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="osmosis_ai/platform/cli/benchmark_config.py">
<violation number="1" location="osmosis_ai/platform/cli/benchmark_config.py:72">
P1: Endpoint credentials can still be committed and sent through the CLI as `X-API-Key` or `Proxy-Authorization`, because this guard blocks only `Authorization`. Reject credential-bearing headers (or support secret-backed header references) so `api_key_secret` remains the only authentication input.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
What
submit,list,info,logs,stop,download, matching the train/eval command surface.benchmark catalog list|infoso top-levellist/infounambiguously mean runs.osmosis_ai/platform/cli/benchmark_config.py: a strict Pydantic parser for the Osmosis-owned benchmark TOML contract ([experiment],[tasks],[[agents]],[execution],[env]), with per-agent secret/env collision checks and reserved_OSMOSIS_rejection.osmosis_ai/platform/cli/run_download.pyinto a shared manifest transfer engine parameterized by output resolver, path classifier, operation and resource key; eval behavior is the default, so its call sites are unchanged.summary,results;artifacts,logsandallare opt-in. Fixed layout under.osmosis/benchmarks/<run-name>/.required_secret_namesand nullable per-taskdifficultyin catalog output.benchmarkas a structured-error command group so JSON errors report the full command path (benchmark download,benchmark catalog info) instead of justbenchmark.validation_issue_to_config_issuenow builds a correct issue key when the section name is empty, andvalidate_env_var_keystakes asource_labelso per-agent env errors name the right section. Both keep their previous behavior for existing callers.Why
Benchmarks were only manageable from the Platform UI, so
submitleft users with no CLI path to monitor, stop, or retrieve results. Runs now follow the same lifecycle mental model as train and eval.Catalog commands are nested rather than top-level because a benchmark definition and a benchmark run are different objects; sharing
list/infobetween them would make the command surface ambiguous as soon as run management existed.The config is an Osmosis-owned contract, not a Harbor config: Harbor stays an internal execution detail, and the CLI never sees or transmits secret values —
api_key_secretfields andrequired_secret_namescarry Platform secret record names that the platform resolves server-side.Secret/env collision checks are scoped per agent because the platform injects each agent's API key only into that agent's environment, so one agent's secret name may legitimately be another agent's literal env var.
difficultyis passed through verbatim and isnullwhen the benchmark source does not provide one; it is never inferred.Depends on the platform endpoints added in Osmosis-AI/osmosis-monolith#936.
How to Test
uv run pytestuv run ruff check .anduv run ruff format --check .uv run pyright osmosis_ai/osmosis benchmark catalog info "HLE",osmosis benchmark submit configs/benchmark/default.toml, thenlist/info/logs/downloadChecklist
[module] type: descriptionformatenhancement,bug,breaking)ruff check .andruff format --check .passpyright osmosis_ai/passespytestpasses (new tests added if applicable)