Skip to content

fix(pi): preserve gated reviews and route feedback to their opener - #2581

Merged
backnotprop merged 3 commits into
backnotprop:mainfrom
utpalsinghdev:fix/pi-review-lifecycle
Nov 4, 2026
Merged

backnotprop merged 3 commits into
backnotprop:mainfrom
utpalsinghdev:fix/pi-review-lifecycle

Conversation

@utpalsinghdev

Copy link
Copy Markdown
Contributor

Summary

Gated annotation reviews opened by the Pi extension now stay open when their browser tab closes or loses its connection. These reviews return immediately, so they should not use the blocking CLI's client lease.

Review feedback now goes to the session that opened the review first, preventing an in-process Oh My Pi task subagent from receiving feedback intended for its parent. If the opener can no longer accept messages after session replacement, delivery still uses the existing current-session fallback.

Closes #2553
Closes #2554

Verification

  • 49 focused tests passed across:
    • apps/pi-extension/plannotator-browser.test.ts
    • apps/pi-extension/current-pi-session.test.ts
    • apps/pi-extension/plannotator-tool.test.ts
    • apps/pi-extension/stale-ctx.test.ts
  • 7 lease-server tests passed:
    bun test apps/pi-extension/server.test.ts -t 'client.lease|lease'
  • Pi extension typecheck and git diff --check passed.
  • In Brave, closed a gated review's tab, waited 34 seconds, reopened it, and approved successfully.
  • On OMP 18.13.3, submitted browser feedback while an actual task subagent was running and confirmed delivery to the parent session.
  • Stale-session fallback passed the focused extension tests.

utpalsinghdev and others added 3 commits November 4, 2026 05:12
The lease is off only for the tool and the slash commands, which return at
once. The event bus and openMarkdownAnnotation/openLastMessageAnnotation
await the decision, so a gated review whose tab is gone still settles as
dismissed after 30 s (backnotprop#1143) instead of hanging the caller until Pi exits.

Feedback to an opener whose session_shutdown ran (or whose ctx throws) goes
to the current session first, so a host whose replaced pi never throws
still delivers to the replacement with the switched-session header.

The browser test now sets the plan HTML through a test seam instead of
writing a stub into the extension folder.
@backnotprop backnotprop added the ci:full Run the heavy CI tier on this PR (added by the merge script) label Nov 4, 2026
@backnotprop
backnotprop merged commit a6de1c4 into backnotprop:main Nov 4, 2026
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run the heavy CI tier on this PR (added by the merge script)

Projects

None yet

2 participants