Skip to content

Feature/websearch OpenAI#118

Merged
lxowalle merged 2 commits intosipeed:mainfrom
zenixls2:feature/websearch_openai
Feb 18, 2026
Merged

Feature/websearch OpenAI#118
lxowalle merged 2 commits intosipeed:mainfrom
zenixls2:feature/websearch_openai

Conversation

@zenixls2
Copy link
Contributor

@zenixls2 zenixls2 commented Feb 13, 2026

Enable web search functionality in OpenAI models by default.
have the dependency on #102

@zenixls2 zenixls2 force-pushed the feature/websearch_openai branch from 4435b17 to 5c3639d Compare February 13, 2026 09:10
@lxowalle
Copy link
Collaborator

Hi @zenixls2 , thanks for the pr. ProviderConfig is a generic struct, and the member CodexWebSearch seems more specifically intended for Codex. Perhaps it could be renamed to WebSearch. Please fix the conflict.

Copilot AI review requested due to automatic review settings February 18, 2026 04:36
@zenixls2 zenixls2 force-pushed the feature/websearch_openai branch from 5c3639d to 8b3bc15 Compare February 18, 2026 04:36
@zenixls2
Copy link
Contributor Author

Conflict resolved.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds built-in OpenAI web_search tool support to the Codex (ChatGPT backend /codex/responses) provider, enabling it by default while allowing users to disable it via config.

Changes:

  • Add CodexWebSearch config flag (default true) and propagate it into Codex provider construction.
  • Extend Codex request building to optionally inject the built-in web_search tool and filter out a same-named function tool.
  • Add/adjust tests to cover default-enabled and disabled web search behaviors.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/providers/http_provider.go Passes CodexWebSearch into the OAuth/token Codex provider creation path.
pkg/providers/codex_provider.go Adds enableWebSearch flag and injects built-in web_search tool into requests when enabled.
pkg/providers/codex_provider_test.go Updates existing tests for new parameter + adds coverage for default/disabled web search.
pkg/config/config.go Introduces codex_web_search config field and sets OpenAI default to enabled.
pkg/config/config_test.go Adds tests validating defaulting and disabling behavior for codex_web_search.
config/config.example.json Documents the new codex_web_search setting in the example config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Proxy string `json:"proxy,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_PROXY"`
AuthMethod string `json:"auth_method,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_AUTH_METHOD"`
ConnectMode string `json:"connect_mode,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CONNECT_MODE"` //only for Github Copilot, `stdio` or `grpc`
CodexWebSearch bool `json:"codex_web_search,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CODEX_WEB_SEARCH"`
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

CodexWebSearch is tagged with omitempty, but its default is true. This means if a user disables web search (sets it to false) and then the config is saved via SaveConfig, the field will be omitted from JSON and will revert to true on the next LoadConfig() (since defaults are applied before unmarshal). Remove omitempty for this bool, or change the field to a *bool so false can be explicitly persisted while still allowing an “unset” state.

Suggested change
CodexWebSearch bool `json:"codex_web_search,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CODEX_WEB_SEARCH"`
CodexWebSearch bool `json:"codex_web_search" env:"PICOCLAW_PROVIDERS_{{.Name}}_CODEX_WEB_SEARCH"`

Copilot uses AI. Check for mistakes.
APIBase string `json:"api_base" env:"PICOCLAW_PROVIDERS_{{.Name}}_API_BASE"`
Proxy string `json:"proxy,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_PROXY"`
AuthMethod string `json:"auth_method,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_AUTH_METHOD"`
ConnectMode string `json:"connect_mode,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CONNECT_MODE"` //only for Github Copilot, `stdio` or `grpc`
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

This comment says "Github Copilot", but the project uses the canonical casing "GitHub Copilot" elsewhere. Please update the comment text for consistency.

Suggested change
ConnectMode string `json:"connect_mode,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CONNECT_MODE"` //only for Github Copilot, `stdio` or `grpc`
ConnectMode string `json:"connect_mode,omitempty" env:"PICOCLAW_PROVIDERS_{{.Name}}_CONNECT_MODE"` //only for GitHub Copilot, `stdio` or `grpc`

Copilot uses AI. Check for mistakes.
@zenixls2 zenixls2 force-pushed the feature/websearch_openai branch from 8a287ed to 9236eda Compare February 18, 2026 08:08
Copilot AI review requested due to automatic review settings February 18, 2026 08:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zenixls2 zenixls2 force-pushed the feature/websearch_openai branch from 9236eda to 42d2937 Compare February 18, 2026 08:24
@lxowalle
Copy link
Collaborator

Thanks for the pr

@lxowalle lxowalle merged commit 3390576 into sipeed:main Feb 18, 2026
3 checks passed
SebastianBoehler pushed a commit to SebastianBoehler/picoclaw that referenced this pull request Feb 22, 2026
* feature: add web search for codex models

* fix: use more elegant way to solve the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants