Skip to content

expose dynamic tool namespace descriptions#24691

Open
sayan-oai wants to merge 2 commits into
mainfrom
dev/sayan/dynamic-tool-namespace-description
Open

expose dynamic tool namespace descriptions#24691
sayan-oai wants to merge 2 commits into
mainfrom
dev/sayan/dynamic-tool-namespace-description

Conversation

@sayan-oai
Copy link
Copy Markdown
Collaborator

@sayan-oai sayan-oai commented May 27, 2026

Why

Dynamic tools can be grouped into a Responses namespace, but app-server clients currently cannot supply namespace-level context for that group. For deferred dynamic tools, tool_search therefore exposes only a generated namespace description, losing information that helps the model understand when revealed tools are appropriate.

When multiple tools share a namespace, a supplied description must also win over the generated fallback regardless of tool order; otherwise an earlier undescribed tool can mask the newly supplied metadata.

Context: internal discussion

What

  • Add optional namespaceDescription support to the app-server v2 DynamicToolSpec API and generated schemas, and propagate it into core dynamic tool specs and persisted thread state.
  • Include custom namespace descriptions in dynamic-tool search text and deferred tool_search discovery metadata.
  • Preserve absent descriptions while same-namespace tools are aggregated, prefer a supplied description, and apply the generated fallback only when none is supplied. This covers normal planning, code mode, and TST response coalescing.
  • Update app-server documentation and focused protocol, persistence, planner, and tool_search integration coverage.

Verification

  • just test -p codex-app-server-protocol
  • Focused codex-core / codex-tools tests covering dynamic namespace planning, code-mode fallback behavior, and TST reveal/call routing.
  • Built codex from source and ran a live app-server session with a deferred namespaced dynamic tool; tool_search revealed it with the supplied namespace description, the namespaced tool call completed, and the assistant returned its marker result.

@sayan-oai sayan-oai changed the title [codex] Expose dynamic tool namespace descriptions expose dynamic tool namespace descriptions May 27, 2026
@sayan-oai sayan-oai marked this pull request as ready for review May 27, 2026 03:18
@sayan-oai sayan-oai requested a review from a team as a code owner May 27, 2026 03:18
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

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: 7041a830d1

ℹ️ 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 codex-rs/app-server-protocol/src/protocol/v2/thread.rs
Comment thread codex-rs/core/src/tools/handlers/dynamic.rs Outdated
LoadableToolSpec::Function(tool)
}
ToolSpec::Namespace(mut namespace) => {
if namespace.description.trim().is_empty() {
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

keep empty descriptions until matching namespace results are merged, so later populated descriptions aren't hidden by an earlier default. If none is supplied, apply the default after merging.

this also fixes the same issue for deferred MCP tools.

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.

1 participant