Conversation
4435b17 to
5c3639d
Compare
|
Hi @zenixls2 , thanks for the pr. |
5c3639d to
8b3bc15
Compare
|
Conflict resolved. |
There was a problem hiding this comment.
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
CodexWebSearchconfig flag (defaulttrue) and propagate it into Codex provider construction. - Extend Codex request building to optionally inject the built-in
web_searchtool 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.
pkg/config/config.go
Outdated
| 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"` |
There was a problem hiding this comment.
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.
| 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"` |
pkg/config/config.go
Outdated
| 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` |
There was a problem hiding this comment.
This comment says "Github Copilot", but the project uses the canonical casing "GitHub Copilot" elsewhere. Please update the comment text for consistency.
| 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` |
8a287ed to
9236eda
Compare
There was a problem hiding this comment.
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.
9236eda to
42d2937
Compare
|
Thanks for the pr |
* feature: add web search for codex models * fix: use more elegant way to solve the issue.
Enable web search functionality in OpenAI models by default.
have the dependency on #102