Repository navigation
fix(core): warn when the watcher cannot read a new directory - #1692
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 629b2b04a6
ℹ️ 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".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6887ee6ad2
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e206136b9
ℹ️ 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".
On Linux the watcher adds a watch on a new directory when it appears. If the directory cannot be read at that moment, adding the watch fails and notify discards the error. Files written into the directory then produce no events and are never indexed, and nothing is logged. The directory's own creation event still arrives, because the parent's watch is fine. When a batch reports a new directory that cannot be listed, log a warning that names it and says to run `bm project index <name>` (or `bm reindex`) once its permissions are fixed. Signed-off-by: sammywachtel <subp@wachtel.us>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APFUk2bjEwMptMQqpRhjea Signed-off-by: phernandez <paul@basicmachines.co>
`bm project index My Notes` parses as two arguments and fails. Render the recovery command with shell_command so a project name with a space or shell metacharacter survives copy-paste. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APFUk2bjEwMptMQqpRhjea Signed-off-by: phernandez <paul@basicmachines.co>
…-safe
The watcher also watches a cloud project's local bisync copy, and the
local reindex refuses cloud projects, so `bm project index` was the
wrong remedy there (test_remedy_emission_sites caught it once the hint
went through shell_command). handle_changes now passes whether the
project is local, and a cloud project gets a permissions hint instead.
The path and project name were embedded in an f-string while keyword
arguments were also passed, so Loguru ran str.format over them: a
directory named "{foo}" raised KeyError and dropped the whole batch.
They are now Loguru arguments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01APFUk2bjEwMptMQqpRhjea
Signed-off-by: phernandez <paul@basicmachines.co>
…ry hint The hint looked the mode up in the watcher's startup config snapshot, so a project switched with `bm project set-cloud` mid-cycle still got the local `bm project index` remedy, which refuses cloud projects. Read it from current config, as _project_is_configured already does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APFUk2bjEwMptMQqpRhjea Signed-off-by: phernandez <paul@basicmachines.co>
a24d196 to
62a55a1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62a55a1397
ℹ️ 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".
…he hint Shell quoting cannot stop Typer reading `-foo` as an option, so the pasted remedy for a project named `-foo` failed with "No such option". The hint now renders `bm project index -- -foo` for such names; other names are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01APFUk2bjEwMptMQqpRhjea Signed-off-by: phernandez <paul@basicmachines.co>
Supersedes #1686 by @sammywachtel. The commit is cherry-picked unchanged, with authorship and sign-off kept, so the full CI suite runs: fork PRs skip it.
When a new directory can't be read, the watcher can't add a watch on it, and notify drops that error. Files written into the directory are then never indexed. The new
warn_unreadable_new_directories()runs on each batch'saddeddirectories and logs one warning naming the directory andbm project index <name>. This is the smaller change suggested when #1664 was declined. See #1686 for the full write-up.Added on top: a changelog entry under v0.24.0 Bug Fixes.
Verification:
just fast-checkis clean, andjust fast-test tests/index/test_watch_service.pypasses (5 tests).🤖 Generated with Claude Code
https://claude.ai/code/session_01APFUk2bjEwMptMQqpRhjea