Skip to content

app-server: align dynamic tool identifiers with Responses API#20724

Merged
eternal-openai merged 2 commits intomainfrom
codex/dynamic-tool-responses-contract
May 6, 2026
Merged

app-server: align dynamic tool identifiers with Responses API#20724
eternal-openai merged 2 commits intomainfrom
codex/dynamic-tool-responses-contract

Conversation

@eternal-openai
Copy link
Copy Markdown
Contributor

@eternal-openai eternal-openai commented May 2, 2026

Why

Codex currently accepts dynamic tool names and namespaces that the upstream Responses function-tool path does not actually support. In practice, that means app-server can register a dynamic tool successfully and only discover later that the LLM-facing tool contract will reject or mishandle it.

This PR tightens the app-server-side dynamic tool contract to match the Responses API before we stack dynamic tool hook support on top of it.

What changed

  • validate dynamic tool name against the Responses function-tool identifier contract: ^[a-zA-Z0-9_-]+$, length 1..128
  • validate dynamic tool namespace the same way, with the Responses namespace length limit 1..64
  • reject namespaces that collide with the always-reserved Responses runtime namespaces such as functions, multi_tool_use, file_search, web, browser, image_gen, computer, container, terminal, python, python_user_visible, api_tool, tool_search, and submodel_delegator
  • escape invalid identifiers in error messages so control characters do not spill raw into logs or client-visible error text
  • document the tightened dynamic tool identifier contract in codex-rs/app-server/README.md
  • add both unit coverage for the validator and an app-server integration test that rejects a thread/start request with Responses-incompatible dynamic tool identifiers

Verification

  • cargo test -p codex-app-server validate_dynamic_tools_
  • cargo test -p codex-app-server --test all thread_start_rejects_dynamic_tools_not_supported_by_responses

@eternal-openai eternal-openai marked this pull request as ready for review May 5, 2026 05:34
@eternal-openai eternal-openai merged commit 8ef3189 into main May 6, 2026
26 checks passed
@eternal-openai eternal-openai deleted the codex/dynamic-tool-responses-contract branch May 6, 2026 04:05
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants