Name conversations on the endpoint OPENAI_BASE_URL names, not on OpenAI - #556
Merged
davidmckayv merged 2 commits intoSep 15, 2026
Merged
Conversation
zopeVaibhav
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 15, 2026 12:39
zopeVaibhav
force-pushed
the
fix/titler-openai-base-url
branch
2 times, most recently
from
September 15, 2026 16:38
eb1a770 to
cfdeb82
Compare
zopeVaibhav
force-pushed
the
fix/titler-openai-base-url
branch
from
September 15, 2026 16:44
cfdeb82 to
8185db3
Compare
# Conflicts: # CHANGELOG.md
davidmckayv
approved these changes
Sep 15, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
Code-verified clean; CI green on this sha.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #555
What this changes
The titler that names conversations built its address from a hardcoded
https://api.openai.com/v1, and its only caller never passed a base URL, so it ignoredOPENAI_BASE_URLwhile the router and tool selection honoured it. A deployment behind a gateway sent the gateway's key and each conversation's opening to OpenAI, and no conversation was named.It now asks
chatCompletionsUrlinrouting/model.ts, the function those calls already use, so the three cannot disagree about where the deployment's model is, and that function's existing/v1handling applies here too. The unusedbaseUrloption becomes an optionalenvironment, defaulting toprocess.envand read on each call as the router reads it, so a test can drive it without changing the process.Left alone: the request body, including
max_completion_tokens, and the key resolver.Where it runs
Boundary and audit
No acting call, refusal or audit row changes. What leaves the deployment narrows: with
OPENAI_BASE_URLset, the titler's key and excerpt now go to that endpoint and nowhere else.Changelog
A line under
Unreleased.Proof
server/tests/channel-titler.test.tsgains two tests. Anenvironmentnaminghttps://gateway.internal/v1is asked athttps://gateway.internal/v1/chat/completions, and with noenvironmentpassed, the titler readsOPENAI_BASE_URLfrom the process, which is howindex.tsbuilds it. Againstmain'stitler.ts(a96d88c) both fail, each receivinghttps://api.openai.com/v1/chat/completions, and the other 5 pass. On this branch all 7 pass. The existing default test now passesenvironment: {}so a developer's ownOPENAI_BASE_URLcannot change its answer.createModelCompleterandcreateChannelTitlerwith the argumentsindex.tsgives them,OPENAI_BASE_URLat a local fake gateway and off-boxfetchintercepted. Onmainthe router reached the gateway and the titler went toapi.openai.comwith the gateway's key and the excerpt. On this branch both reached the gateway and nothing left the box.openbot_test: 2481 pass onmain, 2483 on this branch, 0 failures on either. The difference is the two new tests.bun run --filter server typecheckandbiome lint --error-on-warningson both files: clean.OPENAI_BASE_URLpointed at a local proxy that forwards to OpenAI and logs each request. Onmainthe conversation was named within seconds and the proxy logged no request at all, so the naming call went to OpenAI directly. On this branch the proxy loggedPOST /v1/chat/completionswithmodel=gpt-5.5, the naming instruction in the body and a 200, and the conversation was named from that answer.