Skip to content

fix(roadmap): say why an implement step stopped - #2762

Merged
dan-petty merged 8 commits into
mainfrom
fix/2758-implement-stop-cause
Oct 30, 2026
Merged

dan-petty merged 8 commits into
mainfrom
fix/2758-implement-stop-cause

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

A stopped implement step now says why it stopped, and the Job log shows what the agent did.

The reason of a stopped step now holds the class and the message of the pydantic-ai error. The step masks the message and cuts it. The reason also ends with two counts: the shell commands that the shell refused, and the other retries. A model that keeps asking for a program outside the allowlist now shows "Refused commands: 6".

The agent also gets a pydantic-ai Hooks capability. It writes one line to the standard error stream for each tool call: the tool name, the program, and the outcome (ok, refused, retry or failed). The program is the first word of a shell command, and only when it is a program of the allowlist. Any other first word is written as "other". A line holds no argument, no file content, no output and no refusal text.

The table output of the command now escapes the reason and the last message. A bracket in an error message no longer raises a markup error.

Closes #2758

Plans #2758. The change records the premise, the design and the tasks.
…sage and the retry counts (#2758)

The reason holds the class and the masked, cut message of the pydantic-ai
error. It also counts the refused commands and the other tool retries.
…#2758)

The line holds the tool name, the first word of a shell command and the
outcome. It holds no argument, file content or output.
The log line of a tool call goes to stderr. The command tests parsed the mixed output.
…ds as refused (#2758)

The Job log wrote the first word of a shell command. A word such as
API_KEY=hunter2 reached the log. The log now writes a program of the
allowlist by name and any other first word as other.

The count of refused commands also held refused file paths. It now counts
a call as refused only when the call has a shell command. The table of a
stopped step escapes the reason and the last message, as the reason now
holds the message of a pydantic-ai error.
… review fixes (#2758)

The archived record now matches the code: the program word of the log
line, the count of refused shell commands, the table escape, and the file
list and the tasks as built.
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results and review notes.

Fail-to-pass run (devops ci fail-to-pass --base origin/main): 2 tests failed on base, 16 passed on base, and 2 files errored on base at collection (test_roadmap_implement_step, test_roadmap_implement_tool_log). Those two files import the new module, so they cannot load on the base. One command test failed on base for the new table escape (MarkupError). One failed on base for the missing log line.

Full devops ci: all checks passed except one flaky test, test_telemetry_shutdown_sync::test_shutdown_joins_all_worker_threads. It passes alone. It failed while other agents loaded the host. The test check took 352 s on the loaded host. CI on GitHub will show the true time.

Review findings fixed:

  • Refused count held refused file paths. A call now counts as refused only when it has a shell command. A refused path counts as an other retry. Tests added.
  • The first word of the command could leak a secret. The log now writes a program of the allowlist by name and any other first word as "other". The first word is read with shlex, as the harness shell reads it. The mask and the 64-character cut are gone. Tests cover an assignment, a path, a token, an escape sequence, an unclosed quote and pytest.
  • A reason with brackets broke the table output. render_outcome now escapes the reason and the last message. Test added.
  • The ToolCallLog import in test_roadmap_implement_step.py is back at the top of the file.
  • The archived tasks, proposal and design now match the diff.

Finding declined:

  • The log line has no reason word for a refusal. The issue forbids the refusal text in the log. A reason word would need a parse of that text. The tool name and the program already tell the cases apart. The design records this choice.

@dan-petty
dan-petty marked this pull request as ready for review October 30, 2026 04:57
@dan-petty
dan-petty merged commit cd56ce4 into main Oct 30, 2026
18 checks passed
@dan-petty
dan-petty deleted the fix/2758-implement-stop-cause branch October 30, 2026 08:21
dan-petty pushed a commit that referenced this pull request Oct 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.22.1](v0.22.0...v0.22.1)
(2026-10-30)


### Bug Fixes

* **github:** ask no traffic endpoint as the App
([#2759](#2759))
([692c15f](692c15f)),
closes [#2752](#2752)
* **roadmap:** a stop of the Service is not a failed round
([#2756](#2756))
([0b7e190](0b7e190)),
closes [#2753](#2753)
* **roadmap:** say why an implement step stopped
([#2762](#2762))
([cd56ce4](cd56ce4)),
closes [#2758](#2758)
* **service:** render and alert on the hourly request budget
([#2760](#2760))
([809d85b](809d85b)),
closes [#2755](#2755)
* **service:** run the implement row on the status lane
([#2763](#2763))
([cd94f2c](cd94f2c)),
closes [#2757](#2757)


### Performance Improvements

* **ci:** cut test job time and guard its mean
([#2764](#2764))
([e76f656](e76f656)),
closes [#2699](#2699)

---
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): an implement step that stops on UnexpectedModelBehavior hides the cause and logs no tool call

1 participant