Repository navigation
fix(providers): send Console Go's session header from the dialect probe - #101
Conversation
Enabling any OpenCode Go model ticked the checkbox and then unticked it on its own. Nothing reached the UI and nothing was logged at the default level, so the only visible symptom was a control that would not stay on. Console Go answers every request arriving without `x-opencode-session` with a 400 and `MissingSessionID`, whatever the dialect. `toggle_model` will not enable a model until it has probed which of the three wires that model speaks, and it reads any non-2xx as "not this wire" - so with no header it concluded that no Go model spoke any of them, returned an error, and the frontend rolled back to backend truth. Measured against the live gateway: 400/400/401 without the header, 200/200 with it. The header was already propagated along the routed path (#89), where it is forwarded from the client turn. The probe has no client turn behind it and has to generate one, which the gateway accepts: it is a routing hint, not a credential and not a reference to state the gateway already holds. The provider-scoped check now lives in one helper next to the routed path's own use, so the two cannot drift on which providers get the header. Other upstreams reject unknown headers, so the scoping is part of the contract. The live smoke test pins both halves of the upstream behaviour this rests on. If Go stops requiring the header the fix is merely redundant, but if it starts demanding more than a generated id the probe breaks the same silent way, and that is worth failing loudly for.
…ing in silence A refused toggle had three layers of silence stacked on it. The catch block discarded the error, the app has no toast to have shown it in, and the only record of the reason was a debug line under a default filter of `loom_router=info`, so it was never written either. What the user saw was a switch that would not stay on. The probe now keeps why each dialect turned the model away and puts all three in the error it returns, with the upstream's own sentence where the body carries one: Console Go names the missing session header there, and a quota failure says so in the body while its status could be either. The aggregate is logged at warn, since a single rejection is ordinary - most models speak one wire and refuse the other two - and only the whole set failing is the outcome that blocks anyone. The page keeps rolling the switch back, because the model really is not enabled and leaving it on would show the one state that is never true. It now shows the reason next to the model list, using the same treatment the catalogue error beside it already had, and clears it when a later toggle succeeds.
|
Pushed the two follow-ups discussed on top of the header fix. Diagnostics. The aggregate is logged at UI. The page still rolls the switch back, because the model really is not enabled and leaving it on would show the one state that is never true. It now prints the reason beside the model list, reusing the treatment the catalogue error there already had, and clears it on the next successful toggle. New string in all four locales. Validation
|
…e for side calls Review follow-up on the rebase against main, which had gained `apply_opencode_session` from imateusdev#101. Keeping both helpers left two functions with near-identical names running the same provider-id check and setting the same header, which is what this change set out to avoid in the first place. `apply_opencode_session` is now the only place that knows Console Go is special. The two wrappers differ in where they get an id, never in that rule: `apply_provider_session` forwards the client's on a routed turn, and `apply_side_call_session` forwards it or mints one. The split is the point. A routed turn belongs to a session the client owns, so minting there would hand the gateway a new session on every request and lose whatever affinity it keeps across a conversation. A side call belongs to no conversation, and sending nothing is not a degraded mode: Console Go rejects the request outright, and because a failed visual preparation returns Err from dispatch_routed, that aborts the entire turn it was enriching rather than skipping the enrichment. A client that sends none of the three accepted header names would have hit exactly that. Also repairs the em dashes in proxy.rs and upstream.rs, which the conflict resolution mangled by reading the files back under the Windows locale instead of UTF-8.
Checking a model on the OpenCode Go card ticked the box and then unticked it on its own, with nothing shown in the UI and nothing logged at the default level.
Console Go rejects every request arriving without
x-opencode-sessionwith a 400 andMissingSessionID, whatever the dialect.toggle_modelrefuses to enable a model until it has probed which of the three wires it speaks, and reads any non-2xx as "not this wire", so with no header it concluded no Go model spoke any of them and failed. The frontend then rolled back to backend truth, which is the box unticking itself.#89 propagated the header along the routed path, where it comes from the client turn. The probe has no client turn behind it, so it generates one; the gateway accepts a generated id, since it is a routing hint rather than a credential. The provider-scoped check now lives in a single helper next to the routed path's own use so the two cannot drift.
Validation
chat/completions400 -> 200,messages400 -> 200.opencode-goand none for other providers. Confirmed it fails without the fix (got [None, None, None]).LOOM_ROUTER_OPENCODE_GO_API_KEY. PASS with real credentials.probe_model_dialectagainst the live gateway for four models that were stuck disabled (kimi-k3,glm-5.2,minimax-m3,qwen3.8-max): all resolve now, all failed before.