Repository navigation
Description
Found by: #1096 (driver conformance suite) — this issue backs the gap: #N skip reasons its opencode and aider adapters record.
Problem
Two of the six conformance contract items (#1096) cannot pass for opencode or aider, because the drivers never populate the fields the items assert on.
Item 5 — structured outcome (tokensUsed > 0):
opencode.tsaccumulatesparsed.costUsdfromstep_finish.part.costand never setsmodelUsageon theAgentPhaseResult. A cost figure is not a token count, andsequant stats/ the fix(metrics): tokensUsed is 0 on every recorded run — capture-tokens.sh reads .usage (transcripts carry .message.usage) and run reads the wrong dir; wire SDK modelUsage tokens+costUSD per phase × model into metrics and stats #986 token metrics both key offmodelUsage, so an opencode run contributes 0 tokens to every report.aider.tssets neithermodelUsagenorcostUsd— itsAgentPhaseResultcarries no usage signal at all.
Item 3 — typed error mapping (BillingError / RateLimitError):
evaluateOpencodeRunmaps every failure toSequantErrororSubprocessError. A quota-exhausted opencode run is therefore indistinguishable from any other failure, so--auto-wait(feat(run): --auto-wait — continue a rate-limited run when the window resets instead of halting #804) and the fix(run): pre-flight guard misses in_progress issues already merged on GitHub (gap in #305/#423) #592 billing skip cannot engage — the same defect bug(codex): usage-limit turn failures classified 'unknown' — quality loop re-runs into the same quota, --auto-wait can't engage #1087 records for codex.aider.tsnever setsstructuredError, so the executor falls back to stderr-regex classification for every aider failure.
Why it matters
The conformance suite's honest answer today is a typed skip. That is the right outcome for a contract test, but it means two of four registered drivers silently report $0.00-equivalent usage and untyped failures, and nothing else in the repo flags it. claude-code and codex both have a structured path; these two are the outliers.
Acceptance criteria
- AC-1:
OpencodeDriver.executePhasereturnsmodelUsagewith non-zeroinputTokens/outputTokensfor a completed run, derived from opencode's own usage signal (identify it first —step_finishmay carry tokens alongsidecost) - AC-2:
AiderDriver.executePhasereturns a usage signal for a completed run, or the driver documents in code why aider exposes none and the conformance skip staysstructural:rather thangap: - AC-3: an opencode usage-limit failure yields
BillingErrorwith the reset time in metadata; a transient throttle yields a retryableRateLimitError(fixture text captured from a real run, not synthesized) - AC-4:
#1096's opencode and aider adapters drop the correspondinggap: #<this issue>skips and assert instead - AC-5:
npm run build && npm testgreen
Not in scope
The codex side of item 3 — #1087 owns that mapping.
Related
#1096 (the suite that found this) · #1087 (codex counterpart) · #986 (token metrics) · #862 / #992 (opencode driver) · #804 · #592
🤖 Generated with Claude Code
Activity
fix(#1115): opencode driver reports modelUsage from step_finish tokens (
admarble commentedon Sep 28, 2026
Progress: #1204 merged. AC-1 is done: opencode reports
modelUsagefromstep_finish.part.tokens. AC-4 is partly done: the opencode item-5 conformance skip was replaced with a real assertion.Still open, blocked on real captures (nothing synthesized):
aider.tscaptures stdout, but the repo has no real aider output, and aider is not installed on the dev machine. Needed: verbatim stdout and stderr from a real run with the driver's exact args (--yes --no-auto-commits --no-pretty --message …), committed as a fixture with aPROVENANCE.mdline. If that run shows aider prints no usage line under--no-pretty, that is the evidence for the AC's "document why,structural:skip" branch.evaluateOpencodeRun'sparsed.errorsbranch, following codex'sUSAGE_LIMIT_RE/THROTTLE_RE. Needed: realopencode run --format jsonstdout and stderr from one usage-limit run and one throttled run. Keep stderr, since it isn't known yet whether provider errors arrive aserrorevents.