Skip to content

OPENCODE_FAST_BOOT breaks using a custom agent by passing --agent. #23305

@CarloWood

Description

@CarloWood

Description

opencode shows "Agent not found: analyst" toast when started.
For me, this started happening since commit 65b2a10
See discussion on discord from https://discord.com/channels/1391832426048651334/1394667004979445931/1495067303329529887

But later I found that this bug already existed before that commit, if one sets OPENCODE_FAST_BOOT=1.
The commit that revealed it (to me) namely has this hunk:

--- a/packages/opencode/src/cli/cmd/tui/context/sync.tsx
+++ b/packages/opencode/src/cli/cmd/tui/context/sync.tsx
@@ -467,6 +467,7 @@ export const { use: useSync, provider: SyncProvider } = createSimpleContext({
         return store.status
       },
       get ready() {
+        return true
         if (process.env.OPENCODE_FAST_BOOT) return true
         return store.status !== "loading"
       },

make OPENCODE_FAST_BOOT the default.

Plugins

none (pure)

OpenCode version

Latest dev branch

Steps to reproduce

I use the following opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "default_agent": "coder",
  "permission": {    
[...]
  },
  "agent": {
    "build": {
      "disable": true
    },
    "plan": {
      "disable": true
    },
    "docs": {
      "disable": true
    },
    "analyst": {
      "description": "Pre-planning agent that can read PLANROOT and REPOROOT, do web searches.",
      "mode": "primary",
[...]

In other words, I have a 'custom' agent defined called "analyst".

I then run (in the opencode repository root):

bun run --cwd packages/opencode --conditions=browser src/index.ts "/opt/ext4/nvme2/codex/workspace/opencode" --session "ses_25f6ba204ffe01YkneCygYXnjD" --agent analyst

but all that matters here is passing that --agent analyst ;)

Apparently OPENCODE_FAST_BOOT causes a check that this agent is valid before the configuration file opencode.json is loaded; which is a little too fast.

Screenshot and/or share link

Image

Operating System

Linux daniel 6.19.11-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 02 Apr 2026 23:33:01 +0000 x86_64 GNU/Linux

Terminal

konsole 25.12.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions