You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a165564
Browse filesBrowse the repository at this point in the historyBrowse files
fix(management): validate the sidecar pair against the submitted backend
Both web-search sidecar writers resolved the backend for the model pair check
with a ternary that handled only openai, anthropic, and null, then fell back to
the STORED backend for everything else. The accepted union has five members, so
a submitted `gemini` never matched an arm and was validated against whatever
was already saved.
That is two defects, not one. With a stored openai backend the dashboard could
not save a Gemini pair the picker itself offered (#2457, the reported 400), and
symmetrically `backend=gemini` with `model=gpt-5.6-luna` was accepted with 200
because it was checked against openai. Writing the same pair directly into
config.json always worked, which is what narrowed this to the write gate.
Both routes now resolve the submitted backend across the whole union. The union
check above each site has already rejected unknown literals, so a surviving
string is a member; Array.includes does not narrow, so the cast carries that
proof.
The two null policies are deliberately NOT unified: on /api/sidecar-settings
null unsets the backend and unset resolves to openai, while on /api/claude-code
null drops the override and inherits the global backend. Collapsing them into
one helper would silently change what clearing a Claude override means.
The executor is untouched. resolveSidecarBackend and planWebSearch already
handled Gemini, and tests/gemini-web-search.test.ts still passes unchanged.
Closes#2457
0 commit comments