Skip to content

SSE events not emitted when using opencode attach --dir #11522

@tcrapts

Description

@tcrapts

Description

When using opencode attach with the --dir flag to connect to a remote server, the server does not emit session.status SSE events when messages are sent/received. Without the --dir flag, events are emitted correctly.

Plugins

No response

OpenCode version

1.1.48

Steps to reproduce

  1. Start OpenCode server: opencode serve --port 4096
  2. In another terminal, listen to SSE events: curl -N "http://localhost:4096/event"
  3. Attach WITH --dir: opencode attach http://localhost:4096 --session <session_id> --dir /path/to/project
  4. Send a message in the attached terminal
  5. Expected: SSE stream shows session.status events (busy → idle)
  6. Actual: only heartbeat events are received, no session.status events

Workaround:
Attach WITHOUT the --dir flag - events are emitted correctly:
opencode attach http://localhost:4096 --session <session_id>

Screenshot and/or share link

No response

Operating System

Ubuntu (WSL2)

Terminal

zsh

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

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