desktop: hidden agent picker overrides configured default_agent with Build · Issue #55535 · anomalyco/opencode · GitHub
Skip to content

desktop: hidden agent picker overrides configured default_agent with Build #55535

Closed as duplicate

Description

@parteekmalik

Description

OpenCode Desktop 2.0.29 uses Build instead of my configured custom primary agent when the composer’s agent picker is hidden.

My global configuration contains:

{
  "default_agent": "agent"
}

The running V2 server lists agent as a visible primary agent, but the native app uses Build. Enabling Settings → Preferences → Show agent allows manual selection.

Expected: a new session without an explicit agent choice should use the configured default_agent, regardless of whether the picker is visible. Existing sessions should retain their previously selected agent.

Source evidence in v2.0.29:
https://github.com/anomalyco/opencode/blob/042d0832f5f3a73eaa039a58a7d565776f6d4290/packages/app/src/providers/models/selection.tsx

The GUI initializes its selection from the first agent in the list and resolves the active agent using:

pickAgent(scope()?.agent ?? durable()?.agent ?? (agentsVisible() ? store.current : "build"))

This explicitly falls back to Build when the picker is hidden rather than honoring default_agent.

The setting’s description also states: “Switch between agents in the composer. When hidden, defaults to Build agent.”
https://github.com/anomalyco/opencode/blob/v2.0.29/packages/app/src/runtime/i18n/en.ts

Related: #50269 concerns automatic picker visibility. This report concerns picker visibility changing the selected default agent.

Workaround: enable Show agent and select the intended agent manually.

Plugins

No response

OpenCode version

Native desktop app: 2.0.29 Connected V2 server: 2.0.29 Separately installed Homebrew CLI: 2.0.27

Steps to reproduce

Suggested minimal reproduction based on the observed behavior and release source; not independently tested in a clean environment:

  1. Configure a custom primary agent as the default:

    {
      "$schema": "https://opencode.ai/config.json",
      "default_agent": "agent",
      "agents": {
        "agent": {
          "mode": "primary",
          "system": "You are the configured primary agent."
        }
      }
    }
  2. Load the configuration and open the native desktop app connected to the V2 server.

  3. Leave Settings → Preferences → Show agent disabled.

  4. Create a new session without explicitly selecting an agent.

  5. Send a prompt and inspect which agent runs.

  6. Compare with enabling Show agent and manually selecting agent.

Expected: the new session uses agent.
Observed in my setup: the native app uses Build instead.

Screenshot and/or share link

No response

Operating System

macOS 27.0 (build 26A428), Apple silicon / arm64

Terminal

N/A — native Electron desktop app. Diagnostic shell: /bin/zsh.

Activity

  1. opencode-agent commented on Oct 14, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and for pointing to the exact source lines. I think this is a duplicate of #53944, which reported the same thing on Desktop 2.0.25: new sessions start on build and ignore the configured default_agent, while the CLI/TUI uses it correctly. That issue was closed in favour of #50269, which is still open.

    Possible duplicates and related issues, ordered from most to least likely:

    You're right that this is more than picker visibility. On current dev, the app never reads default_agent. When the picker is hidden it falls back to build, and when it's shown it starts on the first agent in the list. I've noted this so that fixing #50269 also covers using default_agent for new sessions. Until then, your workaround (turn on Show agent and pick the agent manually) is the way to go.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. Dante-dan commented on Oct 15, 2026

    @Dante-dan
    Contributor

    I traced the new-session fallback on dev: it never reads default_agent, and hiding the picker forces build. I’ll fix the default selection independently of the picker-visibility work in #50269, preserving explicit choices and existing sessions. The configured agent will still be validated against visible primary agents, with the existing fallback when unavailable.

  3. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    Contributor

    Closing this as a duplicate of #53944. It's been a day since the duplicate note and there's been no reply saying how this is different. That issue covers the same problem: the desktop app ignores default_agent and starts new sessions on build. It was closed in favour of #50269, which is still open.

    You showed that the app never reads default_agent: it falls back to build when the picker is hidden, and to the first agent in the list when it's shown. That's useful context for #50269, since fixing picker visibility alone wouldn't solve it. Until it's fixed, turn on Settings → Preferences → Show agent and pick your agent manually.

    If you think this should stay open, reply here.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions