Skip to content

fix(server): bound startup file discovery#1036

Merged
backnotprop merged 2 commits into
mainfrom
fix/978-bounded-startup-walk
Jul 10, 2026
Merged

fix(server): bound startup file discovery#1036
backnotprop merged 2 commits into
mainfrom
fix/978-bounded-startup-walk

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Summary

  • bound synchronous CLI markdown and folder discovery with the existing PLANNOTATOR_FILE_BROWSER_MAX_FILES limit
  • make the startup code-file cache warm asynchronous and bounded, and start it only after Bun/Pi servers successfully bind
  • share the limit parser with file-browser discovery and document the expanded behavior
  • add regression coverage for traversal limits and bind-before-warm ordering against the server own cache key

Validation

  • bun run typecheck
  • bun test packages/shared packages/server apps/pi-extension/server.test.ts — 945 passed, 0 failed
  • bun test scripts/install.test.ts — 85 passed, 0 failed
  • repaired ordering canary — 17 passed, 0 failed
  • 60,001-file manual startup canary with limit 50 — ready within one second and /api/plan returned HTTP 200

Closes #978

…ctually pin the fix

Review finding: both bind-before-warm ordering tests raced against
observeWarmState(projectRoot), but on macOS mkdtempSync returns /var/...
while the chdir'd server warms under the realpath /private/var/... —
a different warmFileListCache key. The tests therefore raced a FRESH
warm (always pending at observation time) and passed on the OLD broken
code too. Observing process.cwd() inside onReady uses the server's real
key. Verified: with old resolve-file/server code checked out, all four
ordering tests now fail; on the fix they pass (17/17 across both files).

Claude-Session: https://claude.ai/code/session_01SFy9fY27SA8g5BtotWPi1G
@backnotprop backnotprop merged commit 7f0c360 into main Jul 10, 2026
13 checks passed
@backnotprop backnotprop deleted the fix/978-bounded-startup-walk branch July 10, 2026 17:18
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: plannotator annotate / opencode-plan hangs indefinitely when CWD contains a large directory tree (e.g. a FUSE-mounted monorepo)

1 participant