Conversation
…dead SSE connections findProjectForPath never matched files from type:"files" sources because their RootPath is empty — it only checked RootPath prefixes. Now also checks individual src.Files paths so change events are correctly attributed to their project. watchProjectSources now watches directories containing individually listed files, so FocusProject picks them up. The SSE handler now checks fmt.Fprintf errors and returns immediately on write failure, preventing events from being consumed from the subscriber channel but never delivered to a disconnected client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a34c348585
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if err := w.watcher.Add(dir); err == nil { | ||
| w.focusWatched = append(w.focusWatched, dir) |
There was a problem hiding this comment.
Preserve baseline root watches when adding files-source dirs
If a type:"files" source includes a root-level file (for example README.md), filepath.Dir(f) is the project root, which is already shallow-watched in Start. fsnotify.Add is a no-op that still returns nil for duplicate paths, so this code appends that root path to focusWatched; later removeFocusWatches calls Remove on it and unintentionally drops the baseline project-root watch. After focus is cleared/switched, create/remove events under the project root no longer trigger auto-detect rescans in handleEvent, so newly added source dirs can be missed until process restart.
Useful? React with 👍 / 👎.
Summary
findProjectForPathnow matches files fromtype:"files"sources — previously only checkedRootPathprefixes, which are empty for file-list sources, so change events were silently droppedwatchProjectSourceswatches directories of individually listed files — soFocusProjectcorrectly monitors these sources🤖 Generated with Claude Code