Repository navigation
Description
Problem
devops roadmap eval verify stops on a case with StructuredOutputValidationError: The verification run stopped before it gave its findings: Tool <text> exceeded max retries count of 2. The pass reads the repository as an agent since #3039, and the run ends before the model gives its findings. The case counts as failed, so it gives no recall and no false-alarm count.
I saw it on 2026-11-06 with the model qwen3.8:27b of the verification task, at the commit that merged #3710. Three runs gave the same error: the good case of #3410 twice, and good-2739-the-subprocess-environment-guard-accepts-gh once. Each run took about 5 minutes before it stopped. The same model gave findings on the same cases with the single-call pass before #3039.
Expected
A run of the verification pass on a case gives its findings, or it names the cause of the stop. The cause is a text reply in place of the output tool, a refused tool call, or a run that has no budget left. The pass retries or ends the run with a reason that a person can act on.
Acceptance criteria
- A run with a model that answers in text in place of the output tool gives the findings of the model or a stop whose message names the cause. A test with a scripted model shows the case.
devops roadmap eval verify --case <case>with the local verification model gives findings on the good case of fix(roadmap): the stage gate proves a negative search verify #3410 and ongood-2739-the-subprocess-environment-guard-accepts-gh, or the report names why it cannot.
Existing tool considered
The harness is pydantic-ai, which raises the error after the output retries. Its option output_retries and its text output mode may cover the case. The change must read the pydantic-ai documents before it adds code.
Related
#3039 added the agent pass. #3688 holds a related fault of the same eval: two golden cases have no real base commit.
Proposed design
Problem statement
devops roadmap eval verify stops on a case with StructuredOutputValidationError: The verification run stopped before it gave its findings: Tool <text> exceeded max retries count of 2. The agent pass reads the repository since #3039, and the model qwen3.8:27b ends the run with an unknown tool call or a text reply instead of the output tool. run_error_message hides the quoted tool name as <text>, so the report names no cause. The case counts as failed, so it gives no recall and no false-alarm count. The pass must return the findings or stop with a cause that a person can act on.
Acceptance criteria
Requirement: Text reply accepted
The verification run SHALL accept a plain-text reply that holds the findings in place of the output tool call.
Scenario: Text reply holds the findings
- WHEN A scripted model replies with text that holds the findings JSON and calls no output tool.
- THEN The run returns those findings and records no stop.
Requirement: Text reply without findings
The verification run MUST stop with a reason that names the text reply when the text holds no findings.
Scenario: Text reply holds no findings
- WHEN A scripted model replies with text that holds no findings and calls no output tool.
- THEN The run stops with the reason
text_replyand a message that names the text reply.
Requirement: Exhausted output retries
The verification run MUST map an exhausted output retry to a stop that names the retry limit.
Scenario: Output retries are exhausted
- WHEN A scripted model gives an invalid findings call three times and the output retry limit is two.
- THEN The stop names the retry limit 2 and the reason
output_retries_exhausted.
Requirement: Refused tool call
The verification run MUST stop with a reason that names a refused tool call.
Scenario: Tool call refused
- WHEN A scripted model calls a tool that the run does not offer.
- THEN The run stops with the reason
refused_tool_calland the name of the tool.
Requirement: Exhausted budget
The verification run MUST stop with a reason that names the exhausted budget.
Scenario: Budget exhausted
- WHEN A scripted run reaches the tool-call or token limit.
- THEN The run stops with the reason
budget_exhaustedand the name of the limit.
Requirement: Case report holds the stop reason
The eval verify report SHALL record the stop reason of each failed case.
Scenario: Failed case report
- WHEN A case run stops with a typed reason.
- THEN The JSON report holds that reason for the case, and the text report names it.
Existing Tool Considered
No alternatives check has run (alternatives is null). pydantic-ai, the open, maintained harness already in use, covers the need: its output mode accepts a union of Verification and str, so a text reply becomes the output, and its retries={\"output\": n} sets the output retry limit. It lacks a default that accepts text for a structured output type, so the change sets the union output type and validates the text with the existing _repair_and_validate_payload parser. It adds no library and no second parser.
Key questions
- How does the verification pass get the findings when the model replies in text?: Set the agent's output type to the union of
Verificationandstr, as pydantic-ai's union output mode describes, and validate the text with the existing_repair_and_validate_payloadparser; a text reply that does not validate stops withtext_reply. (best practice) [sources: src/devops_cli/ai/client/structured.py:103]- Chosen: Union output type with text. pydantic-ai accepts a text reply for the
strmember, so the run keeps the findings that the model gave. - Rejected: Higher
output_retries. A higher limit repeats the 5-minute run and does not make the model call the output tool. - Rejected: Catch
UnexpectedModelBehavioronly. It reports the stop but loses the findings that the text holds. Keep it as the fallback.
- Chosen: Union output type with text. pydantic-ai accepts a text reply for the
- Which parser reads the text reply?: The existing
_repair_and_validate_payloadinsrc/devops_cli/ai/client/structured.py, which repairs and validates a reply against the schema and is already tested; the change adds no second parser. (best practice) [sources: src/devops_cli/ai/client/structured.py:103, tests/ai/client/test_ai_client_structured.py:74]- Chosen: Reuse the existing parser. The single-call pass gave findings on the same cases, so its parser reads the same text, and it is already covered by a test.
- Rejected: Add a new parser. A second parser duplicates the schema and its tests.
- Which stop reasons must the pass name?: Four typed reasons:
text_reply,refused_tool_call,budget_exhaustedandoutput_retries_exhausted;investigatefills the reason and the tool or limit name from the captured messages, not from the masked message text. (best practice) [sources: src/devops_cli/roadmap/refine/refine_investigation.py:138, src/devops_cli/roadmap/refine/refine_investigation.py:452, src/devops_cli/roadmap/agent_run.py:113]- Chosen: Typed stop reason for each cause. The Expected lists the causes, and a typed reason lets the report and a test act on it.
- Rejected: Pass the pydantic-ai message through. The raw message names
Tool <text>and no cause that a person can act on.
- Where does the pass read the name of the tool that a refused call names?: From the tool calls of the last model response, not from the error message:
run_error_messagereplaces each quoted part, including a tool name, with<text>. [sources: src/devops_cli/roadmap/agent_run.py:113, src/devops_cli/roadmap/refine/refine_investigation.py:385] - Does the change increase the output retry limit?: No. Keep
CONST_ROADMAP_REFINE_INVESTIGATION_RETRIES(2) for tools and output; the union output removes the retry loop for a text reply, and each retry costs about five minutes. (best practice) [sources: src/devops_cli/config/constants.py:3092, src/devops_cli/roadmap/refine/refine_investigation.py:433]- Chosen: Keep the limit. The union output type removes the retry loop for a text reply.
- Rejected: Increase the limit. Each retry costs about 5 minutes and does not fix a model that never calls the tool.
- Does the eval verify report hold the stop reason?: The JSON report already writes each failed case's
errorstring (cases[].error), and the text report prints only the failed count. Add a typedreasontoCaseOutcome, serialize it ascases[].reason, and print it next to the failed count. (best practice) [sources: src/devops_cli/roadmap/stage/stage_verify_eval.py:76, src/devops_cli/roadmap/stage/stage_verify_eval.py:249, src/devops_cli/roadmap/stage/stage_verify_eval.py:339, src/devops_cli/roadmap/stage/stage_verify_eval.py:370]- Chosen: Add a typed
reasonfield. The report already has the free-texterror; a typed field lets a test and the text report read the cause without parsing the message. - Rejected: Write the reason into
erroronly. It mixes the typed cause with the masked message, so a test or a person must parse it.
- Chosen: Add a typed
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-08: in-use.
The item already names this tool.
Tool: pydantic/pydantic-ai (https://github.com/pydantic/pydantic-ai), MIT, last activity 2026-11-08, maintained.
Activity
dan-petty commentedon Nov 6, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.The bug blocks the eval verify pass from producing findings on affected cases, but it does not stop development or expose a security risk.The eval verify pass is the quality gate for roadmap items, and a silent stop removes recall and false-alarm data.The fix needs a text-output fallback or a named stop reason, a scripted-model test, and a read of the pydantic-ai docs.Both deal with pydantic-ai tool retry limits in the roadmap agent, but #3271 fixes the implement step budget while the candidate fixes the eval verify pass text-tool stop.devops-cli-service commentedon Nov 7, 2026
Status set to Ready at 72c52c6 (see proposed design in issue body).
Moved to new items: #3956.
devops-cli-service commentedon Nov 8, 2026
Alternatives check: in-use
Reason: The searches found pydantic-ai, the open, maintained harness the issue names as the one that raises the error; its configurable output retries and its output mode that accepts a text member cover the text reply and the exhausted-retry stop without a new library or parser. It lacks a default text fallback for a structured output type, so the pass still sets the union output type, validates the text with its existing parser and maps each stop to a typed reason.
The item already names this tool.
Tool: pydantic/pydantic-ai (https://github.com/pydantic/pydantic-ai)
Covers:
output_retries_exhaustedstraccepts a plain-text reply in place of the output tool, so the findings are keptLacks:
_repair_and_validate_payload<text>, so the pass must read the tool name from the last model responsetext_reply,refused_tool_call,budget_exhaustedandoutput_retries_exhaustedmust be added by the pass and the reportTools considered:
Searches run:
Sources:
Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 13, 2026
The same stop occurred again on 2026-11-13 with the model
qwen3.8:27bof the verification task, at 0.128.0 (origin/main 2daf63a). The case2166-the-unused-run-subprocess-re-importofuv run devops roadmap eval verify --case 2166ended as failed:RoadmapStageError: A tool call of the run held invalid arguments, which are not one JSON text: Tool <text> exceeded max retries count of 2. ... The model made several tool calls in one reply and the gateway joined their arguments.The same case runs with
--model deepseek-v4.1-flash-1017. So the configured local model still cannot run the agent pass of the eval.64 remaining items
fix(roadmap): Type the stop of an agent run from its messages (#3717)
fix(roadmap): Give the findings of a text reply and name the stop (#3717
fix(roadmap): Record the stop reason of a failed eval case (#3717)
fix(roadmap): give an offered tool with bad arguments its own stop re…
docs(openspec): archive the change (#3717)
fix(roadmap): Type the stop of an agent run from its messages (#3717)
fix(roadmap): Give the findings of a text reply and name the stop (#3717
fix(roadmap): Record the stop reason of a failed eval case (#3717)
fix(roadmap): give an offered tool with bad arguments its own stop re…
docs(openspec): archive the change (#3717)
devops-cli-service commentedon Nov 19, 2026
Released in v0.179.5: https://github.com/dan-petty/devops-cli/releases/tag/v0.179.5
devops-cli-service commentedon Nov 19, 2026
Live since 2026-11-19 11:42 UTC