Skip to content

Subagent dispatch fails with session ID validation error: must start with "ses" #21745

Closed as not planned

Description

@excodezz

Bug Description

When dispatching subagent mode agents (via parallel task dispatch), OpenCode fails with a session ID validation error:

```json
[
{
"origin": "string",
"code": "invalid_format",
"format": "starts_with",
"prefix": "ses",
"path": [],
"message": "Invalid string: must start with \"ses\""
}
]
```

This happens every time a `subagent` mode agent is invoked. Primary agents work fine.

Steps to Reproduce

  1. Create an agent config with `mode: "subagent"` in `~/.config/opencode/agents/`:
    ```yaml

description: "Parallel diagnostics subagent"
mode: "subagent"

```
2. Reference it in `config.json` under `agent.cluster-debugger`
3. Trigger the agent from the TUI
4. Observe the validation error — the subagent never spawns

Expected Behavior

Subagents should spawn and execute tasks in parallel.

Actual Behavior

Session ID validation fails before subagent creation. The error comes from Zod schema validation expecting a string prefixed with `ses`, but the session ID appears to be empty or malformed at dispatch time.

Environment

  • OpenCode version: 1.4.1
  • OS: macOS (darwin, Apple Silicon)
  • Node version: (bundled with OpenCode)
  • Shell: zsh

Additional Context

  • This affects ALL subagent mode agents, not just one specific config
  • Primary agents (`mode: "primary"`) work without issue
  • The error format matches Zod validation (`code: "invalid_format"`, `format: "starts_with"`)
  • Subagents are never created, so built-in TUI subagent navigation (`Ctrl+X ↓`) has nothing to show
  • No relevant plugins installed — only `@opencode-ai/plugin` core

This appears to be a regression in the session ID generation/dispatch pipeline for subagents.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 9, 2026
  2. humb1t commented on Apr 15, 2026

    @humb1t

    also face this issues on new versions of opencode 1.4.1 at the moment

  3. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions