Skip to content

Commit ad14dd5

Browse files
suryaiyer95claude
andcommitted
fix: revert model ID rename (backward-compat) + resolve review comments
Addresses two review findings: 1. cubic P1 — renaming the internal model ID from `altimate-default` to `altimate-llm-gateway` broke backward compatibility. Opencode persists selected model IDs to `model.json` (favorites, recents, variants) and users can pin `model: altimate-backend/altimate-default` in their opencode.json. After the rename those references would silently go stale. Keep the ID as `altimate-default`; the polish the user actually wanted was the display name, which stays as "Altimate LLM Gateway". Added a comment explaining why the ID is preserved. Rephrased the auto-selection tip in `docs/docs/configure/providers.md` to refer to the display name rather than the internal ID. 2. Coderabbit — the custom-URL example in `docs/docs/getting-started.md` used `api-url::instance-name::api-key` which is ambiguous; the parser requires `http(s)://`. Replaced with a concrete `https://api.example.com::...` example and added a sentence stating the scheme is required. Also reverted provider.ts, acp/agent.ts, provider.test.ts, and release-v0.5.20-adversarial.test.ts to use the original `altimate-default` ID. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 454f9f2 commit ad14dd5

6 files changed

Lines changed: 19 additions & 15 deletions

File tree

docs/docs/configure/providers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Managed LLM access with dynamic routing across Sonnet 4.6, Opus 4.6, GPT-5.4, GP
3939
For pricing, security, and data handling details, see the [Altimate LLM Gateway guide](https://datamates-docs.myaltimate.com/user-guide/components/llm-gateway/).
4040

4141
!!! tip "Automatic model selection"
42-
When Altimate credentials are configured and no model is explicitly chosen, `altimate-backend/altimate-llm-gateway` is selected automatically. You can override this by setting `model` in your config or by restricting the `provider` section to specific providers only.
42+
When Altimate credentials are configured and no model is explicitly chosen, the Altimate LLM Gateway is selected automatically. You can override this by setting `model` in your config or by restricting the `provider` section to specific providers only.
4343

4444
## Anthropic
4545

docs/docs/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ For example: `acme::your-api-key` — this uses the default API URL `https://api
9494
- **Instance Name** — the subdomain from your Altimate dashboard URL (e.g. `acme` from `https://acme.app.myaltimate.com`)
9595
- **API Key** — go to **Settings > API Keys** in your Altimate dashboard and click **Copy**
9696

97-
If your instance uses a different API URL (e.g. a self-hosted or `getaltimate.com` deployment), prepend it:
97+
If your instance uses a different API URL (e.g. a self-hosted or `getaltimate.com` deployment), prepend the full URL — it must include the `http://` or `https://` scheme, hostname-only values will fail validation:
9898

9999
```text
100-
api-url::instance-name::api-key
100+
https://api.example.com::instance-name::api-key
101101
```
102102

103103
For example: `https://api.getaltimate.com::acme::your-api-key`

packages/opencode/src/acp/agent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1581,12 +1581,12 @@ export namespace ACP {
15811581
const altimateProvider = providers.find((p) => p.id === "altimate-backend")
15821582
if (
15831583
altimateProvider &&
1584-
altimateProvider.models["altimate-llm-gateway"] &&
1584+
altimateProvider.models["altimate-default"] &&
15851585
(!providerFilter || Object.keys(providerFilter).includes("altimate-backend"))
15861586
) {
15871587
return {
15881588
providerID: ProviderID.make("altimate-backend"),
1589-
modelID: ModelID.make("altimate-llm-gateway"),
1589+
modelID: ModelID.make("altimate-default"),
15901590
}
15911591
}
15921592
// altimate_change end

packages/opencode/src/provider/provider.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,12 +1022,16 @@ export namespace Provider {
10221022
// altimate_change start — register altimate-backend as an OpenAI-compatible provider
10231023
if (!database["altimate-backend"]) {
10241024
const backendModels: Record<string, Model> = {
1025-
"altimate-llm-gateway": {
1026-
id: ModelID.make("altimate-llm-gateway"),
1025+
// ID "altimate-default" is kept for backward compatibility — existing
1026+
// users have it persisted in their model.json favorites/recents and in
1027+
// opencode.json `model:` entries. Display name ("Altimate LLM Gateway")
1028+
// is what the TUI actually shows, so branding stays correct.
1029+
"altimate-default": {
1030+
id: ModelID.make("altimate-default"),
10271031
providerID: ProviderID.make("altimate-backend"),
10281032
name: "Altimate LLM Gateway",
10291033
family: "openai",
1030-
api: { id: "altimate-llm-gateway", url: "", npm: "@ai-sdk/openai-compatible" },
1034+
api: { id: "altimate-default", url: "", npm: "@ai-sdk/openai-compatible" },
10311035
status: "active",
10321036
headers: {},
10331037
options: {},
@@ -1642,15 +1646,15 @@ export namespace Provider {
16421646
const altimateProvider = providers[altimateProviderID]
16431647
if (
16441648
altimateProvider &&
1645-
altimateProvider.models[ModelID.make("altimate-llm-gateway")] &&
1649+
altimateProvider.models[ModelID.make("altimate-default")] &&
16461650
(!cfg.provider || Object.keys(cfg.provider).includes(String(altimateProviderID)))
16471651
) {
16481652
// altimate_change start — log when altimate-backend auto-selected
1649-
log.info("defaulting to altimate-backend/altimate-llm-gateway (no model configured)")
1653+
log.info("defaulting to altimate-backend/altimate-default (no model configured)")
16501654
// altimate_change end
16511655
return {
16521656
providerID: altimateProviderID,
1653-
modelID: ModelID.make("altimate-llm-gateway"),
1657+
modelID: ModelID.make("altimate-default"),
16541658
}
16551659
}
16561660
// altimate_change end

packages/opencode/test/provider/provider.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,7 +2362,7 @@ test("defaultModel returns altimate-backend when altimate credentials exist and
23622362
fn: async () => {
23632363
const model = await Provider.defaultModel()
23642364
expect(String(model.providerID)).toBe("altimate-backend")
2365-
expect(String(model.modelID)).toBe("altimate-llm-gateway")
2365+
expect(String(model.modelID)).toBe("altimate-default")
23662366
},
23672367
})
23682368
} finally {
@@ -2408,7 +2408,7 @@ test("defaultModel prefers altimate-backend over other providers when altimate i
24082408
// But defaultModel should prefer altimate-backend
24092409
const model = await Provider.defaultModel()
24102410
expect(String(model.providerID)).toBe("altimate-backend")
2411-
expect(String(model.modelID)).toBe("altimate-llm-gateway")
2411+
expect(String(model.modelID)).toBe("altimate-default")
24122412
},
24132413
})
24142414
} finally {

packages/opencode/test/skill/release-v0.5.20-adversarial.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ describe("v0.5.20 release: listTracesPaginated adversarial", () => {
256256

257257
describe("v0.5.20 release: Provider.parseModel adversarial", () => {
258258
test("model string with multiple slashes preserves all parts", () => {
259-
const result = Provider.parseModel("altimate-backend/altimate-llm-gateway")
259+
const result = Provider.parseModel("altimate-backend/altimate-default")
260260
expect(String(result.providerID)).toBe("altimate-backend")
261-
expect(String(result.modelID)).toBe("altimate-llm-gateway")
261+
expect(String(result.modelID)).toBe("altimate-default")
262262
})
263263

264264
test("model string with nested slashes preserves full model ID", () => {

0 commit comments

Comments
 (0)