Skip to content

Commit 59415f6

Browse files
anandgupta42claude
andcommitted
fix: repair unbalanced altimate_change markers and upstream branding in the Base default changes
- `server.ts`: restore the outer import block's `altimate_change end` that was removed together with the `FreeTierHost` import - `acp.ts`: the auto-register import block used a single-line marker closed by an `end`; make it a `start` - `provider.ts`: drop a nested `start` inside an already-marked block in `defaultModel()` - `provider/error.ts`: the Zen rejection message and its matcher no longer name the upstream product; behavior unchanged (still scoped to the `opencode` provider) - Reword two comments that the branding audit flagged Fixes the Marker Guard and `bridge-merge` / `upstream-merge-guard` CI failures. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 695bbf6 commit 59415f6

7 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎packages/opencode/src/acp/service.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ export function defaultModelFromConfig(
923923
// Altimate Base replaces Big Pickle as the free fallback once it auto-registers (which is why it
924924
// is present in `providers`). Anything the user actually connected outranks the request-logging
925925
// tier, and the keyless public Zen tier now ranks below registered Base unconditionally —
926-
// OpenCode Zen rejects keyless traffic outright, so there is no "declined the switch" choice left
926+
// Zen rejects keyless traffic outright, so there is no "declined the switch" choice left
927927
// to honor. A keyed Zen account still wins. A project provider block cannot force the managed
928928
// model; an explicit configured model above remains authoritative.
929929
if (registeredBaseAvailable) {

‎packages/opencode/src/cli/cmd/acp.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { ServerAuth } from "@/server/auth"
55
import { createOpencodeClient } from "@opencode-ai/sdk/v2"
66
import { withNetworkOptions, resolveNetworkOptions } from "../network"
77
import { ACPProfile } from "@/acp/profile"
8-
// altimate_change — auto-register Altimate Base before the directory/provider snapshot is built
8+
// altimate_change start — auto-register Altimate Base before the directory/provider snapshot is built
99
import { FreeTier } from "@/altimate/free/client"
1010
// altimate_change end
1111

‎packages/opencode/src/provider/error.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,15 +343,15 @@ export namespace ProviderError {
343343
// Check responseBody for context_length_exceeded code (e.g., OpenAI-style errors)
344344
const bodyParsed = json(input.error.responseBody)
345345
const codeFromBody = bodyParsed?.error?.code
346-
// altimate_change start — OpenCode Zen's keyless free tier (provider "opencode", the
347-
// `apiKey: "public"` fallback in provider.ts) stopped accepting our traffic on 2026-09-17
348-
// ("OpenCode's free tier can only be used from within OpenCode"). Without this, users saw
349-
// that raw provider string. Point them at Altimate Base instead; never auto-switch here.
350-
if (String(input.providerID) === "opencode" && /can only be used from within OpenCode/i.test(m)) {
346+
// altimate_change start — Zen's keyless free tier (provider "opencode", the `apiKey: "public"`
347+
// fallback in provider.ts) stopped accepting our traffic on 2026-09-17 with a "free tier can only
348+
// be used from within <upstream app>" rejection. Without this, users saw that raw provider
349+
// string. Point them at Altimate Base instead; never auto-switch here.
350+
if (String(input.providerID) === "opencode" && /free tier can only be used from within/i.test(m)) {
351351
return {
352352
type: "api_error",
353353
message:
354-
"OpenCode's free models no longer work in Altimate Code. Switch to Altimate Base (free) with /models (or your editor's model picker), or connect your own provider.",
354+
"The free Zen models no longer work in Altimate Code. Switch to Altimate Base (free) with /models (or your editor's model picker), or connect your own provider.",
355355
statusCode: input.error.statusCode,
356356
isRetryable: false,
357357
responseHeaders: input.error.responseHeaders,

‎packages/opencode/src/provider/provider.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2242,7 +2242,7 @@ export namespace Provider {
22422242
const baseProviderID = ProviderID.make(FreeTier.PROVIDER_ID)
22432243
const baseModelID = ModelID.make(FreeTier.MODEL_ID)
22442244
const baseProvider = providers[baseProviderID]
2245-
// altimate_change start — Base is excluded only by an actual enabled_providers/disabled_providers
2245+
// Base is excluded only by an actual enabled_providers/disabled_providers
22462246
// verdict, which `providers` (built in state() via isProviderAllowed) already reflects. The
22472247
// mere presence of OTHER custom `config.provider` entries (`hasProviderAllowlist`) used to hide
22482248
// Base here too — that's the bug OpenCode Zen's keyless rejection turned into 360 failed

‎packages/opencode/src/server/server.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import { FreeTierConsent } from "../altimate/free/consent"
4545
import { InstanceStore } from "@/project/instance-store"
4646
import { AppRuntime } from "@/effect/app-runtime"
4747
// altimate_change end
48+
// altimate_change end
4849
import { FileRoutes } from "./routes/file"
4950
import { ConfigRoutes } from "./routes/config"
5051
import { ExperimentalRoutes } from "./routes/experimental"

‎packages/opencode/test/provider/error.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ describe("ProviderError.parseAPICallError: OpenCode Zen keyless free tier block"
494494
})
495495
expect(result.type).toBe("api_error")
496496
expect(result.message).toBe(
497-
"OpenCode's free models no longer work in Altimate Code. Switch to Altimate Base (free) with /models (or your editor's model picker), or connect your own provider.",
497+
"The free Zen models no longer work in Altimate Code. Switch to Altimate Base (free) with /models (or your editor's model picker), or connect your own provider.",
498498
)
499499
if (result.type === "api_error") {
500500
expect(result.isRetryable).toBe(false)

‎packages/tui/src/component/dialog-model.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function DialogModel(props: {
6565
let activated = false
6666

6767
// A provider is "ready" (usable now) when it has valid credentials: it is present
68-
// in the live provider list with at least one model — and, for the free OpenCode
68+
// in the live provider list with at least one model — and, for the free Zen
6969
// provider, with at least one paid model (a Zen key entered).
7070
function providerReady(id: string) {
7171
const p = sync.data.provider.find((x) => x.id === id)

0 commit comments

Comments
 (0)