Description
Problem
The owner wants Anthropic models (Sonnet) to work well in the Service when they are needed, but the first trial (2026-11-09, ai.tasks.analysis and ai.tasks.stage on claude-sonnet-5-5) cost much and staged nothing. DeepSeek is the default for now (owner decision 2026-11-10). We need to know how Sonnet differs from DeepSeek in these workflows, so that Sonnet can be an escalation tier with a known cost and result.
What is known
- Sonnet spend was about 58 to 75 USD on 2026-11-09 and about 67 USD over 7 days. A stage burst cost about 21 USD an hour.
- A fresh Sonnet plan run on fix(roadmap): alternatives ADR cap test reads logs of other loggers #4062 cost 6.49 USD (44 requests, about 85,000 input tokens each, killed at the 1200 second limit). A DeepSeek stage run costs about 0.04 to 1 USD by token estimate. One Sonnet refusal could not be recovered, because the refused reply was not kept then (fix(roadmap): keep refused stage replies, stop placeholder replies #4260 keeps it now).
- Early in the trial the gateway fell back from Sonnet to DeepSeek and hid a 400 error for
tool_choice: required(fix(roadmap): send tool choice auto to Claude and count answers #4216). Claude groups now sendtool_choiceauto, andmax_tokens32000. - The stored Sonnet verify run (2026-11-05) found 38% of serious labelled defects, below the floor
CONST_ROADMAP_VERIFY_RECALL_FLOOR(0.9).
What to find out
- A table for at least 10 stage items and 5 implement groups, run with Sonnet and with DeepSeek on the same input: gate refusals by gate, tool calls, requests, input and output tokens, minutes, cost, outcome.
- Where the two differ in behavior: number of tool calls before the first plan, use of the
callersandsearch_codetools, size of tool results, repeated reads, final reply form, refusals bytraceandcitationgates. - Whether prompt caching applies (Anthropic cache control through LiteLLM) and what it saves; whether
effort,thinkingormax_tokenschange cost and quality. - Whether the prompts, tool descriptions or gates need a form that suits the model (for example fewer tool calls, a plan-now notice, or a fixed order).
- A rule for when to escalate to Sonnet (for example, after two DeepSeek stops on the same item) and the cost cap per item.
Limits
Spend needs a cap set by the owner before any run. Suggested cap: 25 USD for the whole study. Use the golden stage set (devops roadmap eval stage) and the scratch settings copy, not the live ConfigMap.
Done when
The table, the list of differences, a recommendation for the escalation rule with its cost, and the fix issues for each finding are in this issue.
Related: #4216, #4260, #3566, #4385, #4386, #4387.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Alternatives check of 2026-11-20: not-applicable.
Class: chore, no search.
Tool: none found.
Proposed design
Problem statement
The first Sonnet trial staged nothing and cost about 58 to 75 USD. The Service needs a side-by-side measure of Sonnet and DeepSeek before Sonnet can be an escalation tier. This item adds a model-configuration dimension to the compare form of devops roadmap eval stage, with a spend cap guard and an offline replay. The paid measurement runs are in #4411, and this item waits on #6521.
Acceptance criteria
Requirement: Side-by-side model comparison
The eval stage command SHALL run each golden case under two named model configurations and write one row for each case and configuration.
Scenario: Two model configurations over the golden set
- WHEN A test runs the eval stage compare form with the configurations
deepseekandsonneton a recorded golden case - THEN The command writes one row for each case and configuration, and each row holds the case number, the configuration, the refusals by gate, the tool calls, the requests, the input and output tokens, the minutes, the cost and the outcome
Requirement: Tool-call detail
Each comparison row MUST name the tools that the run called, the number of calls before the first plan, and the total size of the tool results.
Scenario: A run that reads the same file twice
- WHEN A recorded run calls
read_filetwice on the same path before it writes a plan - THEN The row names
read_file, counts both calls before the first plan, and marks the path as a repeated read
Requirement: Refusals by gate
The comparison MUST count the refusals of the trace gate and the citation gate in their own columns, and the refusals of the other gates by gate name.
Scenario: A reply refused by the citation gate
- WHEN A recorded reply fails the
citationgate and passes thetracegate - THEN The row shows one refusal in the
citationcolumn and zero in thetracecolumn
Requirement: Spend cap guard
A live comparison run MUST refuse to start when the spend cap is unset or zero, and MUST stop before the next request when the recorded spend reaches the cap.
Scenario: No spend cap set
- WHEN A test starts a live comparison run with the spend cap unset
- THEN The command exits non-zero, names the missing spend cap setting, and the test records no request to the gateway
Requirement: Stop at the spend cap
The comparison MUST mark the row capped and MUST send no further request when the recorded spend reaches the cap.
Scenario: The recorded spend reaches the cap
- WHEN The recorded spend of a live run reaches the spend cap after a reply
- THEN The command stops before the next request and the row shows the outcome
capped
Requirement: Offline replay
The comparison MUST build its full table from recorded replies with no network access.
Scenario: Replay with the network denied
- WHEN A test runs the comparison on the recorded reply fixtures with network access denied
- THEN The command writes the full table and the test records no request to the gateway
Requirement: Cost from the pricing registry
Each row SHALL take its cost from the pricing registry, and SHALL show unknown when the registry holds no price for the model.
Scenario: A model with no price
- WHEN A recorded reply comes from a model that the pricing registry does not price
- THEN The row shows
unknownin its cost column and the run completes
Requirement: Cache token cost
Each row MUST report the cache read tokens, the cache write tokens and the cost that the pricing registry gives them.
Scenario: A reply with cache tokens
- WHEN A recorded reply carries cache read tokens and cache write tokens
- THEN The row shows both token counts and their cost from the pricing registry
Requirement: Scratch settings only
The comparison MUST read the model settings from the scratch settings copy and MUST NOT write the live ConfigMap.
Scenario: The live ConfigMap is present
- WHEN A test runs the comparison with a live ConfigMap file in the test tree
- THEN The command reads the scratch settings copy and the live ConfigMap file is byte-identical after the run
Existing Tool Considered
The alternatives block in the issue body records not-applicable for this chore item on 2026-11-20: the check made no search and found no tool. The item extends the compare form of devops roadmap eval stage, which already runs each toolset on the same golden cases, prices a row from the pricing registry and prints one delta line for each column. It adds a model-configuration dimension, the tool-call detail before the first plan, the trace and citation columns and the spend cap guard. Written cost to build, keep and fix this extension: about 45k output tokens and 1 working day to build, and about 10k tokens a month to keep and fix.
Key questions
- Where does the Sonnet and DeepSeek comparison live?: In the compare form of
devops roadmap eval stage. That form already runs each toolset on the same golden cases, prices a row from the pricing registry and prints one delta line for each column. The item adds the model configuration as a second dimension. (best practice) [sources: openspec/specs/roadmap-stage-eval/spec.md, src/devops_cli/roadmap/stage/stage_verify_eval.py]- Chosen: A model dimension on the compare form of
devops roadmap eval stage. The golden set, the gates, the pricing and the delta lines already live there. - Rejected: A new
devops roadmap eval comparecommand. It copies the golden-set loader, the gate report and the compare form of the stage eval.
- Chosen: A model dimension on the compare form of
- How does each row get its cost?: From the pricing registry, through
RunUsage, which already prices the cache read tokens and the cache write tokens. A row whose model the registry does not price showsunknown. (best practice) [sources: src/devops_cli/ai/spend/pricing.py, tests/ai/spend/test_ai_spend_pricing.py]- Chosen: Price the row from the pricing registry. The stage eval already prices a row from the registry, and the registry holds the cache token prices.
- Rejected: Read the cost from the gateway record. The stage eval prices from the registry, and a gateway record gives no price for a cache token split.
- What stops a live comparison run at the spend cap?: A spend cap setting with a refuse and stop guard. A live run refuses to start when the cap is unset or zero, and it stops before the next request when the recorded spend reaches the cap. (best practice) [sources: src/devops_cli/config/defaults.py, src/devops_cli/config/constants.py]
- Chosen: A spend cap setting with a refuse and stop guard. The run cannot pass the cap, and a default of zero blocks a live run until the owner sets the cap.
- Rejected: No guard; the operator watches the spend. A stage burst cost about 21 USD an hour, and a watch cannot stop a run in flight.
- How do the tests run the comparison with no spend?: Replay recorded replies from fixtures with network access denied. The same input gives the same table, and the test needs no network and no spend. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_verify.py, tests/roadmap/stage/test_roadmap_stage_gates.py]
- Chosen: Replay recorded replies from fixtures. It needs no network and no spend, and it reproduces the order of tool calls and gate refusals.
- Rejected: Mock the client call by call. The comparison measures the order of tool calls and the gate refusals, and a per-call mock cannot reproduce that order.
- Which refusals does the table count?: The refusals of the
tracegate and thecitationgate, each in its own column, plus the refusals of the other gates by gate name. [sources: src/devops_cli/roadmap/stage/stage.py, tests/roadmap/stage/test_roadmap_stage_gates.py] - What does the freeze reply of 2026-11-20 decide for this item?: The item depends on chore(roadmap): hold incremental stage and implement work #6521. The stage, implement and fix-checks jobs grade under 60%, so the re-architecture of refactor(roadmap): re-architect stage and implement on Coder #6519 must decide first. A person closes chore(roadmap): hold incremental stage and implement work #6521 and the item continues, or closes this item as not planned. (best practice) [sources: docs/ROADMAP_WORKFLOW.md]
- Chosen: Wait for chore(roadmap): hold incremental stage and implement work #6521 and continue. The reply freezes the item, and a person closes chore(roadmap): hold incremental stage and implement work #6521 when the experiments of refactor(roadmap): re-architect stage and implement on Coder #6519 decide.
- Rejected: Close this item as not planned. Only a person closes the item, and the reply names that outcome as the other choice.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Watched files
A commit on the default branch that changes one of these files starts the next refine round.
src/devops_cli/roadmap/stage/stage.pysrc/devops_cli/roadmap/stage/stage_tools.pysrc/devops_cli/roadmap/stage/stage_verify_eval.py
Activity
dan-petty commentedon Nov 10, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
choreprefix of the title gives the type.(roadmap)scope of the title gives the scope.DeepSeek is already the default; this study enables a cost-aware escalation tier but is not blocking.Reduces wasted spend and gives the owner a data-backed escalation rule for Sonnet.Requires running paired comparisons on 10+ items, analyzing tool-call and cost differences, and writing a recommendation.Both evaluate stage runs with cloud models, but #3566 establishes a single-model baseline while the candidate produces a two-model comparison table and an escalation rule.devops-cli-service commentedon Nov 10, 2026
Status set to Ready at 40d2b37 (see proposed design in issue body).
Moved to new items: #4411.
devops-cli-service commentedon Nov 11, 2026
Alternatives check: not-applicable
Class: chore. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-11. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.