Repository navigation
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
grepand shell tools ofCoder, size of tool results, repeated reads, final reply form, refusals by thetraceandcitationgates (ProposalGateinstage_change.py). - 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.
Alternatives check of 2026-11-30: not-applicable.
Class: chore, no model call.
Tool: none found.
Proposed design
Problem statement
The first Sonnet trial staged nothing and cost about 58 to 75 USD. The project 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, so each golden case runs under each named configuration. The form records tool-call detail and gate refusals, and guards a live run with a spend cap. The form reads the scratch settings copy only. DeepSeek remains the default model, and the paid measurement runs are in #4411.
Acceptance criteria
Requirement: Model configuration dimension
The compare form of devops roadmap eval stage SHALL run each selected case under each named model configuration and SHALL write one row for each case and configuration.
Scenario: Two model configurations over one case
- WHEN A test runs the compare form with the configurations
deepseekandsonnetand one recorded case. - THEN The command writes two rows, and each row names the case, the configuration, the gate refusals, the tool calls, the requests, the tokens, the minutes, the cost and the outcome.
Requirement: Tool-call detail
Each comparison row MUST name the called tools, 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 two calls before the first plan, and marks the path as a repeated read.
Requirement: Refusals by gate
The comparison MUST count the trace refusals and the citation refusals in their own columns, and MUST count the other gate refusals 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 --spend-cap-usd is absent or zero.
Scenario: No spend cap set
- WHEN A test starts a live comparison run with no
--spend-cap-usd. - THEN The command exits non-zero, names the missing spend cap option, and the test records no request to the gateway.
Requirement: Stop at the spend cap
The comparison MUST stop before the next request and MUST mark the row capped when the recorded spend reaches the spend 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 sends no further 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 unpriced 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
unpricedin 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 path is set
- WHEN A test runs the comparison with a live ConfigMap path set.
- THEN The command reads the scratch settings copy and the test records no write to the live ConfigMap path.
Requirement: Final reply form
Each comparison row MUST record the form of the final reply of the run.
Scenario: A run ends with a plan
- WHEN A recorded run ends with a plan reply.
- THEN The row shows the reply form
plan.
Existing Tool Considered
The alternatives check of 2026-11-30 in the issue body records not-applicable for this chore item. It names no tool. The item extends the compare form of devops roadmap eval stage. Written cost to build, keep and fix: 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. The form already loads the golden set and reports the gates and the usage. The change adds the model configuration as a second dimension. (best practice) [sources: openspec/specs/roadmap-stage-eval/spec.md, src/devops_cli/commands/roadmap_eval_stage.py, src/devops_cli/roadmap/stage/stage_eval_compare.py]- Chosen: Add a model dimension to the compare form of
devops roadmap eval stage. The golden set, the gates, the pricing and the delta lines already live there. - Rejected: Add a new
devops roadmap eval comparecommand. It copies the golden-set loader, the gate report and the compare form of the stage eval.
- Chosen: Add a model dimension to the compare form of
- How does each comparison row get its cost?: From the pricing registry through
RunUsage.RunUsageprices the input tokens, the output tokens, the cache read tokens and the cache write tokens. A row whose model the registry does not price showsunpriced. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_usage.py, tests/roadmap/stage/test_roadmap_stage_eval_usage.py, openspec/specs/roadmap-stage-eval/spec.md]- 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.
- How does a live comparison run get and enforce the spend cap?: With a required
--spend-cap-usdoption. The run refuses to start when the option is absent or zero. It stops before the next request when the recorded spend reaches the cap and marks the rowcapped. (best practice) [sources: src/devops_cli/commands/roadmap_eval_stage.py, openspec/specs/roadmap-stage-eval/spec.md]- Chosen: A required
--spend-cap-usdoption. It is per run, needs no config change, and the owner sets it at the run. - Rejected: A setting in the scratch settings copy. It needs a config change and a settings reload, and the owner sets the cap per run.
- Chosen: A required
- How do the tests run the comparison with no spend and no network?: Replay recorded replies from fixtures with network access denied. The same input gives the same table. The test needs no network and no spend. (best practice) [sources: openspec/specs/roadmap-stage-eval/spec.md, 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 gate refusals does the table count?: The
tracerefusals and thecitationrefusals, each in its own column. The table also counts the other gate refusals by gate name. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py, tests/roadmap/stage/test_roadmap_stage_gates.py]- Chosen: Give
traceandcitationtheir own columns. The issue names these two gates, and the table must show their separate refusal counts. - Rejected: Count all gate refusals in one column. The issue asks for refusals by gate, and one column hides the two gates that the issue names.
- Chosen: Give
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
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.
devops-cli-service commentedon Nov 28, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Dec 1, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.