Skip to content

fix(roadmap): tool docstrings garble the answer format - #4486

Merged
dan-petty merged 2 commits into
mainfrom
fix/4482-tool-docstrings-answer-format
Nov 11, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/4482-tool-docstrings-answer-format

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

pydantic-ai makes the description of each tool from the docstring of its function, with griffe and the Google style. griffe reads a Returns: line as type: description, so it split the answer format of callers, file_symbols and search_code at its first colon. Each stage and refine request thus showed the model a broken format, with path in a <type> part and line:content in a <description> part.

The summary of each of the three docstrings now holds the answer format, as find_issues already does, and the Returns: sections go. Each description is now plain text with the whole format. The answer format of each tool does not change. A new test builds the tools of the stage toolbox and of the refine investigation, and asserts that each read tool description holds its answer format whole and that no description has a <returns> part.

Closes #4482

Change: openspec/changes/archive/2026-11-11-4482-tool-docstrings-garble-the-answer-format/

pydantic-ai reads a Google Returns: line as type: description, so it split the answer format of callers, file_symbols and search_code at its first colon. The summary of each docstring now holds the format, and the Returns: sections go. A test reads each read tool description as pydantic-ai sends it.
@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

Test results for this pull request.

fail-to-pass (uv run devops ci fail-to-pass --base origin/main, after the rebase onto origin/main):

failed on base: tests.roadmap.stage.test_roadmap_stage_tools::test_each_read_tool_description_shows_its_answer_format_unbroken (AssertionError: assert {'stage searc...ine:content`'} == {})
1 failed on base (1 failed and 99 passed in tests/roadmap/stage/test_roadmap_stage_tools.py; 0 errored).

Targeted tests (uv run devops ci test tests/roadmap/stage/test_roadmap_stage_tools.py tests/roadmap/refine/test_roadmap_refine_investigation.py): 159 passed.

Descriptions before and after (the tool_def.description of each Tool, as pydantic-ai sends it):

before: search_code | <summary>Search the files of the repository for a text, in any case.</summary>\n<returns>\n<type>One line for each match, as `path</type>\n<description>line:content`.</description>\n</returns>
after:  search_code | Search the files of the repository for a text, in any case.\nEach match is one line, as `path:line:content`.
after:  file_symbols | List the classes, functions and methods of one source file, with their lines.\nEach symbol is one line, as `line: signature`.
after:  callers | List the places that call a function, a method or a class: each name followed by `(`.\nEach match is one line, as `path:line:content`.

Full local CI (flock .data/agent/ci.lock uv run devops ci, before the OpenSpec commit): every row passed but test, which timed out after 1800 s on a loaded host (load average about 45), and coverage, which needs it. The GitHub checks run the full suite. uv run devops openspec check passed, and the pre-commit and pre-push hooks passed.

No ConfigMap or cluster step is needed: the change adds and removes no setting.

@dan-petty
dan-petty marked this pull request as ready for review November 11, 2026 04:37
@dan-petty
dan-petty enabled auto-merge (squash) November 11, 2026 04:37
@dan-petty
dan-petty merged commit 2f6114f into main Nov 11, 2026
32 checks passed
@dan-petty
dan-petty deleted the fix/4482-tool-docstrings-answer-format branch November 11, 2026 04:42
dan-petty pushed a commit that referenced this pull request Nov 11, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.111.0](v0.110.0...v0.111.0)
(2026-11-11)


### Features

* **roadmap:** a decision-point registry with a resolver chain
([#4453](#4453))
([b73e97a](b73e97a))
* **roadmap:** eval verify stores each case and resumes
([#4451](#4451))
([7c59565](7c59565))
* **roadmap:** extend a step budget when the run makes progress
([#4464](#4464))
([c8ed108](c8ed108))


### Bug Fixes

* **ai:** a failed model transport names its phase and its error
([#4460](#4460))
([54743c4](54743c4))
* **ai:** price the DeepSeek group and its cached input
([#4454](#4454))
([3b1f6bd](3b1f6bd))
* **roadmap:** stage and refine send no answer count or row
([#4484](#4484))
([d9c8ee8](d9c8ee8))
* **roadmap:** tool docstrings garble the answer format
([#4486](#4486))
([2f6114f](2f6114f))


### Performance Improvements

* **roadmap:** parse only the bodies that hold a job record
([#4455](#4455))
([c653bde](c653bde))
* **tests:** evaluate hour-scale promtool tests every hour
([#4462](#4462))
([0ac2f76](0ac2f76))

---
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): tool docstrings garble the answer format

1 participant