Skip to content

fix(roadmap): remove the cause of placeholder stage replies #4205

Closed

Description

@devops-cli-service

Split from #4204.

Problem The stage job stages no item because the model sends replies of placeholders. The Service cannot name the cause yet: window, toolset, output tool of the structured reply, or model. ## Why deferred The cause needs Service data that does not exist before #4204 ships. The model change is allowed only when the evidence names the model, as owner decision #3874 allows. ## Acceptance criteria 1. The analysis names the cause in this issue: window, toolset, output tool or model. It cites the kept replies and the request fields. 2. The fix removes the cause. If the cause is the model, the stage slot names another model. 3. sum by (result) (increase(devops_cli_roadmap_stage_total[24h])) shows staged above 0 for each 24 hours in which an item is Ready and has a plan that passes the gates. 4. The golden-case eval reports 0 degenerate replies for the chosen model.

Proposed design

Problem statement

The stage job stages no item because the model sends placeholder replies. The cause can be the window, the toolset, the output tool of the structured reply, or the model. The repository rules out the window: a run that the window starves raises an error before the reply is read. The Service data of #4204, the kept replies and the request fields, names the remaining cause. This issue uses that data, removes the cause, and proves the result with the stage metric and the golden-case eval.

Acceptance criteria

Requirement: Cause analysis

The analysis SHALL name one cause of the placeholder replies among the toolset, the output tool and the model, and MUST cite the kept reply and the request field that show it.

Scenario: Cause named from the kept data

Requirement: Cause removal

The fix SHALL remove the cause that the analysis names, and it MUST change the model of the stage slot only when the analysis names the model.

Scenario: Model is the cause

  • WHEN the analysis names the model as the cause
  • THEN the stage slot names another model, and for any other cause the stage slot keeps deepseek-v4.1-flash-1017

Requirement: Staged results

The metric devops_cli_roadmap_stage_total SHALL show staged above 0 for each 24 hours in which an item is Ready and has a plan that passes the gates.

Scenario: Staged count after the fix

  • WHEN sum by (result) (increase(devops_cli_roadmap_stage_total[24h])) runs after the fix for a 24-hour window with such an item
  • THEN the result staged is above 0

Requirement: Golden-case eval

The golden-case eval SHALL report 0 refused cases whose content problem names a placeholder for the chosen model.

Scenario: Eval of the chosen model

  • WHEN the golden-case eval runs offline with the recorded replies of the chosen model
  • THEN no case ends refused with a content problem that names a placeholder

Existing Tool Considered

pydantic-ai is the open, maintained agent runtime that the stage job already uses: ToolboxClient runs the planner and the verifier through investigate with a RunTrace that records the limit, the tools each request offered, the tool calls and the schema violations (src/devops_cli/roadmap/stage/stage_toolbox.py:151, src/devops_cli/roadmap/agent_run.py:196). It lacks a recorder for the model's replies and the request fields, which #4204 adds. The project's golden-case eval (devops roadmap eval stage) replays recorded replies and reports the outcomes (src/devops_cli/roadmap/stage/stage_eval_run.py:56). The change adds no new library and no second word list: it uses is_placeholder (src/devops_cli/roadmap/pull_form.py:129) and the existing eval. The cost is one analysis run, one small fix, and one eval run, with a few hours of elapsed time after #4204 ships.

