Skip to content

Hide docstring content below \f in parameter descriptions too - #368

Merged
amascolo merged 2 commits into
mainfrom
fix/f-docstring
Sep 3, 2026
Merged

Hide docstring content below \f in parameter descriptions too#368
amascolo merged 2 commits into
mainfrom
fix/f-docstring

Conversation

@amascolo

@amascolo amascolo commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Note the deleted comment about following FastAPI was wrong, as we have been using a different convention:

  • FutureHouse/Edison: r'\f' i.e.'\\f'
  • FastAPI:'\f' i.e. form feed character

@amascolo
amascolo requested a review from Eddie-MG September 2, 2026 22:39
@amascolo amascolo self-assigned this Sep 2, 2026
Copilot AI lite review requested due to automatic review settings September 2, 2026 22:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The change is small, well-scoped, and includes a targeted regression test validating the new behavior.

Pull request overview

This PR updates tool-schema generation to consistently hide docstring content after the \\f marker, extending the behavior from function-level descriptions to parameter descriptions as well.

Changes:

  • Add a shared _strip_hidden() helper to strip docstring/parameter text after the \\f marker.
  • Apply _strip_hidden() to both the function description and each parameter description when building the tool JSON schema.
  • Add a regression test ensuring \\f inside a parameter description is ignored.
File summaries
File Description
src/aviary/tools/base.py Centralizes and applies \\f-based stripping for function + parameter descriptions during schema generation.
tests/test_tools.py Adds coverage for \\f appearing within a parameter description line.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/aviary/tools/base.py Outdated
@amascolo
amascolo merged commit 9b420ea into main Sep 3, 2026
5 checks passed
@amascolo
amascolo deleted the fix/f-docstring branch September 3, 2026 00:52
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.

3 participants