Skip to content

fix(event): remove directory filter from SSE stream for worktree sessions - #49963

Open
EZotoff wants to merge 1 commit into
anomalyco:devfrom
EZotoff:fix/sse-worktree-event-filter-rebased
Open

EZotoff wants to merge 1 commit into
anomalyco:devfrom
EZotoff:fix/sse-worktree-event-filter-rebased

Conversation

@EZotoff

@EZotoff EZotoff commented Sep 19, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #49861 (re-report of #35917, which was auto-closed after 60 days of inactivity)

Type of change

  • Bug fix

What does this PR do?

The SSE /event handler filters the stream with event.location?.directory === instance.directory. Worktree sessions live in a different directory than the main checkout, so every event from worktree activity fails that check and is dropped — subscribers receive nothing for worktree sessions (#35917 / #49861).

This removes the directory equality check and keeps the workspaceID check, so clients still only receive events for their own workspace (or workspace-global events where workspaceID is undefined).

Supersedes #35913 — same change, rebased onto current dev; that PR was closed by the automated cleanup bot for age, not on merit.

How did you verify your code works?

Ran the server from source (bun packages/opencode/src/index.ts serve) against a git repo with a worktree, on unpatched dev and on this branch:

  1. Subscribed to /event?directory=<main-checkout>
  2. Created a session via POST /session?directory=<worktree-dir> (response confirms "directory": "<worktree-dir>")
  3. Compared what the subscriber received:
build events received on main-checkout subscriber
unpatched dev (5f9d9187c) server.connected only — session.created dropped
this branch server.connected + session.created

Screenshots / recordings

Server-side change; table above.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: SSE event stream drops all events for worktree sessions (still present on current dev)

1 participant