Skip to content

Bug: folder annotation server hangs when switching to another Markdown file #1313

Closed

Description

@abanoub-ashraf

Environment

  • Plannotator: 0.27.2
  • OS: macOS 26.6.1 (25G76), arm64
  • Agent/surface: Codex $plannotator-annotate
  • Browser: Google Chrome
  • Command:

PLANNOTATOR_BROWSER='Google Chrome' PLANNOTATOR_GLIMPSE=0 plannotator annotate .

Steps to reproduce

  1. Run the command above in a Git repository.
  2. Wait for the folder file tree to load.
  3. Click a supported Markdown file.
  4. Click another Markdown file.
  5. Try switching between several files.

Expected behavior

Each clicked Markdown file opens in the document pane.

Actual behavior

The first file may open, but after switching files the document pane stays blank or shows the previous file. Further clicks do nothing.

The file button receives focus, but the local server becomes unresponsive. The port remains listening while document API requests time out:

curl: (28) Operation timed out after 5000 milliseconds with 0 bytes received

The server process remains alive but appears stuck on an internal lock.

Additional evidence

  • Direct-file annotation works:

plannotator annotate CAR_DETAILS_CLOSEOUT.md

  • The same Markdown file returns HTTP 200 in direct-file mode.
  • The failure is specific to folder-mode file switching.
  • PLANNOTATOR_GLIMPSE=0 does not prevent the folder-mode failure.
  • No repository files were changed.
  • Oversized files are not part of this report; the failing files are normal Markdown files.

Activity

  1. backnotprop commented on Aug 13, 2026

    @backnotprop
    Owner

    Thanks for the detailed report, reproduced and diagnosed. AI-assisted triage summary below.

    TLDR: Confirmed, and it is not new in 0.27.2. The folder file tree's content watcher blocks the whole local server during its initial directory scan (about 40ms per directory on macOS), and on a disconnect the watcher is rebuilt from scratch, so on a large repo the freeze can feed itself. It has been latent for several releases; your repo is likely just big enough to make it unbearable.

    A patch is in progress now: the watcher is moving off the request path (server stays responsive while it warms), reconnects reuse the warm watcher instead of rescanning, and macOS gets the native recursive watcher, which we measured at roughly 0ms versus 9 seconds for the current scan on a 228-directory tree.

    If you want to confirm the diagnosis on your side, two quick things help:

    1. From the repo root: find . -type d -not -path '*/node_modules/*' -not -path '*/.git/*' | wc -l
    2. If you open the folder and wait a few minutes without clicking, does the pane eventually come back?

    Will update here when the patch ships.

  2. backnotprop commented on Aug 13, 2026

    @backnotprop
    Owner

    v0.27.3 is out with the fix: https://github.com/backnotprop/plannotator/releases/tag/v0.27.3

    Update with curl -fsSL https://plannotator.ai/install.sh | bash (or your usual method). Folder sessions now answer immediately while the file watcher warms in the background, reconnects reuse the warm watcher instead of rescanning, and macOS uses the native recursive watcher (about 3ms to start versus 9 seconds before on a 228-directory repo). The regression test that pins this covers a 780-directory tree that previously froze the server for 79 seconds and now answers in under one second.

    If you still see anything off on your repo after updating, please reopen with the directory count from the earlier comment.

  3. backnotprop commented on Aug 13, 2026

    @backnotprop
    Owner

    Hey @abanoub-ashraf, we think v0.27.3 fixed this. Can you update and let us know if folder annotate works smoothly on your repo now?

  4. abanoub-ashraf commented on Aug 14, 2026

    @abanoub-ashraf
    Author

    hi, i tried it now after updating, now it works fine thanks a lot :))

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

Metadata

Metadata

Assignees

No one assigned

    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