Skip to content

fix: use getOpenCodeConfigDir in bun-install to avoid startup warning#2355

Open
kristianvast wants to merge 4 commits intocode-yeongyu:devfrom
kristianvast:fix/bun-install-config-context-warning
Open

fix: use getOpenCodeConfigDir in bun-install to avoid startup warning#2355
kristianvast wants to merge 4 commits intocode-yeongyu:devfrom
kristianvast:fix/bun-install-config-context-warning

Conversation

@kristianvast
Copy link

@kristianvast kristianvast commented Mar 7, 2026

Summary

  • Fix: bun-install.ts used getConfigDir() from config-context.ts, which requires initConfigContext() to be called first. The auto-update checker hook calls runBunInstall() on startup, but hooks never go through the installer path where initConfigContext() is called — causing a console.warn on every startup for all users.
  • Change: Switch to getOpenCodeConfigDir() from shared/ which resolves config paths directly without requiring prior initialization.
  • Impact: Removes the [config-context] getConfigContext() called before initConfigContext(); defaulting to CLI paths. warning visible in the TUI on every launch.

Root Cause

bun-install.ts lives in cli/config-manager/ (installer module) but is also imported by the auto-update checker hook via background-update-check.ts. The installer path calls initConfigContext() before any config access, but the hook path does not — triggering the fallback warning in getConfigContext().

The NODE_ENV !== "production" guard was intended to suppress this in production, but Bun's bundler doesn't set NODE_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

    • Use getOpenCodeConfigDir({ binary: "opencode" }) in bun-install to avoid config-context init in the auto-update hook path.
    • Adjust timeout message to reference the correct config directory.
  • Refactors

    • Update agent/category fallback chains from gpt-5.2 to gpt-5.3-codex.
    • Add migration map openai/gpt-5.3 → openai/gpt-5.3-codex and update tests accordingly.

Written for commit 9c52ac8. Summary will update on new commits.

Kristian Vastveit added 4 commits February 22, 2026 13:49
…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.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 7, 2026

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:

I have read the CLA Document and I hereby sign the CLA

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.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

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: hardcoding binary: "opencode" is likely to break OpenCode Desktop installation behavior by forcing installs into the CLI directory.
  • src/cli/model-fallback-requirements.ts includes an unexpected model bump (gpt-5.2gpt-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-codex appear inconsistent in both src/shared/model-requirements.ts and src/cli/model-fallback-requirements.ts (notably github-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, and src/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" },
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

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

@@ -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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant