Skip to content

fix(pi-fff): avoid blocking session start during finder warmup#478

Open
cokekitten wants to merge 1 commit into
dmtrKovalenko:mainfrom
cokekitten:fix-pi-fff-nonblocking-session-start
Open

fix(pi-fff): avoid blocking session start during finder warmup#478
cokekitten wants to merge 1 commit into
dmtrKovalenko:mainfrom
cokekitten:fix-pi-fff-nonblocking-session-start

Conversation

@cokekitten
Copy link
Copy Markdown

Summary

Fixes #477.

pi-fff currently awaits ensureFinder() during session_start, and ensureFinder() calls FileFinder.create() followed by waitForScan(15000). Since Pi recreates the session runtime for /new and /resume, this can make session switching appear stuck while the finder scan warms up.

This change:

  • schedules finder warmup after session_start returns, so Pi session replacement is not blocked
  • keeps tool behavior intact: the first fff tool/autocomplete use still awaits the shared in-flight finderPromise if warmup is not done yet
  • adds a lifecycle guard so stale warmups from a previous session do not notify or affect a newer session
  • returns the local createdFinder from ensureFinder() after waitForScan() to avoid returning a destroyed/replaced global finder if shutdown happens during warmup

Validation

cd packages/pi-fff
npx tsc --noEmit

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.

pi-fff blocks Pi /new and /resume while waiting for FileFinder scan on session_start

1 participant