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 callers and search_code tools, size of tool results, repeated reads, final reply form, refusals by trace and citation gates.
  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.

Dependencies

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 deepseek and sonnet on 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_file twice 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 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 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 unknown 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 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 compare command. It copies the golden-set loader, the gate report and the compare form of the stage eval.
  • 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 shows unknown. (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 trace gate and the citation gate, 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]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6521

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.py
  • src/devops_cli/roadmap/stage/stage_tools.py
  • src/devops_cli/roadmap/stage/stage_verify_eval.py

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.

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/newtype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions