Repository navigation
[AISAGE-734] fix(ai-gateway): strip message names for OpenCode Go chat completions - #7770
Merged
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe OpenCode Go transform change correctly and unconditionally strips OpenAI Files Reviewed (3 files)
Notes
Reviewed by deepseek-v4.1-flash · Input: 46.1K · Output: 8.2K · Cached: 453.8K Review guidance: REVIEW.md from base branch |
joshburt
self-requested a review
October 16, 2026 16:36
joshburt
approved these changes
Oct 16, 2026
This was referenced Oct 17, 2026
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.
Problem
OpenCode Go BYOK requests to
glm-5.3-flashfail with a 400:Production errors are all for
opencode-go/glm-5.3-flash, starting 2026-10-16. The loggedmessageFieldsincludename.Tested directly against
https://opencode.ai/zen/go/v1/chat/completions:glm-5.3-flashrejectsnameon user, assistant, and tool messages.glm-5.3andkimi-k2.6accept it.Fix
The OpenCode Go provider now strips
namefrom every Chat Completions message, alongside the user-tracking fields it already removes. The OpenCode Go transform handles all of its models, so a strict upstream for a new model won't hit the same error.Verification
opencode-go.test.ts. Direct BYOK provider suites pass (7 suites, 74 tests).pnpm --filter @kilocode/web-shared typecheckpasses, and oxlint passes on the changed files.glm-5.3-flashtool-call conversation withoutnamesucceeds upstream.Failure UX: requests that used to fail with a non-retryable 400 now succeed. No new waiting or retry behavior.
Root cause
This is a regression from #7586 (merged 2026-10-16 08:02 UTC). Before that change, the catalog told clients to use the
openai-compatibleAI SDK provider for OpenCode Go models. The catalog now sends noai_sdk_provider, so clients fall back to@openrouter/ai-sdk-provider. That provider addsname: toolNameto every tool message, andopenai-compatiblenever did. The first error was at 12:06 UTC.Why it's intermittent
OpenCode Go pins each
x-opencode-sessionto one backend.glm-5.3-flash(andomen-alpha, which is also routed toperplexity-glm5.3flash) is served by several backends:zai,relace,particle,pareto-glm,pearlresearch, andperplexity-glm5.3flash. Only the Perplexity backend rejectsname. A session pinned to Perplexity fails on its first tool result (messages[3..5]in every prod error) and keeps failing for the rest of that session. Sessions pinned to other backends work.