Skip to content

fix(roadmap): a shell refusal of the implement step counts no tool retry - #3526

Merged
dan-petty merged 3 commits into
mainfrom
fix/3271-shell-refusal-no-retry
Nov 4, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/3271-shell-refusal-no-retry

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A shell refusal of the implement step now comes back to the model as a normal tool result with its hint. It adds no tool retry. Before this change, each refusal counted as a retry. Five refusals in a row ended the run, and the step lost all its work.

A new capability, ShellRefusal, wraps the toolset and returns the refusal as text. It replaces the two refusal hooks. A new limit, CONST_ROADMAP_IMPLEMENT_MAX_REFUSALS (30), ends a step that loops on refused commands. The stop uses the existing failure class refused_tool. A failed tool call keeps the limit of five retries in a row.

Closes #3271
Change: openspec/changes/archive/2026-11-04-3271-shell-refusal-counts-no-retry/

A refusal of the shell by policy is no failure of the tool, yet the retry count of
pydantic-ai counted it, and the sixth refusal stopped the step. The refusal now comes
back as a normal tool result that names the replacement. A real failure of a tool still
counts. A limit of 30 refusals in one step ends a loop with the class refused_tool.

Refs #3271
@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 4, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Proof and test results for this pull request.

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

  • tests/roadmap/test_roadmap_implement_shell_refusal.py, test_roadmap_implement_step.py, test_roadmap_implement_shell_policy.py and test_roadmap_implement_tool_log.py error at collection (the import of CONST_ROADMAP_IMPLEMENT_MAX_REFUSALS fails).
  • test_roadmap_limit_classes.py::test_every_numeric_limit_of_the_roadmap_jobs_has_a_class fails on the base.
  • All of them pass with this change.
  • Before the change, the new tests test_a_refusal_comes_back_as_a_tool_result_and_not_as_a_retry and test_the_model_gets_the_limit_of_refusals_with_a_hint_and_the_next_call_ends_the_run stopped the run at 6 requests with a RetryPromptPart.

Local full uv run devops ci: 18303 passed, 2 failed, 1 error. The failures are in tests/ai/test_tool_executor_contract.py (a popeye binary on the host) and tests/commands/test_devcontainer_install_tools_dry_run.py (a devcontainer binary on the host). Both depend on tools installed on this workstation and touch no file of this change. The GitHub runner shows if they fail there too.

Follow-up: #3520 holds the read pipe through a table of right-hand programs, and the table or digest for the first word that the log shows as other.

For the owner: the item #3041 still lists, in its criterion 3, a refusal limit. The evaluation of #3271 asks to remove that criterion and name #3271 as a dependency in ### Dependencies. I did not edit #3041.

@dan-petty
dan-petty marked this pull request as ready for review November 4, 2026 22:07
@dan-petty
dan-petty merged commit 1905269 into main Nov 4, 2026
36 of 38 checks passed
@dan-petty
dan-petty deleted the fix/3271-shell-refusal-no-retry branch November 4, 2026 22:07
dan-petty pushed a commit that referenced this pull request Nov 4, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.56.3](v0.56.2...v0.56.3)
(2026-11-04)


### Bug Fixes

* **roadmap:** a new runner image clears only a stop that it can fix
([#3527](#3527))
([48f94d7](48f94d7))
* **roadmap:** a shell refusal of the implement step counts no tool
retry ([#3526](#3526))
([1905269](1905269))

---
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): raise or configure implement tool retry budget

1 participant