Skip to content

Commit d8208f9

Browse files
feat(opencode): the free tier reads the tool catalogue, so MCC sends OpenCode's (#134)
**Broken.** Since some moment in the twelve silent hours before 2026-09-18 00:52 UTC, every MCC request to an OpenCode Zen free model has been answered HTTP 403 `FreeTierError` -- "OpenCode's free tier can only be used from within OpenCode". Twenty such attempts are in the request log, all on 2026-09-18, none before; the last 200 from that host was 2026-09-17 16:48. MCC filed them as `authentication` / "Provider authentication failed. Check API key.", which sent the investigation looking at a credential that was never wrong. **Mechanism.** It is not our regression. Identity code is byte-identical at v6.74.0, v7.13.0, v7.18.1, v7.23.0 and v7.26.1; no release falls on the boundary; the installed client 1.18.31 sends the same five headers 1.18.30 did. The gate moved server-side and into the *body*: it now classifies the request's tool catalogue. Measured 2026-09-18 with MCC's headers untouched in every row (specs/INVESTIGATION-ZEN-403-FREETIER.md): E tools bash, edit, glob, grep, read -> 200, SSE stream F tools Bash, Edit, Glob, Grep, Read -> 403 FreeTierError A no tools at all -> 403 FreeTierError H both casings in one catalogue -> 500 server_error, twice The maintainer said so on the record the same day: "You cannot use the free tier in other harnesses." Probe H is the constraint on any fix: two tool names differing only in case are not a catalogue, they are a collision. **Fix.** On free-tier OpenCode models only, MCC now *translates*. Outbound, Claude Code's `Bash`/`Read`/`Edit`/`Glob`/`Grep` go as `bash`/`read`/`edit`/ `glob`/`grep` -- spellings read out of the shipped `[email protected]` bundle (`var IE="bash"`, `var KE="read"`, `var m_="edit"`, `var uE="glob"`, `var BE="grep"`), not guessed. Every other tool name goes through the 7.18.1 alias codec, which now also aliases away any name that would collide case-insensitively with a catalogue spelling. Inbound, every tool call is mapped back before Claude Code sees it, on all three surfaces. No decoy tool is ever appended. Scope is data, never a model-name branch: a new `FreeTierToolCatalogue` on the two OpenCode profiles, admitting a model whose id carries `-free`/`:free`, one the catalogue prices at zero on that host, or one the operator listed in the new `OPENCODE_FREE_TIER_MODELS` (default `big-pickle`, which is free and does not say so). `OPENCODE_CLIENT_IDENTITY=mcc` turns the whole impersonation off. Three more things the same evidence asked for: * the user-agent now carries all three segments the real client puts on the wire -- `opencode/<ver> ai-sdk/provider-utils/4.0.40 runtime/bun/1.3.14`, re-captured from 1.18.31 on 2026-09-19 -- with the two appended segments pinnable (`OPENCODE_CLIENT_AI_SDK_VERSION`, `OPENCODE_CLIENT_RUNTIME`); * `FreeTierError` gets its own `FailureKind.FREE_TIER`: no key bench, no proxy bench, the chain falls through, and its own sentence instead of "check API key"; * a tool-less request on a free model still fails, deliberately. The real OpenCode CLI sends no `tools` key at all on its own title sub-request (captured 2026-09-19), which is why its free tier refuses that client's own subagents too (anomalyco/opencode#49592, #49723). Inventing a catalogue MCC cannot honour would be the larger lie. **Verification, with real output.** Golden A/B against a second worktree at v7.27.0, four bodies: zen_paid byte_identical=True chat_groq byte_identical=True zen_free 7.27.0: ['Bash','Read','Edit','Glob','Grep','Write','mcp__...bf22fa52f4e59643'] 7.28.0: ['bash','read','edit','glob','grep','Write','mcp__...bf22fa52f4e59643'] zen_big_pickle same two lines The 68-character MCP name aliases to the same bytes on both sides, so the prompt-cache prefix does not move. uv run --offline pytest -q -p no:randomly --ignore=tests/api/test_admin_static_jsdom.py 12388 passed, 69 skipped, 1 warning in 283.76s uv run --offline pytest -q -p no:randomly -n 2 tests/api/test_admin_static_jsdom.py 4 failed, 329 passed in 251.55s -- the identical four fail on clean fork/main (334.80s): zero regression. ruff format --check . 1086 files already formatted ruff check . All checks passed! ty check All checks passed! `git diff fork/main` over credential_rotation, rate_limit, execution, route_health, proxy_rotation, proxy_rotating, routing, reasoning, output_tokens, cli/, scripts/ and desktop-shell/: empty. Live, through a scratch server on D: with the user's key: three attempts, all answered HTTP 429 `FreeUsageLimitError`. That limiter runs *before* the free-tier classifier, so those attempts never reached the gate and say nothing about the 403 either way. What they do prove is the bytes -- the recorded wire body on both `muse-spark-1.3-contributor-free` (tagged) and `big-pickle` (untagged, admitted by the new setting) carries `['bash','read','edit','glob','grep','mcp__...bf22fa52f4e59643']`, the three-segment user-agent, `stream: true` and the five identity headers. **Not done.** No live 200 was obtained: the account is rate-limited per IP and a 429 is inconclusive. The Messages surface is implemented and unit-tested but has no live free model to exercise it. And a free-tier refusal still reaches `credential_failure_class`'s status fall-through, which is why the failure carries 402 rather than the host's 403 -- teaching that function the kind directly would mean editing a file this PR must leave byte-identical, and belongs in its own patch. by FiredMosquito831
1 parent 4736c82 commit d8208f9

37 files changed

Lines changed: 1725 additions & 55 deletions

‎.env.example‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ OPENCODE_CLIENT_IDENTITY="opencode"
129129
# Which OpenCode release the user-agent names. Empty reads it from the
130130
# opencode-ai package installed on this machine, else a pinned release.
131131
OPENCODE_CLIENT_VERSION=""
132+
# The other two segments of that user-agent, which the client's own transport
133+
# appends and which cannot be read off this machine. Empty sends the segments
134+
# captured from opencode-ai 1.18.31 on 2026-09-19.
135+
OPENCODE_CLIENT_AI_SDK_VERSION=""
136+
OPENCODE_CLIENT_RUNTIME=""
137+
# Zen/Go models on the free tier whose id does not say so. On these -- and on
138+
# every id ending in -free or :free, and every model the catalogue prices at
139+
# zero here -- MCC sends OpenCode's own tool names (bash/read/edit/glob/grep)
140+
# and translates the model's calls back, because since 2026-09-18 that tier
141+
# answers 403 to any other catalogue. Every other model is unaffected.
142+
OPENCODE_FREE_TIER_MODELS="big-pickle"
132143

133144

134145
# Vercel AI Gateway Config (OpenAI-compatible Chat Completions at ai-gateway.vercel.sh/v1)

‎docs/ROUTING-REFERENCE.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ The card keeps the *unselected* mode's fields visible but disabled, each carryin
170170

171171
| Setting | Default | What it does |
172172
| --- | --- | --- |
173-
| `FALLBACK_SKIP_KINDS` | `invalid_request` | Comma-separated failure kinds that abort the chain instead of falling through. Known kinds: `invalid_request`, `model_rejected`, `context_length`, `authentication`, `permission`, `quota`, `rate_limit`, `overloaded`, `timeout`, `upstream`, `unavailable`. Since 6.46.0 `invalid_request` means only a 400 whose own message says the request is *malformed*; every other 400 is `model_rejected` and falls through. Set `FALLBACK_SKIP_KINDS=invalid_request,model_rejected,context_length` to restore the pre-5.43.0 behaviour of giving up on any `400`. `quota` is deliberately absent from the default: an account out of credits says nothing about the request, and the next key or the next model may well answer it. |
173+
| `FALLBACK_SKIP_KINDS` | `invalid_request` | Comma-separated failure kinds that abort the chain instead of falling through. Known kinds: `invalid_request`, `model_rejected`, `context_length`, `authentication`, `permission`, `quota`, `rate_limit`, `overloaded`, `timeout`, `upstream`, `unavailable`, `free_tier`. Since 6.46.0 `invalid_request` means only a 400 whose own message says the request is *malformed*; every other 400 is `model_rejected` and falls through. Set `FALLBACK_SKIP_KINDS=invalid_request,model_rejected,context_length` to restore the pre-5.43.0 behaviour of giving up on any `400`. `quota` is deliberately absent from the default: an account out of credits says nothing about the request, and the next key or the next model may well answer it. |
174174

175175
**Thinking is not answering.** A reasoning model that streams its thoughts and never writes an answer used to commit the route on its very first thought: from that moment no other model could take over, the stall guard never fired because thoughts kept arriving, and the request ran until the whole budget ended it. Measured across 21 days of real traffic, 44 of 499 budget exhaustions were a stream that had only reasoned, and 490 of the 499 never left the first model on the chain.
176176

‎docs/USAGE.md‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,6 +2644,68 @@ first thing to suspect. `OPENCODE_CLIENT_VERSION` pins the
26442644
release named in the user-agent; empty, the default, reads it from the
26452645
`opencode-ai` package installed on this machine.
26462646

2647+
Since 7.28.0 the user-agent has all three of the real client's segments —
2648+
`opencode/1.18.31 ai-sdk/provider-utils/4.0.40 runtime/bun/1.3.14`, captured
2649+
off that client's own wire on 2026-09-19. MCC used to send only the first,
2650+
because the first is the only one the client's source writes: its HTTP
2651+
transport appends the other two underneath. Neither appended segment can be
2652+
read off this machine, so both are pinned and both are overridable —
2653+
`OPENCODE_CLIENT_AI_SDK_VERSION` and `OPENCODE_CLIENT_RUNTIME`.
2654+
2655+
### The free tier now reads your tool names
2656+
2657+
Some time before 2026-09-18 00:52 UTC the Zen free tier stopped checking only
2658+
those headers and started classifying the request's **tool catalogue**. Since
2659+
then it answers `403 FreeTierError` — *"OpenCode's free tier can only be used
2660+
from within OpenCode"* — to any request whose tool names are not its own
2661+
client's. Measured on 2026-09-18, with MCC's headers untouched in every row:
2662+
2663+
| tools on the request | answer |
2664+
| --- | --- |
2665+
| `bash, edit, glob, grep, read` (the client's own spellings) | **200** |
2666+
| `Bash, Edit, Glob, Grep, Read` (Claude Code's) | `403` |
2667+
| no tools at all | `403` |
2668+
| both casings at once | `500 server_error` |
2669+
2670+
So from 7.28.0 MCC **translates**, on free-tier OpenCode models only: on the
2671+
way out `Bash`, `Read`, `Edit`, `Glob` and `Grep` are sent under the names
2672+
OpenCode's own client uses, every other tool name is aliased through the codec
2673+
that already handles this host's 64-character limit, and on the way back every
2674+
tool call the model makes is mapped to the name your agent actually sent. Your
2675+
agent never sees the wire names. No decoy tool is ever added — that is the
2676+
`500` in the table.
2677+
2678+
Which models: any whose id ends in `-free` or `:free`, any the catalogue
2679+
prices at zero on this host, and anything you list in
2680+
`OPENCODE_FREE_TIER_MODELS` (`big-pickle` by default — it is free and its name
2681+
does not say so). **Every other model is untouched**, on OpenCode and
2682+
everywhere else: a paid Zen model gets the byte-identical request it got in
2683+
7.27.0, and a contract test pins that.
2684+
2685+
`OPENCODE_CLIENT_IDENTITY="mcc"` turns the translation off along with the rest
2686+
of the impersonation. A free-tier model will then answer `403`, which is the
2687+
truthful outcome rather than a hidden one.
2688+
2689+
A tool-less request on a free-tier model still fails, and that is deliberate:
2690+
the real OpenCode client sends no `tools` key at all on its own title and
2691+
compaction sub-requests — captured on 2026-09-19 — so those sub-requests are
2692+
refused inside the genuine client too
2693+
([#49592](https://github.com/anomalyco/opencode/issues/49592),
2694+
[#49723](https://github.com/anomalyco/opencode/issues/49723)). Adding a
2695+
catalogue MCC cannot honour, to a request the client it names would not have
2696+
added one to, would be a worse lie than the one being refused.
2697+
2698+
Such a refusal is now its own failure kind, `free_tier`, instead of
2699+
`authentication`. It does not bench the key (the key is fine), it does not
2700+
bench the proxy (the same account is refused from every address), and the
2701+
route falls through to the next model.
2702+
2703+
**Expect this to break again.** The vendor tightened this gate three times in
2704+
48 hours and has said on the record that the free tier is harness-locked
2705+
policy. Everything above is written to be re-measured — one mapping, one
2706+
predicate, three settings — rather than to be clever. The durable paths remain
2707+
a paid Zen key or OpenCode Go.
2708+
26472709
**OpenCode Go is unverified.** The vendor said on 2026-09-03 that Go requests
26482710
must carry the conversation header and began enforcing it on 2026-09-06. MCC
26492711
sends it, under the same rule as Zen. Both live Go probes were answered
@@ -4734,6 +4796,9 @@ Only the keys whose value or meaning moved in 6.0.0–6.8.0. Everything else in
47344796
| `HARNESS_TIER_ALIASES` | `true` | **New in 6.38.0.** Lists `mcc/cyber`, `mcc/best`, `mcc/good`, `mcc/medium`, `mcc/cheap` and `mcc/vision` at the top of every coding agent's generated picker, each a name for one of MCC's own routes rather than a model of its own. Off keeps those pickers to concrete refs; the router still resolves an alias a client sends anyway, so an agent already configured on one keeps working. Per-agent chains live in `~/.mcc/harness_tiers.json`, written by the **Coding agents** page. See [Tiers for every other coding agent](#tiers-for-every-other-coding-agent). |
47354797
| `OPENCODE_CLIENT_IDENTITY` | `opencode` | **New in 6.69.0.** Which client MCC identifies as to OpenCode Zen and OpenCode Go, both of which read identity headers off every request. `opencode` sends the official client's user-agent and client id, which is what the free tier's limiter recognises; `mcc` sends `my-claude-code` and this version instead. The conversation, request and project headers go either way. See [OpenCode Zen and OpenCode Go: what MCC sends about itself](#opencode-zen-and-opencode-go-what-mcc-sends-about-itself). |
47364798
| `OPENCODE_CLIENT_VERSION` | *(empty)* | **New in 6.69.0.** Pins the OpenCode release named in that user-agent. Empty reads it from the `opencode-ai` package installed on this machine, and falls back to the release this build was verified against. Only used when `OPENCODE_CLIENT_IDENTITY` is `opencode`. |
4799+
| `OPENCODE_CLIENT_AI_SDK_VERSION` | *(empty)* | **New in 7.28.0.** The middle segment of the user-agent the real OpenCode client sends — `ai-sdk/provider-utils/<this>`. Its own HTTP transport appends it, so unlike the release above it cannot be read off this machine; empty sends the version captured from the client this release was built against. Only used when `OPENCODE_CLIENT_IDENTITY` is `opencode`. |
4800+
| `OPENCODE_CLIENT_RUNTIME` | *(empty)* | **New in 7.28.0.** The last user-agent segment, written `<runtime>/<version>` and sent as `runtime/<that>` — `bun/1.3.14` on the captured client. Empty sends the captured value. Only used when `OPENCODE_CLIENT_IDENTITY` is `opencode`. |
4801+
| `OPENCODE_FREE_TIER_MODELS` | `big-pickle` | **New in 7.28.0.** Comma-separated Zen/Go model ids that are on the free tier without saying so in their name. On these — and on any id ending `-free` or `:free`, and any model the catalogue prices at zero here — MCC sends OpenCode's own tool-name spellings and translates the model's calls back, because that tier answers `403` to any other catalogue. Every other model keeps the request it has always been sent. See [The free tier now reads your tool names](#the-free-tier-now-reads-your-tool-names). |
47374802
| `SERVER_STALE_SERVER_ACTION` | `report` | **New in 6.72.2.** What the server does about other My Claude Code servers it finds at start. `report` names each one in the server log — pid, session, recorded port, start time, last heartbeat, and the files it holds open — and stops nothing. `stop` also stops the ones this install can prove are finished: a heartbeat silent past `SERVER_STALE_SESSION_SECONDS` whose recorded port is now served by a different MCC, or a launcher whose server process is gone. A server is never stopped merely for owning no listening socket. |
47384803
| `SERVER_STALE_SESSION_SECONDS` | `900` | **New in 6.72.2.** How long another server's heartbeat must be silent before the word "stale" is available for it. A running server checks in every 30 s, so the default is thirty missed beats. Silence alone never stops anything. Range 60–86400. |
47394804
| `SERVER_PORT_TAKEOVER` | `always` | **New in 6.59.0.** What happens when the server starts and its port is already held. `always` stops the holder and takes the port; a holder that is not MCC is named in one `WARNING` line first. Setting it to mcc-only stops only processes this install can identify as its own; never is the pre-6.59.0 behaviour — name the holder and refuse to start. Identification is by process, never by the HTTP answer. |

‎packaging/npm/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@firedmosquito831/my-claude-code",
3-
"version": "7.27.0",
3+
"version": "7.28.0",
44
"description": "My Claude Code (MCC): a local multi-provider LLM proxy, model router and control plane for Claude Code, Codex, OpenCode, Gemini CLI and other AI coding agents, with 57 providers, fallback routing, credential health, a native web-search tool proxy, and analytics with cost provenance. This npm package installs and launches the Python server.",
55
"license": "AGPL-3.0-or-later",
66
"author": "FiredMosquito831",

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "my-claude-code"
7-
version = "7.27.0"
7+
version = "7.28.0"
88
description = "Local multi-provider LLM proxy, model router and control plane for Claude Code, Codex, OpenCode, Gemini CLI and other AI coding agents: 57 providers, fallback routing, credential health, a native web-search tool proxy, and analytics with cost provenance"
99
readme = "README.md"
1010
license = "AGPL-3.0-or-later AND MIT"

‎src/my_claude_code/api/admin_proxy_routes.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@
166166
"overloaded": "The provider is busy. A different address occasionally helps.",
167167
"upstream": "A fault on the provider's side. A different address occasionally helps.",
168168
"unavailable": "A dead or refused connection. Often the proxy, sometimes the provider.",
169+
"free_tier": (
170+
"The host refused the model on this account's tier. The same account "
171+
"is refused from every address, so a new one changes nothing."
172+
),
169173
}
170174

171175

‎src/my_claude_code/config/admin/manifest.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,10 +636,12 @@ def _reasoning_options(
636636
"refusal ends the whole route. Leave empty to fall back on every "
637637
"failure. Known kinds: invalid_request, model_rejected, "
638638
"context_length, authentication, permission, quota, rate_limit, "
639-
"overloaded, timeout, upstream, unavailable. Listing quota here "
640-
"means an account out of credits ends the route instead of trying "
641-
"the next key and the next model, which is almost never what you "
642-
"want."
639+
"overloaded, timeout, upstream, unavailable, free_tier. Listing "
640+
"quota here means an account out of credits ends the route instead "
641+
"of trying the next key and the next model, which is almost never "
642+
"what you want, and listing free_tier means one host's refusal to "
643+
"serve one model on its free tier ends the route instead of trying "
644+
"the next model on the same host."
643645
),
644646
),
645647
# ---- Keeping the catalogue current ---------------------------------

‎src/my_claude_code/config/admin/provider_manifest.py‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44

55
from my_claude_code.config.admin.spec import ConfigOptionSpec
66
from my_claude_code.config.constants import (
7+
OPENCODE_CLIENT_AI_SDK_VERSION_DEFAULT,
78
OPENCODE_CLIENT_IDENTITY_DEFAULT,
9+
OPENCODE_CLIENT_RUNTIME_DEFAULT,
810
OPENCODE_CLIENT_VERSION_DEFAULT,
11+
OPENCODE_FREE_TIER_MODELS_DEFAULT,
912
)
1013
from my_claude_code.config.provider_catalog import (
1114
AZURE_OPENAI_BASE_URL_EXAMPLE,
@@ -490,6 +493,59 @@ def _opencode_identity_field_specs() -> tuple[dict[str, Any], ...]:
490493
"version of MCC was built against. Only used when OpenCode Client Identity is opencode."
491494
),
492495
},
496+
{
497+
"key": "OPENCODE_CLIENT_AI_SDK_VERSION",
498+
"label": "OpenCode ai-sdk Version",
499+
"section_id": "providers",
500+
"provider": "opencode",
501+
"settings_attr": "opencode_client_ai_sdk_version",
502+
"default": OPENCODE_CLIENT_AI_SDK_VERSION_DEFAULT,
503+
"advanced": True,
504+
"restart_required": True,
505+
"description": (
506+
"The middle segment of the user-agent the real OpenCode client sends: "
507+
"opencode/<release> ai-sdk/provider-utils/<this> runtime/<below>. Its own "
508+
"transport appends it, so it cannot be read off the installed package. "
509+
"Empty -- the default -- sends the version captured from the client this "
510+
"release was built against. Only used when OpenCode Client Identity is opencode."
511+
),
512+
},
513+
{
514+
"key": "OPENCODE_CLIENT_RUNTIME",
515+
"label": "OpenCode Runtime Segment",
516+
"section_id": "providers",
517+
"provider": "opencode",
518+
"settings_attr": "opencode_client_runtime",
519+
"default": OPENCODE_CLIENT_RUNTIME_DEFAULT,
520+
"advanced": True,
521+
"restart_required": True,
522+
"description": (
523+
"The last user-agent segment, written as <runtime>/<version> and sent as "
524+
"runtime/<that> -- bun/1.3.14 on the client captured for this release. "
525+
"Empty sends the captured value. Only used when OpenCode Client Identity "
526+
"is opencode."
527+
),
528+
},
529+
{
530+
"key": "OPENCODE_FREE_TIER_MODELS",
531+
"label": "OpenCode free-tier models (comma-separated)",
532+
"section_id": "providers",
533+
"provider": "opencode",
534+
"settings_attr": "opencode_free_tier_models",
535+
"default": OPENCODE_FREE_TIER_MODELS_DEFAULT,
536+
"restart_required": True,
537+
"description": (
538+
"Comma-separated Zen and Go model ids that are on the free tier without "
539+
"saying so in their name. Since 2026-09-18 that tier answers 403 to any "
540+
"request whose tool names are not its own client's, so MCC translates "
541+
"Bash/Read/Edit/Glob/Grep to bash/read/edit/glob/grep on these models and "
542+
"translates the answer back -- and on nothing else, so every paid model "
543+
"keeps the request it has always been sent. Models whose id already ends "
544+
"in -free or :free, and models the catalogue prices at zero here, need no "
545+
"entry. Set OpenCode Client Identity to mcc to turn the translation off "
546+
"entirely."
547+
),
548+
},
493549
)
494550

495551

‎src/my_claude_code/config/constants.py‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@
255255
"timeout",
256256
"upstream",
257257
"unavailable",
258+
"free_tier",
258259
}
259260
)
260261

@@ -954,3 +955,47 @@
954955
# An operator's pin for the version above. Empty -- the default -- means "read
955956
# it from this machine, and fall back to the pinned release".
956957
OPENCODE_CLIENT_VERSION_DEFAULT = ""
958+
959+
# The other two segments of the real client's user-agent.
960+
#
961+
# `opencode/<ver>` is the only segment the client's own source writes. The
962+
# other two are appended underneath by the ai-sdk fetch wrapper, which sets
963+
# `user-agent` to `[existing, "ai-sdk/provider-utils/<ver>",
964+
# runtimeEnvironmentUserAgent()].join(" ")`. Captured off the real
965+
# `[email protected]` wire on 2026-09-19 (scratch HOME, provider baseURL
966+
# pointed at a local recorder):
967+
#
968+
# opencode/1.18.31 ai-sdk/provider-utils/4.0.40 runtime/bun/1.3.14
969+
#
970+
# Neither segment can be read off this machine: the ai-sdk version lives
971+
# inside the compiled bundle and the bun version is the runtime that bundle
972+
# was built with, so unlike the release above there is nothing on disk to
973+
# prefer. They are pinned, and overridable, for the reason the survey in
974+
# `specs/INVESTIGATION-ZEN-403-FREETIER.md` gives: one env var is the whole
975+
# cost of following the vendor the next time the floor moves.
976+
#
977+
# Sending them is not what lifts the 403 -- probe B says the three-segment
978+
# form alone is still refused -- it removes the last known divergence between
979+
# what MCC puts on the wire and what the client it names puts on the wire.
980+
OPENCODE_CLIENT_AI_SDK_VERSION_FALLBACK = "4.0.40"
981+
OPENCODE_CLIENT_RUNTIME_FALLBACK = "bun/1.3.14"
982+
983+
# Operator pins for the two segments above. Empty -- the default -- means
984+
# "send the pinned segment". A single space or any other blank-looking value
985+
# is normalised away rather than emitted into a header.
986+
OPENCODE_CLIENT_AI_SDK_VERSION_DEFAULT = ""
987+
OPENCODE_CLIENT_RUNTIME_DEFAULT = ""
988+
989+
# The Zen and Go models that are on the free tier without saying so in their
990+
# id.
991+
#
992+
# The free-tier gate (2026-09-18, see
993+
# `providers/openai_chat/opencode_catalogue.py`) refuses any request whose
994+
# tool catalogue is not OpenCode's own, and MCC answers it by translating tool
995+
# names -- but only for models actually on that tier, because every other
996+
# model is entitled to the request MCC has always sent. Most free Zen models
997+
# carry `-free` in the id and need no help. `big-pickle` is free and untagged,
998+
# which is why this list exists and why it is a setting rather than a
999+
# constant: the vendor's free roster changes without a release, and so should
1000+
# this.
1001+
OPENCODE_FREE_TIER_MODELS_DEFAULT = "big-pickle"

‎src/my_claude_code/config/proxy_chains.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
"timeout",
151151
"upstream",
152152
"unavailable",
153+
"free_tier",
153154
)
154155

155156
#: Refused outright, with the reason on the chip. Rotating on a 401/403 burns

0 commit comments

Comments
 (0)