fix(opencode): use xhigh instead of max for GLM-5.2 OpenAI-compatible variants - #34360
Closed
weiconghe wants to merge 2 commits into
Closed
fix(opencode): use xhigh instead of max for GLM-5.2 OpenAI-compatible variants#34360weiconghe wants to merge 2 commits into
weiconghe wants to merge 2 commits into
Conversation
The instance-context middleware unconditionally called InstanceStore.load with whatever directory the client supplied, so requests that referenced a stale path (e.g. after the user moved the project folder) caused the server to bootstrap a phantom instance for a directory that doesn't exist on disk. Downstream calls on that instance then surfaced as 503 errors, and nothing pruned the stale entry from the client's cached project list. Add an fs.existsSafe guard at the middleware boundary: when the resolved directory does not exist, return 404 immediately so the client can drop the stale entry rather than retrying against a phantom instance. Fixes anomalyco#31888.
… variants
The OpenAI-compatible branch returned { high, max } but max is not part
of the OpenAI reasoning_effort enum. Spec-compliant upstreams (e.g.
hyper, Cloudflare AI Gateway) reject max with 400. The OpenRouter
branch already correctly uses xhigh. This aligns the OpenAI-compatible
branch to match.
Fixes anomalyco#34278
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
Why they're related: Both PRs address the same issue (#34278) — fixing GLM-5.2 models in the OpenAI-compatible branch to use Please check if PR #34283 is already merged or in progress before proceeding with PR #34360. |
Contributor
Author
|
Closing as duplicate of #34283. |
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.
Issue for this PR
Closes #34278
Type of change
What does this PR do?
The
@ai-sdk/openai-compatiblebranch inProviderTransform.variants()returned{ high, max }for GLM-5.2 models, butmaxis not part of the OpenAIreasoning_effortenum (none/minimal/low/medium/high/xhigh). Spec-compliant upstreams (e.g.hyper, Cloudflare AI Gateway) rejectmaxwith HTTP 400.The OpenRouter branch already correctly uses
xhigh. This PR aligns the OpenAI-compatible branch to match.Changes:
packages/opencode/src/provider/transform.tsline 693: changedmaxtoxhighpackages/opencode/test/provider/transform.test.ts: updated 3 test expectations to matchHow did you verify your code works?
Result: 275 pass, 0 fail, 522 expect() calls
Screenshots / recordings
N/A — logic fix, no UI change.
Checklist