Skip to content

Represent dynamic tools with explicit namespaces internally#27365

Merged
sayan-oai merged 5 commits into
mainfrom
codex/dynamic-tool-explicit-namespaces-core
Jun 15, 2026
Merged

Represent dynamic tools with explicit namespaces internally#27365
sayan-oai merged 5 commits into
mainfrom
codex/dynamic-tool-explicit-namespaces-core

Conversation

@sayan-oai

@sayan-oai sayan-oai commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #27356.

Stack note

This PR changes Codex's internal dynamic-tool shape while leaving thread/start unchanged. App-server therefore converts the existing per-tool input into explicit functions and namespaces before passing it to core.

#27371 updates thread/start to use the same explicit shape and removes this temporary conversion.

Why

Dynamic tools repeat namespace metadata on every function. Core should keep one explicit namespace with its member tools so descriptions and membership stay consistent across sessions and runtime planning.

What changed

  • Represent dynamic tools as top-level functions or explicit namespaces in protocol and session state.
  • Read old flat rollout metadata and write the canonical hierarchy.
  • Flatten namespace members only when registering callable tools.
  • Keep thread/start.dynamicTools flat for now and normalize it at the app-server boundary.

New builds can read old rollout metadata. Older builds cannot read newly written hierarchical metadata.

Test plan

  • just test -p codex-app-server thread_start_normalizes_legacy_dynamic_tools_into_model_request
  • just test -p codex-protocol session_meta_normalizes_legacy_dynamic_tools
  • just test -p codex-core resume_restores_dynamic_tools_from_rollout_with_sqlite_enabled
  • just test -p codex-core tool_search_returns_deferred_dynamic_tool_and_routes_follow_up_call
  • just test -p codex-core code_mode_can_call_hidden_dynamic_tools
  • just test -p codex-tools

@sayan-oai
sayan-oai force-pushed the codex/dynamic-tools-generic-search-metadata branch from 520aff4 to 902b3a6 Compare June 11, 2026 04:16
@sayan-oai
sayan-oai force-pushed the codex/dynamic-tool-explicit-namespaces-core branch from 1765bf7 to acca13f Compare June 11, 2026 04:16
/// Ensures dynamic tool specs are serialized into the model request payload.
#[tokio::test]
async fn thread_start_injects_dynamic_tools_into_model_requests() -> Result<()> {
async fn thread_start_normalizes_legacy_dynamic_tools_into_model_request() -> Result<()> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

integration test for old client compat; flat legacy tools are accepted + grouped into a namespace

@sayan-oai
sayan-oai marked this pull request as ready for review June 11, 2026 05:38
@sayan-oai
sayan-oai requested a review from a team as a code owner June 11, 2026 05:38
@sayan-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

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

Copy link
Copy Markdown
Contributor

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: ab8c1e58e3

ℹ️ 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/protocol/src/protocol.rs
Base automatically changed from codex/dynamic-tools-generic-search-metadata to main June 11, 2026 06:06
@sayan-oai
sayan-oai force-pushed the codex/dynamic-tool-explicit-namespaces-core branch from ab8c1e5 to c856ed2 Compare June 11, 2026 08:50
Comment thread codex-rs/protocol/src/dynamic_tools.rs
Comment thread codex-rs/core/src/tools/handlers/dynamic.rs
Comment thread codex-rs/core/src/tools/spec_plan.rs
Comment thread codex-rs/core/tests/suite/sqlite_state.rs
@sayan-oai
sayan-oai merged commit a292faa into main Jun 15, 2026
44 of 47 checks passed
@sayan-oai
sayan-oai deleted the codex/dynamic-tool-explicit-namespaces-core branch June 15, 2026 15:06
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 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