Skip to content

docs: clarify descriptions for variadic tool parameters - #5223

Merged
jbeckwith-oai merged 2 commits into
mainfrom
codex/clarify-variadic-field-descriptions
Sep 28, 2026
Merged

jbeckwith-oai merged 2 commits into
mainfrom
codex/clarify-variadic-field-descriptions

Conversation

@jbeckwith-oai

@jbeckwith-oai jbeckwith-oai commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This pull request updates the function-tool documentation to clarify that Field(description=...) in a variadic parameter annotation is ignored. The existing section describes Field constraints and descriptions broadly, which can lead readers to expect both to apply to *args and **kwargs.

The clarification shows how to supply the parameter description through a docstring or an Annotated string, 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

  • Five focused checks through the public agents.decorators.tool API verified the ignored Field description, Annotated description, docstring precedence, disabled-docstring fallback, and non-strict **kwargs description. All cases retained per-value numeric constraints.
  • A public tool invocation check verified that the documented nested JSON payload reaches both plain and described/constrained **scores parameters with strict_mode=False; the current implementation rejects both under default strict mode.
  • Compared the documented behavior with v0.22.3 and the current implementation.
  • Independent review of the complete diff, including Japanese, Korean, and Chinese translation clarity.
  • make build-docs passed (145 seconds; warnings in unchanged reference documentation). The later text-only **kwargs clarification 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

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass
  • If using Codex, I've run /review before submitting this PR

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T16:37:11.955589Z 5e6a73e PR opened
🔒 Security Review ✅ Completed 2026-09-28T16:37:21.318227Z 5e6a73e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread docs/tools.md
@jbeckwith-oai
jbeckwith-oai merged commit 9c5a5e8 into main Sep 28, 2026
22 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the codex/clarify-variadic-field-descriptions branch September 28, 2026 16:50
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.

2 participants