Repository navigation
fix(openai): exclude OPENAI_BASE_URL from hosted tool search - #4793
Conversation
NativeToolSearchEnabled only read base_url, so with OPENAI_BASE_URL pointing at another server hosted tool search stayed on while docker#4773 turned response replay off, which tool search needs to keep its loaded tools. Add Config.Endpoint() and use it in NativeToolSearchEnabled and the three checks from docker#4773. Signed-off-by: Yeongbin Jeong <oyobbeb@gmail.com>
aheritier
left a comment
There was a problem hiding this comment.
Reviewed all five changed files against #4773, #4594, and the hosted-search contract introduced in #4355. No substantive defects found. Hosted tool search now respects the resolved OPENAI_BASE_URL endpoint, while explicit base_url precedence and default-endpoint/gateway behavior are preserved. Regression tests cover resolved custom/default endpoints and client construction with the environment override.
CI operational status: PASS at this head. The required gate, Linux/Windows tests, lint, cross-compilation, licenses, image build, and CodeQL passed; test-race was skipped. Linux CI logs confirm the base, OpenAI, and runtime packages passed. No local tests were run. The PR is non-draft and conflict-free; GitHub still reports mergeable_state=blocked.
Issue context: Reviewed the linked PRs and issue, including relevant reasoning-replay background and accessible comments/reviews. No Jira references or material acceptance-context gaps found.
Prior threads: None; the PR has no issue comments, reviews, inline comments, or review threads.
… tool search Reflects changes from docker#4793. Source PR: docker#4793
Follow-up to #4773.
#4773 made three endpoint checks see
OPENAI_BASE_URL, butNativeToolSearchEnabledstill reads onlybase_url. WithOPENAI_BASE_URLpointing at another server andnative_tool_search: true, hosted tool search stays on while response replay is now off, and tool search needs that replay to keep its loaded tools across turns.This adds
Config.Endpoint(), which returnsbase_urlor else the endpoint resolved at construction, and hasNativeToolSearchEnabledand the three checks from #4773 use it, so they can't drift apart again.This reverses a choice from #4355: the resolved endpoint was deliberately not consulted "so tests can point the SDK at a local server", and
TestConfigNativeToolSearchEnabled_IgnoresResolvedBaseURLpinned that. I flipped and renamed that test. The tests here that talk to a local server don't go through the resolved endpoint: unit tests inject the SDK client throughclientFn, the runtime tool search test reroutes the transport, and e2e uses--models-gateway. They keep the default endpoint and still pass.TestResponseStateOpenAIBaseURLEnvnow also opts intonative_tool_searchand checks that it ends up off. It and the flipped test fail on main.go test ./..., golangci-lint andgo run ./lint .pass.