Skip to content

bug: SSE event stream drops all events for worktree sessions #35917

Closed as not planned

Description

@EZotoff

Describe the bug

The SSE event handler in event.ts filters events by event.location?.directory === instance.directory. When a session runs inside a git worktree, the working directory differs from the main workspace (e.g., /home/user/repo-worktree-feature/ vs /home/user/repo/). The directory field in event locations reflects the actual working directory, not the instance's configured directory, so all events fail the filter and are silently dropped.

The TUI receives zero real-time updates — no tool completions, no message streaming, no permission prompts. The session appears frozen.

To reproduce

  1. Create a worktree: git worktree add ../repo-worktree-test
  2. Open opencode in the worktree: cd ../repo-worktree-test && opencode
  3. Send a message
  4. Observe: the TUI shows no streaming output, tool results, or live updates

Expected behavior

Worktree sessions should receive SSE events normally. The workspaceID filter already correctly scopes events to the current workspace — the directory filter is redundant and breaks worktree usage.

Environment

  • OpenCode 1.17.9

Activity

  1. github-actions commented on Jul 8, 2026

    @github-actions
    Contributor

    This issue might be related to existing worktree issues. Please check:

  2. github-actions commented on Sep 7, 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