fix(gateway): OpenCode Go/Zen session headers, per-model endpoints, max effort, failover - #11
Merged
Merged
Conversation
…ax effort, failover Fixes 12errh#10. - Send stable x-opencode-session + distinct User-Agent on every Go/Zen request (fixes 400 MissingSessionID); mint per-conversation ids so first requests carry it. - Route by model endpoint instead of forcing /chat/completions: new GatewayResponsesAdapter (Responses API) and GatewayMessagesAdapter (Anthropic protocol over gateway base). AnthropicAdapter gained protected hooks; temperature/top_p omitted when thinking is on. - Always maximum reasoning effort on Go/Zen paths (chat: reasoning_effort=max, responses: reasoning.effort=high, messages: max-budget thinking); transparent one-shot retry with low effort on gateway [1210] thinking errors. - Router: immediate failover (no retry) on deterministic 400/401/403/404/410; ERROR-level hint for billing failures (CreditsError/RegionError); lastError recorded on all break paths. - Replace end-of-life NVIDIA default stepfun-ai/step-3.7-flash (410 Gone since 2026-08-28) with live minimaxai/minimax-m3; reasoning-effort hot-reloads via reloadRouter.
imviren
force-pushed
the
fix/gateway-integration
branch
from
September 7, 2026 13:08
02a6470 to
d25a448
Compare
…es, flag DataPolicy - serializeMessages maps null content to '' (strict gateways reject null with 'messages illegal'-class 400s). - Adapters log the exact request body at debug level on non-OK responses so the next 4xx is diagnosable in seconds (nothing at default levels). - DataPolicyError counts as an account failure (console opt-in hint).
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 #10. Ported and rebased onto current main, verified green (typecheck + 402/402 tests, including upstream compaction/fallback suites). What changed and why is in the issue; commit message has the full breakdown.