-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[SDK] Add network_access and web_search options to TypeScript SDK #6367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add support for networkAccess and webSearch boolean options in ThreadOptions. These options enable: - networkAccess: Controls sandbox network access via sandbox_workspace_write.network_access config - webSearch: Enables web search tool via tools.web_search config The options are properly threaded through ThreadOptions -> CodexExecArgs -> CLI flags. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add support for approvalPolicy option in ThreadOptions using the existing ApprovalMode type. This controls when Codex pauses to ask before running generated commands. Values: "untrusted" | "on-failure" | "on-request" | "never" The option is passed via the --ask-for-approval CLI flag. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
pakrym-oai
reviewed
Nov 7, 2025
pakrym-oai
reviewed
Nov 7, 2025
pakrym-oai
requested changes
Nov 7, 2025
Collaborator
pakrym-oai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some tests that assert values are passed down to exec? There are some existing examples you should be able to copy.
Addressed PR feedback to rename the boolean fields for clarity: - networkAccess → networkAccessEnabled - webSearch → webSearchEnabled This makes the boolean nature of the options more explicit. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add unit tests for the three new ThreadOptions fields following the same pattern as the existing modelReasoningEffort test: - networkAccessEnabled: Verifies --config sandbox_workspace_write.network_access flag - webSearchEnabled: Verifies --config tools.web_search flag - approvalPolicy: Verifies --ask-for-approval flag Each test uses codexExecSpy to capture command args and validates the correct CLI flags are passed. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Correct the web search parameter from `tools.web_search` to `features.web_search_request` to match the actual CLI flag. Updated in both exec.ts and the corresponding test. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Change approvalPolicy from using --ask-for-approval flag to --config flag, since --ask-for-approval is not available in codex exec. Now uses: --config approval_policy="<value>" This matches the pattern for other config options like modelReasoningEffort. Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
pakrym-oai
approved these changes
Nov 7, 2025
Collaborator
pakrym-oai
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds two new optional boolean fields to
ThreadOptionsin the TypeScript SDK:networkAccess: Enables network access in the sandbox by settingsandbox_workspace_write.network_accessconfigwebSearch: Enables the web search tool by settingtools.web_searchconfigThese options map to existing Codex configuration options and are properly threaded through the SDK layers:
ThreadOptions(threadOptions.ts) - User-facing APICodexExecArgs(exec.ts) - Internal execution args--configin thecodex execcommandChanges
sdk/typescript/src/threadOptions.ts: AddednetworkAccessandwebSearchfields toThreadOptionstypesdk/typescript/src/exec.ts: Added fields toCodexExecArgsand CLI flag generationsdk/typescript/src/thread.ts: Pass options through to exec layerTest Plan
pnpm build)pnpm lint)