Repository navigation
docs(agents): an API model's field is described by its docstring, not a doc comment - #2416
Open
eddie-on-gh wants to merge 1 commit into
Open
eddie-on-gh wants to merge 1 commit into
eddie-on-gh wants to merge 1 commit into
Conversation
… a doc comment pydantic reads a field's description from the docstring below it (use_attribute_docstrings) or from Field(description=...), never from a comment, so the rule that gave a pydantic model's field a #: comment disagreed with how serve's models are written. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J4hJpwavraAeZtwdiZckZq
eddie-on-gh
marked this pull request as ready for review
November 18, 2026 00:11
|
Sorry @eddie-on-gh, this account has used its review budget of 1,500,000 diff characters for the last 7 days. You can request another review in 20 hours and 6 minutes by commenting |
|
Claude finished @eddie-on-gh's task in 11s —— View job ReviewNo issues found. The new AGENTS.md paragraph matches the code:
Trust model: this PR changes AGENTS.md only. It is a docs-convention change and lets the loop do nothing new. Docs-only, so no tests are needed. Line wrapping is within 120. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AGENTS.md told agents to put a
#:doc comment above a pydantic model's field. pydantic never reads a comment: it takes a field's description from the docstring below it (use_attribute_docstrings, whichserve.schema.Modelsets) or fromField(description=...). The API models are already written that way, so the rule disagreed with the code. Found while scoping thedoc-commentscodemod (#2413).What changes
canopy.serve.schema.Modelis described by the docstring directly below it; a comment above it is a note kept out of the schema and stays a plain#.Field(description=...).#:.Tests
make fmtandmake lint. Docs only, so no tests.Docs
AGENTS.md, Code conventions. No design or decision change.Generated by Claude Code