anomalyco / anomalyco/opencode
bug: SSE event stream drops all events for worktree sessions (still present on current dev)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Re-opening the still-relevant bug from #35917, which was auto-closed after 60 days of inactivity.
Verified today on current dev (@5f9d9187c): packages/opencode/src/server/routes/instance/httpapi/handlers/event.ts:37 still gates the SSE stream on
event.location?.directory === instance.directory &&
(event.location.workspaceID === undefined || event.location.workspaceID === workspaceID)
Worktree sessions emit events whose location.directory differs from the main instance directory, so the directory equality check filters out every worktree event — SSE subscribers see no activity for worktree sessions at all. Original repro details are in #35917.
The prior fix PR #35913 was closed by the automated PR cleanup (>1 month old, few reviews) — not rejected on merit. A rebased version of the same two-line fix is incoming.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/opencode/src/server/routes/instance/httpapi/handlers/event.ts at line 37 and review how the SSE stream filters event locations for worktree sessions. Use the reproduction details in issue #35917 as context, then verify that worktree subscribers receive activity events and that the directory filtering behavior is covered before considering the issue done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100