Repository navigation
Description
Problem Description
The implement runner stops with UnexpectedModelBehavior when a tool reaches five retries.
In src/devops_cli/config/constants.py, CONST_ROADMAP_IMPLEMENT_TOOL_RETRIES hardcodes this limit to 5.
Pydantic AI counts retries across the full execution of the task group.
Long steps with many tool calls hit this limit easily.
Minor command refusals or shell syntax errors accumulate until the fifth retry aborts the step.
This aborted task group 2 during the implementation of issue #2572.
Reproduction Steps
- Configure an item with multiple tasks in a group.
- Run
devops roadmap implement --item <number>. - Cause the agent to encounter five tool retries (such as shell refusals) across 50 requests.
- Observe the step abort with
UnexpectedModelBehavior: Tool 'shell' exceeded max retries count of 5.
Expected vs Actual Behavior
Expected the tool retry limit to be configurable and sized for long multi-turn sessions.
Actual behavior hardcodes the limit to 5 across the entire task group.
Target Subsystem
src/devops_cli/roadmap/implement_step.py, src/devops_cli/config/constants.py
Existing Tool Considered
None. This is internal implement job configuration.
The cost to fix is tuning CONST_ROADMAP_IMPLEMENT_TOOL_RETRIES or adding settings.roadmap.implement.tool_retries.
Evaluation 2026-11-04
The stated cause is wrong. Pydantic AI does not count retries across the full execution. pydantic_ai/tool_manager.py:331-342 removes a tool that succeeded from the retry count, so the count is of failures in a row. A higher limit only moves the stop. In the window 2026-11-03T15:05Z to 2026-11-04T15:05Z, 11 stops have the class refused_tool. They hold 201 refused commands, at most 37 in one run (#2116, 2026-11-04T05:58Z), and 45,964,971 input tokens. One stop has no table, so the token sum is a low count.
The title no longer fits. Proposed title: fix(roadmap): a shell refusal of the implement step counts no tool retry.
Design that replaces the text above.
- A policy refusal returns a normal tool result that names the replacement, and it counts no retry. A real failure of a tool still counts.
_executeinsrc/devops_cli/roadmap/implement_shell_refusal.pycan return text in place ofraise ModelRetry. - The agent shell allows a read pipe through a table of allowed right-hand programs, such as
head,grepandwc. Removing|fromCONST_ROADMAP_IMPLEMENT_DENIED_OPERATORS(constants.py:3247-3259) would also allow| sh, because the harness reads the first word only. A leadingcd <checkout> &&is harmless. Verification lines stay a list of words with no shell (openspec/specs/roadmap-implement-step/spec.md:70). - Extend the known-program table of
logged_program, or log a digest as the trace does. Never write a free first word:src/devops_cli/roadmap/implement_tool_log.py:119-127says that it can hold a secret. A change to that rule goes to the owner. The wordotheris 91 of the 201 refused commands. - A limit on total refusals in a step stops a loop. The plan names the number, the failure class and the stop text.
- This issue replaces criterion 3 of feat(roadmap): the implement agent can use the project's development tools #3041, "The refusal limit counts only calls that the catalog has no entry for". The two rules differ, so reword it against
SHELL_PROGRAMS. Edit feat(roadmap): the implement agent can use the project's development tools #3041 in the same pass, to remove the criterion and to name this issue under a### Dependenciesheading above its refine block.
Decision on roadmap.implement.tool_retries. Drop the setting and the default of 50. When a refusal counts no retry, the count holds only real failures in a row, and the constant of 5 stays right for them. The requirements on the setting in the refine block go.
Spec. The plan needs MODIFIED deltas for openspec/specs/roadmap-implement-step/spec.md:106, :150, :180, :304-308 and :335.
Size. Item 1 is small. Items 2 and 3 are larger, so split them into a second issue if the plan does not fit one pull request. #3053 also names shell refusals. It is broader and stays open.
Refused commands in the text of a plan task add to this count. A task that tells the agent to run !, a pipe or helm costs retries on the plan's own text.
Proposed design
Problem statement
placeholder
Acceptance criteria
Existing Tool Considered
placeholder
Key questions
None.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 2, 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.It causes complete loss of work on long multi-tool steps, but shorter steps or fewer tool calls can work around it.It prevents aborts and work loss in legitimate long implement sessions that exceed five retries.The fix is changing one constant or adding one config key in two files.Both adjust limits in config/constants.py for the implement step, but #3206 raises total call and token caps while the candidate targets the per-tool retry count.devops-cli-service commentedon Nov 3, 2026
Status set to Ready at b1a6c8e (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.
Evidence:
placeholder
dan-petty commentedon Nov 4, 2026
The stage comment of 2026-11-03T00:28Z gave the evidence
placeholder. That text is false, because it is no finding on the premise. The real problem with the premise is in the sectionEvaluation 2026-11-04of the body: the retry count is of failures in a row. Do not set Ready by hand, because the stage job would then plan from the refine block, which sets a default of 50. The body edit starts a new refine round, and refine then writes the block again.dan-petty commentedon Nov 4, 2026
The owner asked for this priority change on 2026-11-04. The blocker rule sets P1 here: this item blocks #2116, #2462 and #2469, which are P2. It is also the largest stop class in the window, with 11 of 39 stops.
devops-cli-service commentedon Nov 4, 2026
Refine cannot set this item to Ready at 67d3f47 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
devops-cli-service commentedon Nov 4, 2026
Released in v0.56.3: https://github.com/dan-petty/devops-cli/releases/tag/v0.56.3
devops-cli-service commentedon Nov 4, 2026
Live since 2026-11-04 22:29 UTC