Repository navigation
Description
Problem Description
The stage job keeps the plan of an item that passed the gates as a file (#4167). On a hit, _gated in src/devops_cli/roadmap/stage/stage.py uses the kept plan as the first reply (proposal = first or self._ask_plan(...)) and gates it again on the current staged commit. The commit moved, so the path:LINE:text citations of the kept plan point at moved lines, and newer gates also refuse it. That refusal goes through _returned and uses one of the roadmap.stage.gate_returns returns (default 3, at most 3, #4802, #4900). So an item with a kept plan gets 3 planner runs, and an item without one gets 4 (the first reply and 3 returns). The kept plan made no model request, so it should use no return.
Reproduction Steps
- Plan an item with
devops roadmap stage --planso that the plan passes the gates and the plan file is kept, then let the review or a later step fail. - Move the staged commit so that a gate refuses the kept plan (for example, a cited line moves).
- Plan the item again with a planner that gives refused replies.
- Count the planner requests and read the
stage gate returns:line.
Expected vs Actual Behavior
Expected: a refused kept plan uses no gate return. The planner gets a new first reply with the kept plan and its problems, then the normal roadmap.stage.gate_returns returns, as an item without a kept plan does (4 planner runs at the default). The stage gate returns: line counts only the returns after that first reply. After the Service stops, no new planner request starts (#4900).
Actual: the refused kept plan counts as the first reply, so the planner gets only 3 runs, and a new first reply that passes logs returns=1.
Environment Diagnostics
devops-cli 0.116.1 on the roadmap Service (roadmap-service, namespace devops), after the rollout at 2026-11-12T05:26Z.
Logs, Traces, or Terminal Output
05:29:44Z stage reply refused: item=#1858 request=1 input_tokens=0 tools_offered=False tool_calls=0 limit=none finish_reason=none answered=none result=refused
05:37:36Z stage reply refused: item=#1858 request=19 input_tokens=97441 tools_offered=True tool_calls=40 ... result=refused
05:46:20Z stage reply refused: item=#1858 request=19 input_tokens=117440 tools_offered=True tool_calls=41 ... result=refused
05:52:37Z stage reply refused: item=#1858 request=13 input_tokens=78323 tools_offered=True tool_calls=25 ... result=refused
05:52:37Z stage gate returns: repo=dan-petty/devops-cli item=#1858 returns=3 result=refused version=0.116.1
The first line is the kept plan: request=1 and input_tokens=0 mean that no model request made it. The same shape is in the log for #3049, #3387 (2026-11-12 01:23Z) and #3389 (03:48Z) before that rollout. The stage-drought diagnosis ranks this cause at about 1 of 24 failed stage rounds; devops_cli_roadmap_stage_plan_record_total{result="hit"} had 13 points in 24 hours.
#4851 depends on this fix ("a refused kept plan uses no return").
Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate.
Activity
devops-cli-service commentedon Nov 12, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The bug gives the planner one fewer run in production and blocks #4851, but the measured impact is moderate.The fix restores the intended planner retry budget and prevents avoidable stage failures.The change is a targeted correction in '_gated' with a small test update.Both items concern stage gate returns, but #4851 extends the returns while the candidate stops a refused kept plan from using one.dan-petty commentedon Nov 12, 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 wastes planner runs on kept plans but does not block the stage pipeline entirely.It saves one planner run per refused kept plan and makes the return count accurate.The fix is a targeted change in _gated to skip the return counter for a kept plan.Both concern stage gate returns in _gated, but #4851 extends the return count while the candidate stops a kept plan from consuming a return.devops-cli-service commentedon Nov 12, 2026
Released in v0.119.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.119.0
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 15:46 UTC