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 ignore default_agent and root model #54006
Sessions created by the Desktop app ignore the configured default_agent and root model, opening as build with a carried-over model instead. Sessions created by the CLI resolve both correctly from the identical config. This matters because agent-specific permission rules (including subagent approval gates) belong to the configured default agent, so they are silently not applied in Desktop windows.
Environment
opencode version: 2.0.25
OS: Windows_NT 10.0.19045 (win32 x64)
Terminal: Unavailable: OpenCode Desktop app (Electron); terminal environment variables are not set in this context
Shell: C:\Windows\system32\cmd.exe (diagnostics run via Windows PowerShell 5.1)
Install/channel: latest (OpenCode Desktop app with bundled CLI v2.0.25)
From the Desktop app, open a new window / start a new session.
Inspect the resulting session via GET /api/session.
Repeat from a terminal with a bare opencode run "Reply: OK" (no --model) in the same project.
Expected Behavior
Newly created sessions use default_agent (coordinator) and the root model (openai/gpt-6-sol), regardless of whether they were created by the Desktop app or the CLI.
Actual Behavior
CLI resolves both correctly:
$ opencode run "Reply with exactly: DEFAULT_OK"
> coordinator · gpt-6-sol
DEFAULT_OK
Desktop-created sessions do not. Root sessions (parentID null), newest first:
Created (local)
agent
model
Source
13:54:26
build
openai/gpt-6-sol
Desktop window
13:52:02
build
opencode/mimo-v2.6-flash-free
Desktop window
13:12:58
(null)
openai/gpt-6-sol
CLI opencode run
12:30:43
build
opencode/mimo-v2.6-flash-free
Desktop session
11:57:04
build
openai/gpt-6-sol
Desktop window
Two distinct deviations:
Agent: every Desktop-created session carries an explicit agent: "build", overriding default_agent. The CLI-created session correctly leaves it unset and resolves to coordinator.
Model: the Desktop model is inconsistent (mimo-v2.6-flash-free vs gpt-6-sol across sessions created minutes apart under identical config) rather than tracking the configured root model.
A session created directly through POST /api/session with no agent/model fields returns both as empty, suggesting the Desktop client is supplying them explicitly rather than leaving them to be resolved.
Additional Context
Impact. While running as build, the configured agent's permission rules are not applied. In this config the coordinator rules include edit: deny, shell: deny, and a subagent deny-* with explicit allow/ask exceptions — notably specialist → ask, which is a deliberate cost gate. Under build's default permissive policy those gates are bypassed.
Frequency. Reproduced consistently on every Desktop-created session observed (5 of 5 root sessions with an explicit agent).
Workaround tried. Running /agents → coordinator and /models → openai/gpt-6-sol in each new window. Works, but must be repeated per session. Using the CLI instead also works, but loses the Desktop UI.
Related.GET /api/agent confirms all four custom agents register correctly with the right models and permission rules, and GET /api/config confirms default_agent is present — so config parsing and agent registration appear unaffected. The deviation happens only at Desktop session-creation time.
Thanks for the detailed report, especially the session table and the note on permission rules. I think this is a duplicate of #53944, which reported the same thing on Desktop 2.0.25 / Windows: new sessions start on build and ignore default_agent, while the CLI/TUI picks it up. That issue was closed as a duplicate of #50269.
On the current v2 code, when the app has no agent selected it falls back to build and never reads default_agent. The model you saw likely follows from that. build has no model of its own, so the app uses the model from the previous draft or your recent models instead of coordinator's openai/gpt-6-sol.
Possible duplicates and related issues, ordered from most to least likely:
Until this is fixed, turning on Settings → General → Show agent should at least bring back the agent picker in the composer. I haven't checked whether new sessions then start on your default agent.
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. For example, if the model problem also happens when the agent is set correctly, that would be a separate issue.
Closing this as a duplicate of #53944. It's been a day since the duplicate note, and no reply has said how this is different. Desktop 2.0.25 starting new sessions on build instead of default_agent is tracked there and in #50269. Your note that this skips coordinator's permission rules, including the specialist → ask approval check, is useful context for that work.
If the model part still happens once the right agent is selected, please open a new issue for it. #38333 covers new tabs that keep the previous tab's model. You can also reply here if you think this should stay open.
Activity
opencode-agent commentedon Oct 8, 2026
Thanks for the detailed report, especially the session table and the note on permission rules. I think this is a duplicate of #53944, which reported the same thing on Desktop 2.0.25 / Windows: new sessions start on
buildand ignoredefault_agent, while the CLI/TUI picks it up. That issue was closed as a duplicate of #50269.On the current
v2code, when the app has no agent selected it falls back tobuildand never readsdefault_agent. The model you saw likely follows from that.buildhas no model of its own, so the app uses the model from the previous draft or your recent models instead ofcoordinator'sopenai/gpt-6-sol.Possible duplicates and related issues, ordered from most to least likely:
default_agent, starts new sessions onbuildand has no agent picker. Same symptom; reproduced on 2.0.25 and latestv2.default_agentignored on startup in the v2 TUI.Until this is fixed, turning on Settings → General → Show agent should at least bring back the agent picker in the composer. I haven't checked whether new sessions then start on your default agent.
The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. For example, if the model problem also happens when the agent is set correctly, that would be a separate issue.
opencode-agent commentedon Oct 9, 2026
Closing this as a duplicate of #53944. It's been a day since the duplicate note, and no reply has said how this is different. Desktop 2.0.25 starting new sessions on
buildinstead ofdefault_agentis tracked there and in #50269. Your note that this skipscoordinator's permission rules, including thespecialist → askapproval check, is useful context for that work.If the model part still happens once the right agent is selected, please open a new issue for it. #38333 covers new tabs that keep the previous tab's model. You can also reply here if you think this should stay open.