Skip to content

fix(roadmap): halt implement step on consecutive refusals - #4659

Merged
dan-petty merged 2 commits into
mainfrom
fix/4043-consecutive-refusal-stop
Nov 11, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4043-consecutive-refusal-stop

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The implement step now stops the run when the shell policy refuses 3 commands in a row, with no accepted tool call between them. Before, a model that repeated one refused command kept asking until the total limit of 30 refusals or the token budget stopped it. One run spent 8,022,108 tokens in 77 requests on 4 refused commands.

ToolCallLog keeps the count of refusals in a row. Any tool call that is not refused resets it. The stop uses the text "refused by policy", so it has the class refused_tool and the wait action. The total limit of 30 stays and still stops a model that alternates refused and accepted calls. The constant is CONST_ROADMAP_IMPLEMENT_MAX_CONSECUTIVE_REFUSALS.

Closes #4043

Change: openspec/changes/archive/2026-11-11-4043-halt-implement-step-on-consecutive-command/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 11, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Fail-to-pass run: uv run devops ci fail-to-pass --base origin/main.

  • On the base, 3 test modules fail at collection (test_roadmap_implement_shell_refusal, test_roadmap_implement_step, test_roadmap_implement_shell_policy), as they import the new constant.
  • On the base, test_every_numeric_limit_of_the_roadmap_jobs_has_a_class fails, as the table names the new constant.
  • 64 other tests of the 5 changed files pass on the base and on the head.

Local run on the head: tests/roadmap/implement, tests/roadmap/test_roadmap_failure.py and tests/roadmap/test_roadmap_limit_classes.py pass. uv run devops ci docs and uv run devops openspec check pass.

Test changes of note: tests that looped on one refused command now alternate it with a read in each reply when they prove the total limit. The extension test of #4394 uses two replies with two refusals each, so the refusals are not consecutive. No live step needed: the change has no ConfigMap or setting.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 17:01
@dan-petty
dan-petty merged commit 9bcf0f5 into main Nov 11, 2026
32 checks passed
@dan-petty
dan-petty deleted the fix/4043-consecutive-refusal-stop branch November 11, 2026 17:02
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.112.2](v0.112.1...v0.112.2)
(2026-11-11)


### Bug Fixes

* **github:** bound the GitHub session read at 60 seconds
([#4636](#4636))
([a87442a](a87442a))
* **roadmap:** bound the shadow mark probability to 0 to 1
([#4655](#4655))
([abf1166](abf1166))
* **roadmap:** halt implement step on consecutive refusals
([#4659](#4659))
([9bcf0f5](9bcf0f5))
* **security:** file an issue for each Trivy-config alert group
([#4640](#4640))
([a7668fe](a7668fe))
* **service:** route issues webhooks past scoped intake
([#4631](#4631))
([caf4c7e](caf4c7e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): halt implement step on consecutive command refusals

1 participant