Repository navigation
Conversation
Amir83Nasr
added a commit
to Amir83Nasr/10Router
that referenced
this pull request
Oct 15, 2026
…/inference/v1 Upstream decolua#4860 (3 commits): - d8d0e04 keep a valid counter in translated session ids to stop 403 FreeTierError - ccfb783 move free tier to /inference/v1 with the v2 client fingerprint - cb825c7 align free-tier v2 headers and read/shell fingerprint Applied to local format: v2 UA opencode/latest/2.0.26/cli, verbatim read/shell fingerprint via applyFingerprintTools (replaces bash/read decoys), deterministic session prefix with counter 1, /inference/v1 routing, mirrored session headers without x-opencode-request. Preserved local free-usage breaker, stable session pool and ocz isResponsesModel; executor-const-guard adjusted to local retry policy.
ShayNeeo
force-pushed
the
fix/opencode-zen-v2-fingerprint
branch
from
October 15, 2026 16:00
cb825c7 to
91db470
Compare
|
Thanks for this ??? it fixed OpenCode Zen free-tier 403s for us too. ???? We've backported it into our fork (AFRouter), adapted to our diverged Notes from our reproduction, in case they're useful to you:
Full credit to @ShayNeeo in our commit ( |
AFG473319
added a commit
to AFG473319/AFRouter
that referenced
this pull request
Oct 15, 2026
…nce/v1 routing (#53) Backport of decolua/9router PR #4860 by ShayNeeo, adapted to this fork. OpenCode's free tier now answers the v1 client shape this fork still sent with 403 FreeTierError. Ports the upstream fix: - opencodeFingerprint: OPENCODE_FINGERPRINT_TOOLS becomes the verbatim `read`/`shell` pair from the OpenCode v2.0.26 CLI; a caller tool that reuses an exact fingerprint name with a different definition travels under an alias (the response side restores the caller's name), and chat requests no longer default tool_choice to "none" (upstream answers that with 403). - opencode-zen executor: v2 CLI UA (opencode/latest/2.0.26/cli), x-opencode-client "cli", x-opencode-project, mirrored session headers; free-tier models route to /inference/v1 with `Bearer public` and drop x-opencode-request. - helpers: add isOpencodeFreeTierModel() (detects the "-free" suffix) instead of hardcoding a model list in the executor. - tests: add the upstream free-tier test and update the fork's opencode tests to the read/shell fingerprint (this also repairs the previously failing opencode-free-tool-choice suite). Verification (PR #53): - Reproduced the 403 FreeTierError with this fork's previous executor; the v2 header set is the shape the live gate accepted in our probes. - CI: 0 new failures vs master, 7 fixed (the opencode-free-tool-choice suite). Credits: original fix and live verification by ShayNeeo (decolua/9router#4860). Co-authored-by: ShayNeeo <phamquocthanh357@gmail.com>
andyvandaric
added a commit
to andyvandaric/9router
that referenced
this pull request
Oct 17, 2026
… strategy in full Problem: the fork ran an older fingerprint contract than upstream frontier on the keyed lane and lacked both proxy escape hatches from issue decolua#4983. opencode-zen still sent the v1 UA plus a stub bash/glob/grep/read quartet with empty schemas and the v1-only x-opencode-request header, the fingerprint helper could not satisfy the gate when a caller tool reuses read/shell with platform-specific wording, and proxyAwareFetch had no way out of an egress the gate had flagged. Changes: port upstream PR decolua#4972 (in-place fingerprint normalization with alias fallback), decolua#4883 (UA opencode/latest/2.0.29/cli across both executors, registry and dashboard test; strict v2 channel matcher kept), decolua#4860 fingerprint/strategy for opencode-zen (verbatim read/shell via applyFingerprintTools, cli client, four session mirrors, drop x-opencode-request and x-api-key for free tier; /zen/v1 to /inference/v1 switch NOT taken), decolua#4987 (open-sse/utils/proxyDispatcher.js with opt-in socks5 dns=local, shared by proxyFetch and the dashboard proxy test, fail-closed ERR_PROXY_DNS_MODE) and decolua#4988 (replay a proxied 403 FreeTierError once on the direct egress, strictProxy contract preserved). undici ^7.19.2 to ^7.30.1. Version 0.5.108. Verification: full suite re-derived on this machine from a git stash -u baseline - failure sets byte-identical (95 = 95, 0 new), passes 3592 to 3617. Targeted opencode/proxy/session groups 214 pass. undici 7.30.1 exposes Socks5ProxyAgent and createSocks5Connection; the local-DNS dispatcher is exercised end to end against a local SOCKS5 plus TLS fixture (11 cases). Root cause of the free-tier 403 is egress-IP load-shedding (decolua#4983), so these ports restore request truth and add escape hatches but cannot make a flagged egress succeed.
luqman-v1
approved these changes
Oct 23, 2026
luqman-v1
left a comment
There was a problem hiding this comment.
LGTM: aligns OpenCode Zen free-tier v2 headers and read/shell tool fingerprint. Safe and clean.
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.
Summary
Following #4842 (which updated
OpenCodeExecutorinopen-sse/executors/opencode.jsandopen-sse/utils/opencodeFingerprint.jsfor the OpenCode v2 3-layer free-tier gate),OpenCodeZenExecutor(open-sse/executors/opencode-zen.js,ocz/*) only received thegenerateSessionId/translateSessionIdcounter update and still sent:OPENCODE_UA = "opencode/1.18.31"and v1hasValidOpencodeVersion(>= 1.17)x-opencode-client: "desktop"and onlyx-opencode-session(omittingx-opencode-session-id,x-session-affinity,x-session-id, andx-opencode-project)ensureChatFingerprintTools/ensureResponsesFingerprintToolshelpers injecting["bash", "glob", "grep", "read"]with emptyparameters: { type: "object", properties: {} }Live Upstream Verification
Even when authenticated with a Zen API key on
/zen/v1/*, upstream evaluates the free-tier gate on free models (ocz/space-bunny-free,ocz/mimo-v2.6-flash-free,ocz/muse-spark-1.3-contributor-free,ocz/big-pickle, andtests/translator/real/opencode-zen-free-responses.real.test.js) before validating the API key:OpenCodeZenExecutorbefore this commit (opencode/1.18.31+properties: {}stubs): HTTP 403FreeTierErrorOpenCodeZenExecutorwith v2 headers + oldproperties: {}stubs: HTTP 403FreeTierErrorOpenCodeZenExecutorwith v2 headers +applyFingerprintTools(out, flat)(read/shellverbatim schemas): passes the403 FreeTierErrorgate completely.Changes
open-sse/executors/opencode-zen.js:OPENCODE_UA("opencode/latest/2.0.26/cli"),OPENCODE_CLIENT("cli"), andhasValidOpencodeVersion(v2 channel/version/client regex) withopen-sse/executors/opencode.js.x-opencode-session,x-opencode-session-id,x-session-affinity,x-session-id) andx-opencode-projectinbuildHeaders.ensureChatFingerprintTools/ensureResponsesFingerprintToolsstubs with sharedapplyFingerprintTools(out, false)/applyFingerprintTools(out, true)from../utils/opencodeFingerprint.js(including caller tool conflict aliasing and placeholder system/instructions note).tests/unit/opencode-session.test.js:OpenCodeZenExecutorv2 headers andread/shellfingerprint application on Chat Completions and Responses requests.Note: Built atop the #4842 commits (
d8d0e04c,ccfb7838) so the top commit (cb825c7) cherry-picks cleanly onto localmaster.Refs #4845, #4842, #4837, #4839