Skip to content

[Bug] Fail to Load Agent Properly When Opening #384

@jollyxenon

Description

@jollyxenon

App Variant

Electron

Operating System & Version

Windows 11 24H2

Issue Summary

CodeNomad launches its own OpenCode server with a CodeNomad-specific OPENCODE_CONFIG_DIR, which prevents user-configured OpenCode plugins and agents from being loaded.

As a result, agents provided by user plugins such as oh-my-openagent are missing from the bottom-left agent selector. After merging the user OpenCode config, another issue appears: native agents such as build can be auto-selected and temporarily shown in the primary agent selector, even though they should not be selectable as primary agents.

Steps to Reproduce

Create a new instance and then enter a conversation.

Current Behavior

  1. CodeNomad starts OpenCode with its packaged config directory.
  2. User OpenCode config from ~/.config/opencode is not loaded.
  3. Plugin-provided primary agents such as Sisyphus and Hephaestus do not appear in the CodeNomad agent selector.
  4. When plugin agents are available, the selector may still auto-load build.
  5. build can appear in the selector because the current session agent is forced back into the list.

Expected Behavior

  1. CodeNomad should preserve its own bridge plugin while also loading the user's OpenCode config.
  2. User-configured OpenCode plugins should be available in CodeNomad-launched OpenCode instances.
  3. The primary agent selector should only include selectable primary agents.
  4. Native/internal agents such as build should not be auto-selected or shown in the primary selector.
  5. New sessions should default to a valid selectable primary agent.

Logs & Screenshots

Though we expect to see "Sisyphus" and other agents here, it only loaded default agents.
Image

Root Cause

There are two related issues:

  1. CodeNomad sets OPENCODE_CONFIG_DIR to its own bundled config directory, so user OpenCode plugins are isolated from the OpenCode process launched by CodeNomad.
  2. The UI treats any non-subagent agent as selectable. This allows native/internal agents to be used as default primary agents. The selector also force-adds the current agent back into the list, which can make invalid agents such as build appear temporarily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    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