Repository navigation
[Fix] Brain queries lose expansion and synthesis through the helper gateway - #3444
Merged
Merged
Conversation
Contributor
|
No code issues found. See task Reviewed all five changed files, the pinned gbrain provider-resolution and expansion contracts, helper request/response translation, authentication, and operator override paths. Current-head tests, lint, type checks, Knip, deployment-artifact validation, docs validation, and the app image build passed. No approval submitted. Reviewed 6d32476 |
4 of 6 tasks
roomote-roomote
Bot
requested review from
brunobergher,
daniel-lxs and
mrubens
as code owners
October 9, 2026 06:03
4 of 6 tasks
daniel-lxs
approved these changes
Oct 9, 2026
daniel-lxs
left a comment
Member
There was a problem hiding this comment.
Verified the pinned native Brain client through the actual HTTP gateway for expansion and synthesis with controlled inference, plus authentication and unsupported-input/error handling. Focused compatibility checks, deployment configuration validation and current CI pass at this head.
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.
What changed
Brain query expansion and synthesis can now use the bundled native OpenAI client through Roomote's helper gateway. Gateway-mode defaults use
openai:roomote/helperso gbrain resolves the OpenAI recipe; the client sends the unchanged wire modelroomote/helper.The existing helper path now accepts non-streaming OpenAI Responses text requests and returns the completed Responses envelope. It preserves instructions, developer/assistant context, JSON-format requirements and output limits. Unsupported image/tool/previous-response inputs are rejected explicitly. Existing chat-completion requests and explicit operator model overrides retain their paths; helper failures return a generic error.
Why this change was made
The unqualified helper default cannot resolve a native provider recipe, silently reducing expansion to the original query. Qualifying the model exposes a second boundary: the pinned OpenAI adapter sends
/v1/responses, while Roomote intercepted the helper sentinel only on/v1/chat/completions. That request was forwarded as an invalid provider model. The fix addresses both ends of the same request contract.Impact
Native Brain expansion can return related queries and synthesis can parse helper output. Direct-provider defaults, explicit
GBRAIN_MODEL/R_BRAIN_MODELchoices, embeddings and stored vectors remain unchanged. Text inference continues to call the existing tracked helper role and surface. No new model provider, credential, dependency, data migration or public control is introduced.How it was tested
35201fbf: actual Docker-pinned gbrainf49ca569232dbc0d8e0783d84606115e3bfe5ab1makes zero HTTP calls with the unqualified default; qualified native expansion reaches the actual Hono gateway and receives controlled upstream HTTP 400. The new request regression also failed 400 versus 200 before implementation.6d324762ae9b83a17c4a1e440727178b1cb2953f: actual pinned native client over HTTP to the actual Hono handler parses original-plus-three expansion results and a synthesis answer from Responses envelopes; HTTP 200, two helper calls, zero upstream sentinel forwards. Gateway/provider resolution and the helper inference collaborator are controlled. This proves native protocol/application routing, not live model inference or durable accounting.Checklist
[Fix],[Feat],[Improve],[Refactor],[Docs], or[Chore]followed by a user-facing descriptionpnpm lintandpnpm check-typespass locally — normal fast repository gates passed; full formatting-inclusive commands were not runpnpm changesetRelated PRs