docs: clarify descriptions for variadic tool parameters - #5223
Merged
Merged
Conversation
Explain the existing Field description limitation and document supported docstring and Annotated descriptions, including their precedence. Based on Subhash Polisetti's original clarification and example in #4954. Co-authored-by: subhash polisetti <subhashr161347@gmail.com>
jbeckwith-oai
requested review from
a team,
rm-openai and
seratch
as code owners
September 28, 2026 16:34
4 tasks
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e6a73ed65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
dpiet-oai
approved these changes
Sep 28, 2026
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
This pull request updates the function-tool documentation to clarify that
Field(description=...)in a variadic parameter annotation is ignored. The existing section describesFieldconstraints and descriptions broadly, which can lead readers to expect both to apply to*argsand**kwargs.The clarification shows how to supply the parameter description through a docstring or an
Annotatedstring, states docstring precedence when parsing is enabled, and separates the description guidance from the per-value constraint and tuple guidance. It also shows the supported@tool(strict_mode=False)configuration and nested argument object for**kwargs. This describes behavior already available in v0.22.3 and does not change the SDK runtime.Attribution
Based on #4954 by Subhash Polisetti (@subhashpolisetti), who identified the documentation gap, supplied the original clarification and example, and verified the supported alternatives. This replacement carries that contribution forward with paragraph restructuring and explicit description precedence. Subhash is credited as a co-author of the commit.
Supersedes #4954 and follows the maintainer direction in #4951.
Test plan
agents.decorators.toolAPI verified the ignoredFielddescription,Annotateddescription, docstring precedence, disabled-docstring fallback, and non-strict**kwargsdescription. All cases retained per-value numeric constraints.**scoresparameters withstrict_mode=False; the current implementation rejects both under default strict mode.make build-docspassed (145 seconds; warnings in unchanged reference documentation). The later text-only**kwargsclarification adds no links, structure, or executable blocks; final-head CI verifies the docs build again.git diff --check.The full SDK verification stack is not applicable to this documentation-only content change. Generated translations are unchanged.
Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PR