You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
desktop: new sessions hardcode agent "build" and ignore default_agent #57704
The desktop app creates every new session with an explicit agent: "build" value, so default_agent from project config is never applied. A project whose default primary agent is a custom agent never gets it in desktop-created sessions.
Environment
opencode version: 2.0.32 (bug also present in earlier desktop versions)
OS: Windows_NT 10.0.26300 (win32 x64)
Terminal: Unavailable: running via desktop app (no terminal env vars)
In a project, set "default_agent": "my-agent" in opencode.jsonc and define .opencode/agents/my-agent.md with mode: primary.
Verify server-side: GET /api/config?location[directory]=<project> includes the config, and GET /api/agent?... returns my-agent with mode: "primary", hidden: false.
Create a session via the API with no agent field → session stores agent = NULL (default_agent path is available).
Create a new session from the desktop app UI.
Inspect the session (session_v2.agent in the DB): it is "build".
Expected Behavior
A new session with no explicit agent selection should use default_agent.
Actual Behavior
Desktop-created sessions store agent = "build" — the client passes the agent explicitly and bypasses default_agent. Every desktop session in this project got build; sessions created via opencode run --agent solution-architect correctly stored solution-architect.
Additional Context
Reproduces consistently across desktop versions (observed on 2.0.31 and 2.0.32).
Server-side config/agent discovery verified correct via API; the override happens at session creation in the client.
Workaround used: a project file .opencode/agents/build.md redefines the built-in build agent with the desired persona so the hardcoded stamp still lands on the intended behavior.
Thanks for the clear report and the workaround. I think this is a duplicate of #55535: on desktop, new sessions start on build and ignore the configured default_agent. The app never reads default_agent when it picks the agent for a new session. If the agent picker is hidden (Settings → Show agent off), it falls back to build. That's why your sessions are stored with agent = "build". The open PR #55615 would make new sessions use the configured default agent instead.
Possible duplicates and related issues, ordered from most to least likely:
Activity
opencode-agent commentedon Oct 21, 2026
Thanks for the clear report and the workaround. I think this is a duplicate of #55535: on desktop, new sessions start on
buildand ignore the configureddefault_agent. The app never readsdefault_agentwhen it picks the agent for a new session. If the agent picker is hidden (Settings → Show agent off), it falls back tobuild. That's why your sessions are stored withagent = "build". The open PR #55615 would make new sessions use the configured default agent instead.Possible duplicates and related issues, ordered from most to least likely:
buildfallback (closed as a duplicate of desktop: cannot select or default an agent (no picker, default_agent ignored) #53944). PR fix(app): honor configured default agent #55615 targets it.default_agentand custom primary agent setup.default_agent(and the rootmodel) while CLI sessions honour them.In the meantime, you can also turn on Settings → Show agent and pick your agent manually, besides overriding
build.mdas you did.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.