feat: add opt-in provider web search - #860
Conversation
Greptile SummaryAdds opt-in, registry-derived native web-search controls for Codex and OpenCode.
Confidence Score: 4/5The PR is not yet safe to merge because an OpenCode continuation caller can still bypass local resume attestation with a supplied feature override. The earlier empty-help detection defect is fixed, but the separate resume-override thread remains unresolved: with web search absent or false, runtime feature resolution returns caller overrides unchanged, allowing Files Needing Attention: src/agent-cli-provider/single-agent-runtime.ts, src/agent-cli-provider/adapters/opencode.ts
|
| Filename | Overview |
|---|---|
| src/agent-cli-provider/single-agent-runtime.ts | Adds web-search setting resolution, runtime support attestation, and requested/effective configuration reporting. |
| src/agent-cli-provider/adapters/codex.ts | Adds version-and-help-gated Codex web-search configuration for fresh and resumed commands. |
| src/agent-cli-provider/adapters/opencode.ts | Adds OpenCode web-search environment control, strict continuation detection, and session argument construction. |
| src/task-startup-error.js | Adds structured serialization and preservation of unsupported provider-capability startup failures. |
| src/agent-cli-provider/provider-registry.ts | Declares registry-owned web-search settings and static capability metadata for Codex and OpenCode. |
| docs/providers.md | Documents opt-in web-search settings, minimum CLI versions, control mechanisms, and fail-closed behavior. |
Reviews (11): Last reviewed commit: "fix: preserve only structured startup fa..." | Re-trigger Greptile
|
🎉 This PR is included in version 6.16.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
providerSettings.codex.webSearchandproviderSettings.opencode.webSearchbooleans, both defaulting tofalseunsupported-capabilityerror when explicitly enabled search cannot be proven; preserve that structured permanent fault through host and isolated task-start wrappers so lifecycle retry logic terminalizes itCloses #859
Exact behavior
Codex
Enabled commands use the upstream noninteractive control:
Support requires nonempty
codex exec --helpoutput containing--configand a parseable Codex version >=0.146.0. Missing, malformed, older, or help-incompatible installations are unsupported. Absent/false settings add no arguments and do not trigger search-specific probing when caller-supplied feature metadata is otherwise sufficient.This intentionally does not emit
codex exec --search: current upstreamExecClirejects that argument, and the top-level TUI--searchflag is not translated into noninteractive exec configuration. Codex's TypeScript SDK emits--config 'web_search="live"'before both fresh prompts andresume:OpenCode
Enabled fresh and resumed commands receive
OPENCODE_ENABLE_EXA=1; unrelated environment entries are retained. Support requires a parseable OpenCode version >=1.0.137. Missing, malformed, or older versions are unsupported.Upstream sources:
Scope matrix
providerSettings.codex.webSearch--config 'web_search="live"'--config+ version >=0.146.0providerSettings.opencode.webSearchOPENCODE_ENABLE_EXA=11.0.137Permission/tool allowlists authorize tools already present; they are not treated as controls that enable search. Probes attest only installed CLI support, not account, backend, network, or browser/API reachability.
Files changed
AGENTS.mdcli/commands/providers.jscli/index.jsdocs/providers.mdsrc/agent-cli-provider/adapters/codex.tssrc/agent-cli-provider/adapters/common.tssrc/agent-cli-provider/adapters/index.tssrc/agent-cli-provider/adapters/opencode.tssrc/agent-cli-provider/contract-actions.tssrc/agent-cli-provider/contract-fallback.tssrc/agent-cli-provider/contract-options.tssrc/agent-cli-provider/errors.tssrc/agent-cli-provider/index.tssrc/agent-cli-provider/provider-registry.tssrc/agent-cli-provider/single-agent-runtime.tssrc/agent-cli-provider/types.tssrc/providers/index.jssrc/task-run-model-args.jssrc/task-spawn-cleanup-ownership.jssrc/task-startup-error.jstests/agent-cli-provider/executable-contract-build.test.jstests/agent-cli-provider/executable-contract-option-validation.test.jstests/agent-cli-provider/parity.test.jstests/agent-cli-provider/providers-command-parity.test.jstests/isolated-task-launch-recovery.test.jstests/opencode-docker-settings-boundary.test.jstests/provider-cli-builder.test.jstests/settings-providers.test.jstests/unit/task-startup-capability-error.test.jsFocused checks for supervisor
Not run, per request:
No live model API, browser/API reachability, gateway, retry, or telemetry checks are required.