Key questions

  • Which cause makes the stage job get placeholder replies: window, toolset, output tool or model?: The cause is not named yet. The repository gives the test that names it, and rules out the window: ToolboxClient._window_starved raises RoadmapStageError before it reads a reply when RunTrace.limit is RunLimit.WINDOW and the run made fewer than CONST_ROADMAP_STAGE_MIN_TOOL_CALLS (8) calls (src/devops_cli/roadmap/stage/stage_toolbox.py:176, :194; docs/roadmap/stage.md:71). A placeholder reply that reaches the gates therefore did not come from a window-starved run. RunTrace also records the tools each request offered, the tool calls and the schema violations (src/devops_cli/roadmap/agent_run.py:196): a reply with 0 violations points away from the output tool, and a run that offered tools and called none points to the model. The kept replies and request fields of fix(roadmap): the stage job stages no item (placeholder replies) #4204 apply this test and name the toolset, the output tool or the model. [sources: src/devops_cli/roadmap/stage/stage_toolbox.py:176, src/devops_cli/roadmap/stage/stage_toolbox.py:194, src/devops_cli/roadmap/agent_run.py:196, docs/roadmap/stage.md:71, k8s/devops/configmap.example.yaml:39, k8s/devops/configmap.example.yaml:105]
  • When may the fix change the model of the stage slot?: Only when the analysis names the model. The owner decision of 2026-11-07 (feat(k8s): the Service uses one model for every chat slot #3874) sets deepseek-v4.1-flash-1017 for every chat slot until most roadmap steps work, and the ConfigMap says to undo that choice then (k8s/devops/configmap.example.yaml:19). A model change without the kept evidence would hide the cause and break that decision. For any other cause the stage slot keeps its model. (best practice) [sources: SECURITY.md:40, k8s/README.md:674, k8s/devops/configmap.example.yaml:19, openspec/changes/archive/2026-11-07-3874-one-model-for-service/proposal.md:5]
    • Chosen: Change the model only when the evidence names it. The owner decision of 2026-11-07 (feat(k8s): the Service uses one model for every chat slot #3874) sets one model for every chat slot until most steps work; a change without the kept evidence hides the cause and breaks that decision (k8s/devops/configmap.example.yaml:19).
    • Rejected: Change the model first as a quick test. It breaks the owner decision and hides the real cause if the cause is another one.
  • What does a degenerate reply mean in the golden-case eval?: The stage eval has no degenerate outcome. It records staged, refused, over_budget and failed (src/devops_cli/roadmap/stage/stage_eval_run.py:56), and a placeholder text is refused by the content gate, which calls is_placeholder (src/devops_cli/roadmap/stage/stage_change.py:1579, src/devops_cli/roadmap/pull_form.py:129). The criterion counts a refused case whose content problem names a placeholder. [sources: src/devops_cli/roadmap/stage/stage_eval_run.py:56, src/devops_cli/roadmap/stage/stage_change.py:1579, src/devops_cli/roadmap/pull_form.py:129]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#4204

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/high
    effort/medium
    on Nov 9, 2026
  2. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

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

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. The stage job is down. This fix waits for #4204 data. P2-Medium reflects the blocked but important work.
    • Value: High. The fix restores staging and stops placeholder replies for roadmap users.
    • Effort: Medium. The work needs cause analysis, a fix, metric checks and a golden-case eval.
    • Related: fix(roadmap): the stage job stages no item (placeholder replies) #4204, which asks for a different change. Both items address placeholder replies in the stage job; #4204 collects the incident data and the candidate removes the cause after that data exists.
  3. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at d37762b while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: src/devops_cli/roadmap/agent_run.py, src/devops_cli/roadmap/stage/stage_toolbox.py.

  4. dan-petty commented on Nov 9, 2026

    @dan-petty
    Owner

    Cause found on 2026-11-09, with one live run. The stage call never reaches claude-sonnet-5-5. The gateway sends it to deepseek-v4.1-flash-1017 as the fallback.

    Evidence:

    1. devops roadmap stage --plan --item 3576 with the Service config (slot analysis, which stage inherits through _TASK_PARENTS: model claude-sonnet-5-5, window 200000). The gateway spend log (GET /spend/logs, rows by requester_ip_address 127.0.0.1) holds 32 rows for this run, all of group deepseek-v4.1-flash-1017, none of claude-sonnet-5-5.
    2. The same run with fallbacks: [] in the request body shows the first request fail: 400 ... AnthropicException ... tool_choice: type "tool" and "any" are not supported for this model.
    3. A direct call of the gateway with one tool shows the rule: tool_choice: "required" gives 400, tool_choice: "auto" gives a tool call. The stage planner uses a pydantic-ai agent with a tool output (output_type=StageProposal). pydantic-ai resolves that to tool_choice: required when no direct text output is allowed (pydantic_ai/models/_tool_choice.py, resolve_tool_choice), and the OpenAI model sends it because the profile has openai_supports_tool_choice_required true. The comment in llm-gateway-config says that Sonnet 5.5 refuses a forced tool call and that a caller sends "auto".
    4. The fallback is claude-sonnet-5-5: [deepseek-v4.1-flash-1017] in the gateway config, so the 400 does not reach the client. The spend log shows no Sonnet row for the Service rounds after 04:19 UTC. The settings of the Service name claude-sonnet-5-5, and the stage log does not say which model answered.

    So the finding that "a strong model fails the same way" is wrong. The model that fails is DeepSeek in both cases. Window, toolset and the output tool are not the cause: the output tool is the reason for the fallback.

    Two fixes remove the cause (not built here):

    • Make the agent send tool_choice: auto for a Claude group: set the pydantic-ai model profile openai_supports_tool_choice_required=False for the group in resolve_pydantic_ai_model (src/devops_cli/ai/pydantic_ai_bridge.py). pydantic-ai then sends "auto", and a text-only reply goes back as a retry.
    • Make a fallback visible: log the model that answered a request (response.model) and count a fallback, so a slot never reads Sonnet while DeepSeek answers.

    Criterion 4 of #4204 (degenerate) stays needed: DeepSeek sends the placeholder reply.

    A second, separate defect shows in the same run: the prompt asks for null in references[].reason and the schema refuses it. It is filed as #4214.

    Not verified: that Sonnet 5.5 with tool_choice: auto returns a full StageProposal that passes the gates; the cause of the Sonnet rows before 04:19 UTC (a run that sent "auto" or a text reply); the 4096-token completions in 3 of those rows.

  5. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 9, 2026
  6. removed
    status/in-review
    owner/agent
    on Nov 9, 2026
  7. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    ContributorAuthor

    Live since 2026-11-09 10:07 UTC

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/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions