Repository navigation
Description
Problem Description
The implement runner permits a step to consume its entire token budget when progress is stalled.
In issue #3075, the implement runner executed Group 1. The task group contained 19 fault injection test cases. The runner executed 68 model requests and consumed 8,024,412 tokens before it stopped with LimitReached.
During this run, the agent encountered repeated command refusals and failing test attempts with no code progress. The implement runner continued until it exhausted roadmap.implement.step_token_budget. This consumed significant compute and model tokens without producing a commit.
Reproduction Steps
- Run an implement runner job on a task group with an extensive testing matrix.
- Let the agent fail repeatedly or encounter refused commands.
- Observe that the runner makes requests until it exhausts the 8,000,000 token budget.
Expected vs Actual Behavior
Expected: The implement runner detects lack of progress or repeated tool refusals and halts the step early.
Actual: The implement runner loops until it exhausts the entire step token budget.
Proposed Solution
Add loop detection and tool refusal limits to src/devops_cli/roadmap/implement/implement_step.py:
- Track consecutive refused tool executions and consecutive failing test runs without file edits.
- When the count exceeds a configured threshold, stop the step with a clear
FailureClass. - Provide an early failure report to the roadmap store instead of spending the full token budget.
Environment Diagnostics
- DevOps CLI Version: 0.86.0
- Python Version: 3.14.10
- Execution Environment: Roadmap Service Implement Runner
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Activity
[-]feat(roadmap): stop implement step early on repeated command refusals and stagnant iterations[/-][+]feat(roadmap): Stop the implement step early on stalls and refusals[/+]devops-cli-service commentedon Nov 8, 2026
The job shortened the title of this item. The summary had 78 characters, and the limit is 60. The type and the scope stay.
feat(roadmap): stop implement step early on repeated command refusals and stagnant iterationsfeat(roadmap): Stop the implement step early on stalls and refusalsdan-petty commentedon Nov 20, 2026
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.