Skip to content

[bug] [config-context] getConfigContext() called before initConfigContext() warning appears on every startup and obscures TUI #15357

@khhan0423

Description

@khhan0423

Description

Description

Every time opencode starts, the following warning is printed to stderr before
the TUI initializes, visually obscuring the input area:

[config-context] getConfigContext() called before initConfigContext(); defaulting to CLI paths.

This message appears consistently on every launch and cannot be suppressed without
redirecting stderr externally (e.g. opencode 2>/dev/null).

Steps to Reproduce

  1. Install opencode v1.2.15 with oh-my-opencode plugin
  2. Run opencode in any directory
  3. Observe the warning printed before TUI renders

Expected Behavior

Either:

  • initConfigContext() is called before any code that depends on it, or
  • The warning is suppressed / demoted to debug-level logging only

Actual Behavior

Warning is printed to stderr on every startup, overlapping with the TUI interface
and forcing users to scroll or wait for it to clear.

Environment

  • opencode version: v1.2.15
  • oh-my-opencode version: latest
  • OS: Debian (WSL2 on Windows)
  • Shell: bash

Workaround

alias opencode='opencode 2>/tmp/opencode-stderr.log'

This hides the warning but also swallows legitimate errors, which is not ideal.

Image

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions