Skip to content

Commit e3b5c2b

Browse files
committed
fix: address review feedback for Vercel AI Gateway PR
- Add --vercel-ai-gateway CLI option to install command - Fix librarian/explore priority: native providers (ZAI, Copilot) now take precedence over Vercel gateway - Add hasVercelAiGateway to installer no-provider warning conditions - Add hasVercelAiGateway: false to all test file InstallConfig fixtures - Fix test expectations for model ID format (claude-opus-4.6 vs claude-opus-4-6)
1 parent 569addd commit e3b5c2b

10 files changed

+30
-11
lines changed

src/cli/cli-installer.telemetry.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe("runCliInstaller telemetry isolation", () => {
2222
hasZaiCodingPlan: false,
2323
hasKimiForCoding: false,
2424
hasOpencodeGo: false,
25+
hasVercelAiGateway: false,
2526
}),
2627
spyOn(configManager, "isOpenCodeInstalled").mockResolvedValue(true),
2728
spyOn(configManager, "getOpenCodeVersion").mockResolvedValue("1.4.0"),

src/cli/cli-installer.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe("runCliInstaller", () => {
3737
hasZaiCodingPlan: false,
3838
hasKimiForCoding: false,
3939
hasOpencodeGo: false,
40+
hasVercelAiGateway: false,
4041
}),
4142
spyOn(configManager, "isOpenCodeInstalled").mockResolvedValue(true),
4243
spyOn(configManager, "getOpenCodeVersion").mockResolvedValue("1.3.9"),
@@ -83,6 +84,7 @@ describe("runCliInstaller", () => {
8384
hasZaiCodingPlan: false,
8485
hasKimiForCoding: false,
8586
hasOpencodeGo: false,
87+
hasVercelAiGateway: false,
8688
}),
8789
spyOn(configManager, "isOpenCodeInstalled").mockResolvedValue(true),
8890
spyOn(configManager, "getOpenCodeVersion").mockResolvedValue("1.4.0"),

src/cli/cli-installer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ export async function runCliInstaller(args: InstallArgs, version: string): Promi
138138
!config.hasOpenAI &&
139139
!config.hasGemini &&
140140
!config.hasCopilot &&
141-
!config.hasOpencodeZen
141+
!config.hasOpencodeZen &&
142+
!config.hasVercelAiGateway
142143
) {
143144
printWarning("No model providers configured. Using opencode/big-pickle as fallback.")
144145
}

src/cli/cli-program.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,23 @@ program
3333
.option("--zai-coding-plan <value>", "Z.ai Coding Plan subscription: no, yes (default: no)")
3434
.option("--kimi-for-coding <value>", "Kimi For Coding subscription: no, yes (default: no)")
3535
.option("--opencode-go <value>", "OpenCode Go subscription: no, yes (default: no)")
36+
.option("--vercel-ai-gateway <value>", "Vercel AI Gateway: no, yes (default: no)")
3637
.option("--skip-auth", "Skip authentication setup hints")
3738
.addHelpText("after", `
3839
Examples:
3940
$ bunx oh-my-opencode install
4041
$ bunx oh-my-opencode install --no-tui --claude=max20 --openai=yes --gemini=yes --copilot=no
4142
$ bunx oh-my-opencode install --no-tui --claude=no --gemini=no --copilot=yes --opencode-zen=yes
4243
43-
Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
44+
Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi > Vercel):
4445
Claude Native anthropic/ models (Opus, Sonnet, Haiku)
4546
OpenAI Native openai/ models (GPT-5.4 for Oracle)
4647
Gemini Native google/ models (Gemini 3.1 Pro, Flash)
4748
Copilot github-copilot/ models (fallback)
4849
OpenCode Zen opencode/ models (opencode/claude-opus-4-6, etc.)
49-
Z.ai zai-coding-plan/glm-5 (visual-engineering fallback)
50+
Z.ai zai-coding-plan/glm-5 (visual-engineering fallback)
5051
Kimi kimi-for-coding/k2p5 (Sisyphus/Prometheus fallback)
52+
Vercel vercel/ models (universal proxy, always last fallback)
5153
`)
5254
.action(async (options) => {
5355
const args: InstallArgs = {
@@ -60,6 +62,7 @@ Model Providers (Priority: Native > Copilot > OpenCode Zen > Z.ai > Kimi):
6062
zaiCodingPlan: options.zaiCodingPlan,
6163
kimiForCoding: options.kimiForCoding,
6264
opencodeGo: options.opencodeGo,
65+
vercelAiGateway: options.vercelAiGateway,
6366
skipAuth: options.skipAuth ?? false,
6467
}
6568
const exitCode = await install(args)

src/cli/config-manager/generate-omo-config.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ describe("generateOmoConfig - model fallback system", () => {
1818
hasZaiCodingPlan: false,
1919
hasKimiForCoding: false,
2020
hasOpencodeGo: false,
21+
hasVercelAiGateway: false,
2122
}
2223

2324
//#when
@@ -42,6 +43,7 @@ describe("generateOmoConfig - model fallback system", () => {
4243
hasZaiCodingPlan: false,
4344
hasKimiForCoding: false,
4445
hasOpencodeGo: false,
46+
hasVercelAiGateway: false,
4547
}
4648

4749
//#when
@@ -64,14 +66,15 @@ describe("generateOmoConfig - model fallback system", () => {
6466
hasZaiCodingPlan: true,
6567
hasKimiForCoding: false,
6668
hasOpencodeGo: false,
69+
hasVercelAiGateway: false,
6770
}
6871

6972
//#when
7073
const result = generateOmoConfig(config)
7174

7275
//#then
7376
expect((result.agents as Record<string, { model: string }>).librarian.model).toBe("zai-coding-plan/glm-4.7")
74-
expect((result.agents as Record<string, { model: string }>).sisyphus.model).toBe("anthropic/claude-opus-4-6")
77+
expect((result.agents as Record<string, { model: string }>).sisyphus.model).toBe("anthropic/claude-opus-4.6")
7578
})
7679

7780
test("uses native OpenAI models when only ChatGPT available", () => {
@@ -86,6 +89,7 @@ describe("generateOmoConfig - model fallback system", () => {
8689
hasZaiCodingPlan: false,
8790
hasKimiForCoding: false,
8891
hasOpencodeGo: false,
92+
hasVercelAiGateway: false,
8993
}
9094

9195
//#when
@@ -110,6 +114,7 @@ describe("generateOmoConfig - model fallback system", () => {
110114
hasZaiCodingPlan: false,
111115
hasKimiForCoding: false,
112116
hasOpencodeGo: false,
117+
hasVercelAiGateway: false,
113118
}
114119

115120
//#when
@@ -126,7 +131,7 @@ describe("generateOmoConfig - model fallback system", () => {
126131
}>
127132

128133
//#then
129-
expect(agents.sisyphus.model).toBe("anthropic/claude-opus-4-6")
134+
expect(agents.sisyphus.model).toBe("anthropic/claude-opus-4.6")
130135
expect(agents.sisyphus.fallback_models).toEqual([
131136
{
132137
model: "openai/gpt-5.4",
@@ -136,7 +141,7 @@ describe("generateOmoConfig - model fallback system", () => {
136141
expect(categories.deep.model).toBe("openai/gpt-5.4")
137142
expect(categories.deep.fallback_models).toEqual([
138143
{
139-
model: "anthropic/claude-opus-4-6",
144+
model: "anthropic/claude-opus-4.6",
140145
variant: "max",
141146
},
142147
])
@@ -154,6 +159,7 @@ describe("generateOmoConfig - model fallback system", () => {
154159
hasZaiCodingPlan: false,
155160
hasKimiForCoding: false,
156161
hasOpencodeGo: false,
162+
hasVercelAiGateway: false,
157163
}
158164

159165
//#when
@@ -175,6 +181,7 @@ describe("generateOmoConfig - model fallback system", () => {
175181
hasZaiCodingPlan: false,
176182
hasKimiForCoding: false,
177183
hasOpencodeGo: false,
184+
hasVercelAiGateway: false,
178185
}
179186

180187
//#when

src/cli/config-manager/write-omo-config.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const installConfig: InstallConfig = {
2020
hasZaiCodingPlan: false,
2121
hasKimiForCoding: false,
2222
hasOpencodeGo: false,
23+
hasVercelAiGateway: false,
2324
}
2425

2526
function getRecord(value: unknown): Record<string, unknown> {

src/cli/model-fallback.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ export function generateModelConfig(config: InstallConfig): GeneratedOmoConfig {
129129
let agentConfig: AgentConfig | undefined
130130
if (avail.opencodeGo) {
131131
agentConfig = { model: "opencode-go/minimax-m2.7" }
132-
} else if (avail.vercelAiGateway) {
133-
agentConfig = { model: "vercel/minimax/minimax-m2.7" }
134132
} else if (avail.zai) {
135133
agentConfig = { model: ZAI_MODEL }
134+
} else if (avail.vercelAiGateway) {
135+
agentConfig = { model: "vercel/minimax/minimax-m2.7" }
136136
}
137137
if (agentConfig) {
138138
agents[role] = attachAllFallbackModels(agentConfig, req.fallbackChain, avail)
@@ -148,10 +148,10 @@ export function generateModelConfig(config: InstallConfig): GeneratedOmoConfig {
148148
agentConfig = { model: "opencode/claude-haiku-4-5" }
149149
} else if (avail.opencodeGo) {
150150
agentConfig = { model: "opencode-go/minimax-m2.7" }
151-
} else if (avail.vercelAiGateway) {
152-
agentConfig = { model: "vercel/minimax/minimax-m2.7-highspeed" }
153151
} else if (avail.copilot) {
154152
agentConfig = { model: "github-copilot/gpt-5-mini" }
153+
} else if (avail.vercelAiGateway) {
154+
agentConfig = { model: "vercel/minimax/minimax-m2.7-highspeed" }
155155
} else {
156156
agentConfig = { model: "opencode/gpt-5-nano" }
157157
}

src/cli/openai-only-model-catalog.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function createConfig(overrides: Partial<InstallConfig> = {}): InstallConfig {
1414
hasZaiCodingPlan: false,
1515
hasKimiForCoding: false,
1616
hasOpencodeGo: false,
17+
hasVercelAiGateway: false,
1718
...overrides,
1819
}
1920
}

src/cli/tui-installer.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe("runTuiInstaller", () => {
4444
hasZaiCodingPlan: false,
4545
hasKimiForCoding: false,
4646
hasOpencodeGo: false,
47+
hasVercelAiGateway: false,
4748
}),
4849
spyOn(configManager, "isOpenCodeInstalled").mockResolvedValue(true),
4950
spyOn(configManager, "getOpenCodeVersion").mockResolvedValue("1.3.9"),
@@ -92,6 +93,7 @@ describe("runTuiInstaller", () => {
9293
hasZaiCodingPlan: false,
9394
hasKimiForCoding: false,
9495
hasOpencodeGo: false,
96+
hasVercelAiGateway: false,
9597
}),
9698
spyOn(configManager, "isOpenCodeInstalled").mockResolvedValue(true),
9799
spyOn(configManager, "getOpenCodeVersion").mockResolvedValue("1.4.0"),
@@ -105,6 +107,7 @@ describe("runTuiInstaller", () => {
105107
hasZaiCodingPlan: false,
106108
hasKimiForCoding: false,
107109
hasOpencodeGo: false,
110+
hasVercelAiGateway: false,
108111
}),
109112
spyOn(configManager, "addPluginToOpenCodeConfig").mockResolvedValue({
110113
success: true,

src/cli/tui-installer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function runTuiInstaller(args: InstallArgs, version: string): Promi
7777
)
7878
}
7979

80-
if (!config.hasClaude && !config.hasOpenAI && !config.hasGemini && !config.hasCopilot && !config.hasOpencodeZen) {
80+
if (!config.hasClaude && !config.hasOpenAI && !config.hasGemini && !config.hasCopilot && !config.hasOpencodeZen && !config.hasVercelAiGateway) {
8181
p.log.warn("No model providers configured. Using opencode/big-pickle as fallback.")
8282
}
8383

0 commit comments

Comments
 (0)