Skip to content

chore(roadmap): investigate how Sonnet differs in stage #4400

Open

Description

@dan-petty

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

What to find out

  1. 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.
  2. Where the two differ in behavior: number of tool calls before the first plan, use of the grep and shell tools of Coder, size of tool results, repeated reads, final reply form, refusals by the trace and citation gates (ProposalGate in stage_change.py).
  3. Whether prompt caching applies (Anthropic cache control through LiteLLM) and what it saves; whether effort, thinking or max_tokens change cost and quality.
  4. 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).
  5. 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 deepseek and sonnet and 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_file twice 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 citation gate and passes the trace gate.
  • THEN The row shows one refusal in the citation column and zero in the trace column.

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 unpriced in 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 compare command. It copies the golden-set loader, the gate report and the compare form of the stage eval.
  • How does each comparison row get its cost?: From the pricing registry through RunUsage. RunUsage prices the input tokens, the output tokens, the cache read tokens and the cache write tokens. A row whose model the registry does not price shows unpriced. (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-usd option. 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 row capped. (best practice) [sources: src/devops_cli/commands/roadmap_eval_stage.py, openspec/specs/roadmap-stage-eval/spec.md]
    • Chosen: A required --spend-cap-usd option. 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.
  • 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 trace refusals and the citation refusals, 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 trace and citation their 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.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#4411

Activity

  1. added
    source/agent
    type/chore
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 10, 2026
  2. dan-petty commented on Nov 10, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/chore. The chore prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. DeepSeek is already the default; this study enables a cost-aware escalation tier but is not blocking.
    • Value: Medium. Reduces wasted spend and gives the owner a data-backed escalation rule for Sonnet.
    • Effort: Medium. Requires running paired comparisons on 10+ items, analyzing tool-call and cost differences, and writing a recommendation.
    • Related: test(roadmap): run the cloud baseline of the stage eval #3566, which asks for a different change. 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.
  3. added
    priority/p2-medium
    on Nov 10, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 10, 2026
  5. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 40d2b37 (see proposed design in issue body).

    Moved to new items: #4411.

  6. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    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.

  7. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    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.

  8. added
    status/new
    and removed
    status/ready
    on Nov 26, 2026
  9. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    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.

  10. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    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.

  11. added
    status/ready
    and removed
    status/new
    on Dec 1, 2026
  12. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agentstatus/readytype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions