fix: use getOpenCodeConfigDir in bun-install to avoid startup warning#2355
fix: use getOpenCodeConfigDir in bun-install to avoid startup warning#2355kristianvast wants to merge 4 commits intocode-yeongyu:devfrom
Conversation
# Conflicts: # bun.lock
…warning bun-install.ts is used by both the installer (where initConfigContext is called) and the auto-update hook (where it is not). Using getConfigDir from config-context causes a console.warn on every startup because the hook path never calls initConfigContext. Switch to getOpenCodeConfigDir from shared which resolves paths directly without requiring prior initialization.
|
Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA). To sign the CLA, please comment on this PR with: This is a one-time requirement. Once signed, all your future contributions will be automatically accepted. I have read the CLA Document and I hereby sign the CLA Kristian Vastveit seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
There was a problem hiding this comment.
4 issues found across 6 files
Confidence score: 2/5
- There is a high-confidence compatibility regression in
src/cli/config-manager/bun-install.ts: hardcodingbinary: "opencode"is likely to break OpenCode Desktop installation behavior by forcing installs into the CLI directory. src/cli/model-fallback-requirements.tsincludes an unexpected model bump (gpt-5.2→gpt-5.3-codex) outside the stated fix scope, which raises regression risk for fallback behavior and makes the change harder to validate safely.- Provider mappings for
gpt-5.3-codexappear inconsistent in bothsrc/shared/model-requirements.tsandsrc/cli/model-fallback-requirements.ts(notablygithub-copilot), and while some related entries may be pre-existing, these touched inconsistencies still increase merge risk. - Pay close attention to
src/cli/config-manager/bun-install.ts,src/cli/model-fallback-requirements.ts, andsrc/shared/model-requirements.ts- installation compatibility and provider/model mapping consistency need verification before merge.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/shared/model-requirements.ts">
<violation number="1" location="src/shared/model-requirements.ts:33">
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.</violation>
</file>
<file name="src/cli/model-fallback-requirements.ts">
<violation number="1" location="src/cli/model-fallback-requirements.ts:26">
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.</violation>
<violation number="2" location="src/cli/model-fallback-requirements.ts:26">
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.</violation>
</file>
<file name="src/cli/config-manager/bun-install.ts">
<violation number="1" location="src/cli/config-manager/bun-install.ts:20">
P1: Custom agent: **Opencode Compatibility**
Hardcoding `binary: "opencode"` breaks OpenCode Desktop compatibility by forcing installations into the CLI directory.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| 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" }, |
There was a problem hiding this comment.
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>
| try { | ||
| const proc = Bun.spawn(["bun", "install"], { | ||
| cwd: getConfigDir(), | ||
| cwd: getOpenCodeConfigDir({ binary: "opencode" }), |
There was a problem hiding this comment.
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>
| @@ -23,7 +23,7 @@ export const CLI_AGENT_MODEL_REQUIREMENTS: Record<string, ModelRequirement> = { | |||
| }, | |||
There was a problem hiding this comment.
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>
| 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" }, |
There was a problem hiding this comment.
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>
Summary
bun-install.tsusedgetConfigDir()fromconfig-context.ts, which requiresinitConfigContext()to be called first. The auto-update checker hook callsrunBunInstall()on startup, but hooks never go through the installer path whereinitConfigContext()is called — causing aconsole.warnon every startup for all users.getOpenCodeConfigDir()fromshared/which resolves config paths directly without requiring prior initialization.[config-context] getConfigContext() called before initConfigContext(); defaulting to CLI paths.warning visible in the TUI on every launch.Root Cause
bun-install.tslives incli/config-manager/(installer module) but is also imported by the auto-update checker hook viabackground-update-check.ts. The installer path callsinitConfigContext()before any config access, but the hook path does not — triggering the fallback warning ingetConfigContext().The
NODE_ENV !== "production"guard was intended to suppress this in production, but Bun's bundler doesn't setNODE_ENV=production, so the warning fires for everyone.Summary by cubic
Fixes the startup console warning by switching bun-install to getOpenCodeConfigDir, and updates model fallbacks/migrations to prefer OpenAI gpt-5.3-codex. This removes the TUI warning on launch and keeps configs/tests aligned with the new default.
Bug Fixes
Refactors
Written for commit 9c52ac8. Summary will update on new commits.