Repository navigation
Description
Problem Description
pydantic-ai makes the description of each tool from the docstring of the tool function. It uses griffe with the Google docstring style. Three read tools have a Returns: section with a colon in the answer format:
callersinsrc/devops_cli/roadmap/stage/stage_tools.py: "One line for each match, aspath:line:content."file_symbolsinsrc/devops_cli/roadmap/stage/stage_tools.py: "One line for each symbol, asline: signature."search_codeinsrc/devops_cli/roadmap/refine/refine_investigation.py(the stage tools get it fromInvestigationTools): "One line for each match, aspath:line:content."
griffe reads a Google Returns: line as type: description, so it splits the line at the first colon. Each stage and refine request thus shows the model a broken answer format, for example:
<returns>
<type>One line for each match, as `path</type>
<description>line:content`.</description>
</returns>
Reproduction Steps
- Make a pydantic-ai agent with the stage tools and a
FunctionModel. - Read the
descriptionof thecallers,search_codeandfile_symbolstool definitions. - See that the answer format is split between
<type>and<description>.
The request capture of the context audit (stage_capture.py, item 3387) shows the three broken descriptions.
Expected vs Actual Behavior
Expected: the description of each read tool holds its answer format unbroken, such as path:line:content.
Actual: the answer format is split at the first colon into a <type> part and a <description> part.
Fix: put the answer format in the summary text of the docstring and remove the Returns: section. Add a test that builds the tool definitions and asserts that each read tool description holds its answer format. Do not change the answer format itself.
Environment Diagnostics
pydantic-ai tool definitions with docstring_format="auto" (griffe, Google style). Found by the context audit (item 1.8), upheld by a skeptic review.
Logs, Traces, or Terminal Output
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>'
file_symbols '<summary>List the classes, functions and methods of one source file, with their lines.</summary>\n<returns>\n<type>One line for each symbol, as `line</type>\n<description>signature`.</description>\n</returns>'
Activity
dan-petty commentedon Nov 11, 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 corrupts tool descriptions the model reads, degrading agent quality, but the system still runs.Correct tool descriptions let the model parse answers reliably, improving every stage and refine request.The fix moves text between docstring sections and adds one assertion test.Both concern pydantic-ai tool definitions, but 2489 swaps the agent runtime while this candidate fixes garbled docstring text in those tool definitions.devops-cli-service commentedon Nov 11, 2026
Released in v0.111.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.111.0
devops-cli-service commentedon Nov 11, 2026
Live since 2026-11-11 05:46 UTC