Repository navigation
Description
Summary
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) - Active plugins: None found in config
Reproduction
- Create
~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"default_agent": "coordinator",
"model": "openai/gpt-6-sol",
"agents": {
"coordinator": {
"mode": "primary",
"model": "openai/gpt-6-sol",
"system": "...",
"permissions": [
{ "action": "edit", "resource": "*", "effect": "deny" },
{ "action": "shell", "resource": "*", "effect": "deny" },
{ "action": "subagent", "resource": "*", "effect": "deny" },
{ "action": "subagent", "resource": "specialist", "effect": "ask" }
]
},
"assistant": { "mode": "subagent", "model": "opencode/mimo-v2.6-flash-free" },
"maker": { "mode": "subagent", "model": "openai/gpt-6.1-sol" },
"specialist": { "mode": "subagent", "model": "openai/gpt-6-astra" }
}
}- Verify via API that the config loaded correctly:
GET /api/config
-> "default_agent": "coordinator"
-> "model": { "providerID": "openai", "model": "gpt-6-sol" }
- 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", overridingdefault_agent. The CLI-created session correctly leaves it unset and resolves tocoordinator. - Model: the Desktop model is inconsistent (
mimo-v2.6-flash-freevsgpt-6-solacross sessions created minutes apart under identical config) rather than tracking the configured rootmodel.
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.
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.