Skip to content

feature: add granular builtin tool enablement #14525

Open
ashwinnathan-openai wants to merge 13 commits intomainfrom
dev/ashwinnathan/builtin-tool-configuration
Open

feature: add granular builtin tool enablement #14525
ashwinnathan-openai wants to merge 13 commits intomainfrom
dev/ashwinnathan/builtin-tool-configuration

Conversation

@ashwinnathan-openai
Copy link

@ashwinnathan-openai ashwinnathan-openai commented Mar 12, 2026

Why

This PR adds a new config surface for controlling built-in tool availability from config.tools and from per-thread config overrides.

The final design uses grouped feature tables under [tools.<feature>]. This composes cleanly with layered TOML, keeps per-feature config colocated with enablement, and gives SDK/app-server callers an explicit opt-in mode when they want to start from no built-in tools.

What Changed

  • Added grouped tool controls for:
    • shell
    • filesystem
    • javascript
    • agents
    • agent_jobs
    • planning
    • user_input
    • web_search
    • image_generation
    • document_generation
  • Added tools.disable_defaults as the top-level switch for explicit grouped mode.
  • Added per-feature wrapper types in config/app-server protocol:
    • generic ToolFeature* wrappers with enabled
    • WebSearchFeature* wrappers with enabled plus existing web-search config
  • Updated tool gating, config readback, app-server protocol types, generated schemas, and tests to use the grouped feature model.
  • Preserved shipped legacy config behavior in default mode, including:
    • legacy tools.view_image
    • top-level web_search = "cached" | "live" | "disabled"
    • legacy [tools] web_search = true|false remains accepted and ignored, and the schema reflects that

Invariants

  • If tools.disable_defaults is omitted or false, Codex preserves the existing/default tool behavior and shipped legacy fallback knobs continue to participate.
  • If tools.disable_defaults = true, grouped [tools.<feature>] entries are the only source of truth for built-in tool exposure.
  • In explicit grouped mode, legacy standalone knobs do not re-enable tools.
  • For web_search, top-level mode config controls Cached / Live / Disabled, but exposure still comes from [tools.web_search] when disable_defaults = true.

Testing

  • just write-config-schema
  • just write-app-server-schema
  • just fmt
  • cargo test -p codex-app-server-protocol
  • cargo test -p codex-core
  • cargo test

@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@etraut-openai etraut-openai added the oai PRs contributed by OpenAI employees label Mar 13, 2026
@ashwinnathan-openai ashwinnathan-openai changed the title builtin config refactor: model builtin tool policy as tools.enabled Mar 16, 2026
@ashwinnathan-openai ashwinnathan-openai changed the title refactor: model builtin tool policy as tools.enabled add tools.enabled builtin tool configuration Mar 16, 2026
@ashwinnathan-openai ashwinnathan-openai changed the title add tools.enabled builtin tool configuration feature: add granular builtin tool enablement Mar 16, 2026
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Mar 16, 2026
@ashwinnathan-openai ashwinnathan-openai force-pushed the dev/ashwinnathan/builtin-tool-configuration branch from ae06690 to 8f52730 Compare March 16, 2026 19:09
@ashwinnathan-openai ashwinnathan-openai marked this pull request as ready for review March 16, 2026 19:27
@ashwinnathan-openai
Copy link
Author

@codex review

Copy link
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: 149d68af53

ℹ️ 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".

@ashwinnathan-openai ashwinnathan-openai force-pushed the dev/ashwinnathan/builtin-tool-configuration branch from f379010 to 443dce3 Compare March 17, 2026 00:18
@ashwinnathan-openai
Copy link
Author

@codex review

Copy link
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: 443dce3c35

ℹ️ 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".

@ashwinnathan-openai
Copy link
Author

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ 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".

@ashwinnathan-openai ashwinnathan-openai force-pushed the dev/ashwinnathan/builtin-tool-configuration branch from 37561c6 to 7d31d45 Compare March 17, 2026 23:06
@ashwinnathan-openai
Copy link
Author

@codex review

Copy link
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: 7d31d45e75

ℹ️ 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".

@ashwinnathan-openai
Copy link
Author

@codex review

Copy link
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: 0acaecfbfd

ℹ️ 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 on lines +576 to +585
pub shell: Option<bool>,
pub filesystem: Option<bool>,
pub javascript: Option<bool>,
pub agents: Option<bool>,
pub agent_jobs: Option<bool>,
pub planning: Option<bool>,
pub user_input: Option<bool>,
pub web_search: Option<bool>,
pub image_generation: Option<bool>,
pub document_generation: Option<bool>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like these should have their own types with the associated configuration specific to each tool. None can mean "not enabled" so the corresponding configuration struct doesn't have to have its own enabled field perhaps?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@pakrym-oai I'm particularly interested to get your thoughts on this bit!

Choose a reason for hiding this comment

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

iiuc we can't do None = not enabled because in the disable_defaults = false case, if a thread override doesn't include tools.shell, we'd resolve that as tool_feature_overrides.shell = None and incorrectly treat it as disabled instead of inheriting from the lower layer.

I think we need Option<bool> for the three states:

  • None = inherit / no explicit override
  • Some(true) = enabled
  • Some(false) = disabled

Separately though open to having separate types with the associated config specific to each tool but don't know if that's premature atm.

#[schemars(deny_unknown_fields)]
pub struct ToolsToml {
pub disable_defaults: Option<bool>,
pub shell: Option<ToolFeatureToml>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Likewise, this should have the specific TOML shape we want to parse?

Choose a reason for hiding this comment

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

As in create a specific shape for each tool like ShellFeatureToml? For now I just kept it generic as ToolFeatureToml which has enabled and if we end up adding feature specific configuration we should be able to evolve easily right?

push_builtin_tool_spec_if_enabled(
&mut builder,
config,
"local_shell",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I also don't understand how this and others are not causing #14652 to fail....

@ashwinnathan-openai ashwinnathan-openai force-pushed the dev/ashwinnathan/builtin-tool-configuration branch from 19bc70c to 3e62ad3 Compare March 18, 2026 22:34
@ashwinnathan-openai
Copy link
Author

@codex review

Copy link
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: 1fb3dcc8da

ℹ️ 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".

@ashwinnathan-openai
Copy link
Author

@codex review

Copy link
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: 800ffbe6e8

ℹ️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants