Skip to content

desktop: cannot select or default an agent (no picker, default_agent ignored) #53944

Closed

Description

@rore

Description

Summary

On the OpenCode desktop app (2.0.25, Windows), there is no way to select or default a primary agent. New sessions always start on build, default_agent is ignored, and no agent picker is available. The terminal client on the same machine, server, and config works correctly, so this is isolated to the desktop client.

Environment

  • opencode version: desktop app 2.0.25.0; CLI + background service 2.0.25
  • OS: Windows 10.0.26200.9448 (win32 x64)
  • Client: OpenCode desktop app (OPENCODE_CLIENT=desktop)
  • Install/channel: latest

Reproduction

  1. Open a project that defines a custom primary agent and sets default_agent (project opencode.jsonc with "default_agent": "myagent" plus .opencode/agent/myagent.md, mode: primary).
  2. In the desktop app, open a new session in that project.
  3. The session starts on build, not myagent.
  4. Try to switch agents: no selector in the toolbar; Ctrl+P has no "List agents"; Shift+Tab only moves focus.

Expected

New sessions honor default_agent, and an agent picker is available to switch primary agents.

Actual

New sessions always start on build. default_agent is ignored (project and global config). There is no UI to change the agent.

Additional Context

  • The terminal client (opencode 2.0.25), same server and config, works: it honors default_agent and offers the agent picker (<leader>a / Shift+Tab).
  • GET /api/agent lists the custom agent as a visible primary alongside Build, Plan, scout.
  • A session created via POST /api/session has an empty agent field — the default is applied client-side, and the desktop client doesn't apply it.
  • Server and desktop UI are both 2.0.25 (no version skew).

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

Activity

  1. rore commented on Oct 8, 2026

    @rore
    Author

    Looks like a duplicate of - #50269 - closing.

  2. opencode-agent commented on Oct 8, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report. I reproduced this with the web UI from opencode serve, which is built from the same client code as the desktop app (packages/app), on 2.0.25 and on the latest v2 (0621ea9d9).

    Setup: a project with "default_agent": "myagent" in opencode.jsonc and .opencode/agent/myagent.md (mode: primary).

    • The TUI starts on Myagent, as you described.
    • GET /api/agent lists myagent as a visible primary agent, and POST /api/session creates a session with no agent.
    • In the app, the composer has no agent control, and Ctrl+P has no agent entry.
    • Sending a message runs it as Build, and the session is saved with agent: build.

    From the code, there seem to be two causes:

    1. The picker only shows when Settings → General → Show agent is on, or when the app detects a custom agent. That detection relies on a native field the v2 API doesn't return, so it never finds one. This part is the same as app: project-local custom agents never make the composer agent picker visible (native flag missing from public Agent.Info) #50269.
    2. When the picker is hidden, the app falls back to build, and it never reads default_agent.

    Turning on Show agent should at least bring the picker back. I haven't checked whether that also makes new sessions start on your default agent.

    Related: #50269 (hidden picker), #37225 (default_agent ignored in the v2 TUI), #45873 (same symptom in the v1 web UI).

  3. 2362 commented on Oct 15, 2026

    @2362

    still reproduces on desktop 2.0.29 (Windows)

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions