Repository navigation
feat(upstream): follow the OpenCode 2.1 client's version and /inference routes - #141
Merged
Merged
Conversation
…ce routes Captured a 2.1.1 CLI request with the plugin hook that produced the 2.0.32 capture. The body is byte-identical; what moved is the version string and the route. The 2.1 client groups /inference routes by provider family, so a chat request goes to /inference/openai/v1/chat/completions, responses to /inference/openai/v1/responses and messages to /inference/anthropic/v1/messages. A 2.0.32 client posted the protocol path directly and that route still answers, so this is fidelity rather than a fix. The family segment is only inserted for the /inference origin: a custom base URL and the /zen/go lane keep the flat route, because the grouping belongs to /inference alone.
TiaraBasori
added a commit
to TiaraBasori/opencode2api-1
that referenced
this pull request
Oct 25, 2026
…breaker) Pick up origin/main (19 commits since v1.4.3): - 2.1.1 client shape: version bump, /inference/openai|anthropic family routes, max_completion_tokens 32000, strict:false tools, client key order, no HTML escaping, runtime-owned Accept/Content-Length (jasonxu114514#141-jasonxu114514#143) - anonymous-lane abuse handling: IP-block detection, per-exit block TTL, circuit breaker (models.anonymous_backoff), max_anonymous_exits cap, deterministic 4xx stops the walk instead of replaying every exit - placeholder key dropping, probe failure classification (jasonxu114514#111), WebUI Cache-Control (jasonxu114514#112), reasoning disable preserved end to end (jasonxu114514#150), Italian README/WebUI Conflict resolutions: - internal/config/config.go, README.md, README.zh-CN.md: kept both sides — the alias fields (aliases/strip_free_suffix) and the new anonymous_backoff block sit side by side in ModelsConfig and the README tables. Local adaptation for this deployment's #pool exit (not upstream): - a #pool transport dials a fresh upstream address on every attempt, so an IP-scoped abuse block cannot be parked on the transport: blocked() and markBlocked() ignore pool transports and the anonymous walk keeps rotating instead of freezing every exit behind one flagged address.
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
A captured 2.1.1 CLI request differs from the 2.0.32 capture in exactly two
places: the version in the User-Agent, and the route.
Version
Route — 2.1 groups
/inferenceroutes by provider family:/inference/v1/chat/completions/inference/openai/v1/chat/completions/inference/v1/responses/inference/openai/v1/responses/inference/v1/messages/inference/anthropic/v1/messagesThe old route still answers, so this is fidelity rather than a fix — but a
2.1 client never sends it.
Scope of the route change
The family segment is only inserted when the base URL path ends in
/inference. A custom base URL and the/zen/golane keep the flat route,because the grouping belongs to
/inferencealone.How it was verified
serve+/api/session),the same setup that produced the 2.0.32 capture.
working directory, so nothing else in this area moved.
/inference/anthropic/v1/messagesand/inference/openai/v1/responsesbothexist (they answer with a gate error rather than 404).
go build ./...,go vet ./...,gofmtclean.