Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cli/config-manager/bun-install.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getConfigDir } from "./config-context"
import { getOpenCodeConfigDir } from "../../shared"

const BUN_INSTALL_TIMEOUT_SECONDS = 60
const BUN_INSTALL_TIMEOUT_MS = BUN_INSTALL_TIMEOUT_SECONDS * 1000
Expand All @@ -17,7 +17,7 @@ export async function runBunInstall(): Promise<boolean> {
export async function runBunInstallWithDetails(): Promise<BunInstallResult> {
try {
const proc = Bun.spawn(["bun", "install"], {
cwd: getConfigDir(),
cwd: getOpenCodeConfigDir({ binary: "opencode" }),
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Custom agent: Opencode Compatibility

Hardcoding binary: "opencode" breaks OpenCode Desktop compatibility by forcing installations into the CLI directory.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/cli/config-manager/bun-install.ts, line 20:

<comment>Hardcoding `binary: "opencode"` breaks OpenCode Desktop compatibility by forcing installations into the CLI directory.</comment>

<file context>
@@ -17,7 +17,7 @@ export async function runBunInstall(): Promise<boolean> {
   try {
     const proc = Bun.spawn(["bun", "install"], {
-      cwd: getConfigDir(),
+      cwd: getOpenCodeConfigDir({ binary: "opencode" }),
       stdout: "inherit",
       stderr: "inherit",
</file context>
Fix with Cubic

stdout: "inherit",
stderr: "inherit",
})
Expand All @@ -39,7 +39,7 @@ export async function runBunInstallWithDetails(): Promise<BunInstallResult> {
return {
success: false,
timedOut: true,
error: `bun install timed out after ${BUN_INSTALL_TIMEOUT_SECONDS} seconds. Try running manually: cd ${getConfigDir()} && bun i`,
error: `bun install timed out after ${BUN_INSTALL_TIMEOUT_SECONDS} seconds. Try running manually: cd ${getOpenCodeConfigDir({ binary: "opencode" })} && bun i`,
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/cli/model-fallback-requirements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
},
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Custom agent: Opencode Compatibility

The PR description indicates a fix for bun-install.ts, but the diff unexpectedly modifies model-fallback-requirements.ts to bump gpt-5.2 to gpt-5.3-codex across multiple agents. Furthermore, upstream OpenCode issues (#12570, #15164, #14105) show gpt-5.3-codex currently has severe instability (terminating early during subagent calls, leaking tool-call text). Revert these accidental changes and include the intended bun-install.ts fix.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/cli/model-fallback-requirements.ts, line 26:

<comment>The PR description indicates a fix for `bun-install.ts`, but the diff unexpectedly modifies `model-fallback-requirements.ts` to bump `gpt-5.2` to `gpt-5.3-codex` across multiple agents. Furthermore, upstream OpenCode issues (#12570, #15164, #14105) show `gpt-5.3-codex` currently has severe instability (terminating early during subagent calls, leaking tool-call text). Revert these accidental changes and include the intended `bun-install.ts` fix.</comment>

<file context>
@@ -23,7 +23,7 @@ export const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
   oracle: {
     fallbackChain: [
-      { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
+      { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
       { providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
       { providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
</file context>
Fix with Cubic

oracle: {
fallbackChain: [
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Inconsistent provider configuration: github-copilot is included in the providers array with gpt-5.3-codex model, but other pre-existing configurations in this file (hephaestus, deep, ultrabrain, unspecified-low) explicitly exclude github-copilot when using the same model. This inconsistency may cause routing failures when the system attempts to use github-copilot for gpt-5.3-codex requests.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/cli/model-fallback-requirements.ts, line 26:

<comment>Inconsistent provider configuration: `github-copilot` is included in the providers array with `gpt-5.3-codex` model, but other pre-existing configurations in this file (`hephaestus`, `deep`, `ultrabrain`, `unspecified-low`) explicitly exclude `github-copilot` when using the same model. This inconsistency may cause routing failures when the system attempts to use github-copilot for gpt-5.3-codex requests.</comment>

<file context>
@@ -23,7 +23,7 @@ export const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
   oracle: {
     fallbackChain: [
-      { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
+      { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
       { providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
       { providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
</file context>
Fix with Cubic

{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
],
Expand All @@ -45,7 +45,7 @@ export const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
"multimodal-looker": {
fallbackChain: [
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-flash" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex" },
{ providers: ["zai-coding-plan"], model: "glm-4.6v" },
{ providers: ["kimi-for-coding"], model: "k2p5" },
{ providers: ["opencode"], model: "kimi-k2.5-free" },
Expand All @@ -58,7 +58,7 @@ export const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["kimi-for-coding"], model: "k2p5" },
{ providers: ["opencode"], model: "kimi-k2.5-free" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro" },
],
},
Expand All @@ -67,13 +67,13 @@ export const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["kimi-for-coding"], model: "k2p5" },
{ providers: ["opencode"], model: "kimi-k2.5-free" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
],
},
momus: {
fallbackChain: [
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "medium" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "medium" },
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
],
Expand All @@ -83,7 +83,7 @@ export const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
{ providers: ["kimi-for-coding"], model: "k2p5" },
{ providers: ["opencode"], model: "kimi-k2.5-free" },
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-5" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro" },
],
},
Expand Down Expand Up @@ -117,7 +117,7 @@ export const CLI_CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement> =
fallbackChain: [
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex" },
],
requiresModel: "gemini-3-pro",
},
Expand All @@ -138,7 +138,7 @@ export const CLI_CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement> =
"unspecified-high": {
fallbackChain: [
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro" },
],
},
Expand Down
24 changes: 23 additions & 1 deletion src/shared/migration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,13 @@ describe("MODEL_VERSION_MAP", () => {
// then: Should contain correct mapping
expect(MODEL_VERSION_MAP["anthropic/claude-opus-4-5"]).toBe("anthropic/claude-opus-4-6")
})
})

test("maps openai/gpt-5.3 to openai/gpt-5.3-codex", () => {
// given/when: Check MODEL_VERSION_MAP
// then: bare gpt-5.3 should migrate to gpt-5.3-codex
expect(MODEL_VERSION_MAP["openai/gpt-5.3"]).toBe("openai/gpt-5.3-codex")
})
}

describe("migrateModelVersions", () => {
test("#given a config with gpt-5.2-codex model #when migrating model versions #then does not overwrite with non-existent gpt-5.3-codex", () => {
Expand Down Expand Up @@ -559,6 +565,22 @@ describe("migrateModelVersions", () => {
expect(prometheus.model).toBe("anthropic/claude-opus-4-6")
})


test("replaces bare openai/gpt-5.3 with openai/gpt-5.3-codex", () => {
// given: Agent config with bare gpt-5.3 (non-codex)
const agents = {
momus: { model: "openai/gpt-5.3", variant: "medium" },
}

// when: Migrate model versions
const { migrated, changed } = migrateModelVersions(agents)

// then: Model should be updated to codex variant
expect(changed).toBe(true)
const momus = migrated["momus"] as Record<string, unknown>
expect(momus.model).toBe("openai/gpt-5.3-codex")
expect(momus.variant).toBe("medium")
})
test("leaves unknown model strings untouched", () => {
// given: Agent config with unknown model
const agents = {
Expand Down
1 change: 1 addition & 0 deletions src/shared/migration/model-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
export const MODEL_VERSION_MAP: Record<string, string> = {
"anthropic/claude-opus-4-5": "anthropic/claude-opus-4-6",
"anthropic/claude-sonnet-4-5": "anthropic/claude-sonnet-4-6",
"openai/gpt-5.3": "openai/gpt-5.3-codex",
}

function migrationKey(oldModel: string, newModel: string): string {
Expand Down
12 changes: 6 additions & 6 deletions src/shared/model-requirements.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import {
} from "./model-requirements"

describe("AGENT_MODEL_REQUIREMENTS", () => {
test("oracle has valid fallbackChain with gpt-5.2 as primary", () => {
test("oracle has valid fallbackChain with gpt-5.3-codex as primary", () => {
// given - oracle agent requirement
const oracle = AGENT_MODEL_REQUIREMENTS["oracle"]

// when - accessing oracle requirement
// then - fallbackChain exists with gpt-5.2 as first entry
// then - fallbackChain exists with gpt-5.3-codex as first entry
expect(oracle).toBeDefined()
expect(oracle.fallbackChain).toBeArray()
expect(oracle.fallbackChain.length).toBeGreaterThan(0)

const primary = oracle.fallbackChain[0]
expect(primary.providers).toContain("openai")
expect(primary.model).toBe("gpt-5.2")
expect(primary.model).toBe("gpt-5.3-codex")
expect(primary.variant).toBe("high")
})

Expand Down Expand Up @@ -137,18 +137,18 @@ describe("AGENT_MODEL_REQUIREMENTS", () => {
expect(primary.variant).toBe("max")
})

test("momus has valid fallbackChain with gpt-5.2 as primary", () => {
test("momus has valid fallbackChain with gpt-5.3-codex as primary", () => {
// given - momus agent requirement
const momus = AGENT_MODEL_REQUIREMENTS["momus"]

// when - accessing Momus requirement
// then - fallbackChain exists with gpt-5.2 as first entry, variant medium
// then - fallbackChain exists with gpt-5.3-codex as first entry, variant medium
expect(momus).toBeDefined()
expect(momus.fallbackChain).toBeArray()
expect(momus.fallbackChain.length).toBeGreaterThan(0)

const primary = momus.fallbackChain[0]
expect(primary.model).toBe("gpt-5.2")
expect(primary.model).toBe("gpt-5.3-codex")
expect(primary.variant).toBe("medium")
expect(primary.providers[0]).toBe("openai")
})
Expand Down
16 changes: 8 additions & 8 deletions src/shared/model-requirements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
},
oracle: {
fallbackChain: [
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
Copy link

@cubic-dev-ai cubic-dev-ai bot Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The provider list for gpt-5.3-codex incorrectly includes github-copilot, contradicting existing model configurations and the project's test suite (model-requirements.test.ts). Pre-existing entries using gpt-5.3-codex (hephaestus, ultrabrain, deep, unspecified-low) strictly use ["openai", "opencode"] providers. Including github-copilot will cause routing errors and test failures.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/shared/model-requirements.ts, line 33:

<comment>The provider list for gpt-5.3-codex incorrectly includes github-copilot, contradicting existing model configurations and the project's test suite (model-requirements.test.ts). Pre-existing entries using gpt-5.3-codex (hephaestus, ultrabrain, deep, unspecified-low) strictly use ["openai", "opencode"] providers. Including github-copilot will cause routing errors and test failures.</comment>

<file context>
@@ -30,7 +30,7 @@ export const AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
   oracle: {
     fallbackChain: [
-      { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
+      { providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
       { providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
       { providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
</file context>
Fix with Cubic

{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
],
Expand All @@ -54,15 +54,15 @@ export const AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
fallbackChain: [
{ providers: ["opencode"], model: "kimi-k2.5-free" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-flash" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex" },
{ providers: ["zai-coding-plan"], model: "glm-4.6v" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5-nano" },
],
},
prometheus: {
fallbackChain: [
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
{ providers: ["opencode"], model: "kimi-k2.5-free" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro" },
],
Expand All @@ -71,13 +71,13 @@ export const AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
fallbackChain: [
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["opencode"], model: "kimi-k2.5-free" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
],
},
momus: {
fallbackChain: [
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "medium" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "medium" },
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
],
Expand All @@ -86,7 +86,7 @@ export const AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
fallbackChain: [
{ providers: ["opencode"], model: "kimi-k2.5-free" },
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-sonnet-4-6" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex" },
],
},
}
Expand Down Expand Up @@ -118,7 +118,7 @@ export const CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
fallbackChain: [
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro", variant: "high" },
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex" },
],
requiresModel: "gemini-3-pro",
},
Expand All @@ -139,7 +139,7 @@ export const CATEGORY_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = {
"unspecified-high": {
fallbackChain: [
{ providers: ["anthropic", "github-copilot", "opencode"], model: "claude-opus-4-6", variant: "max" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.2", variant: "high" },
{ providers: ["openai", "github-copilot", "opencode"], model: "gpt-5.3-codex", variant: "high" },
{ providers: ["google", "github-copilot", "opencode"], model: "gemini-3-pro" },
],
},
Expand Down
Loading