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.
dan-petty commentedon Nov 30, 2026
Triage under #6519 (owner instruction of 2026-11-30), before the hold #6521 closes. This item adds or extends a gate, refusal, screen, cap, limit, retry, result line, shell allowlist, tool catalog or plan-shape rule of the stage, implement or fix-checks job. #6519 found that 263 of about 900 issues in four weeks added such rules and none replaced the engine. Stage now runs on stock Coder (grade 60 on 30 graded attempts), where the agent reads the repository, runs the checks in its loop and has a real shell; implement follows (#6527). The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned; a person may reopen it.