Skip to content

fix(pi-extension): start a turn for annotate feedback on idle oh-my-pi - #1423

Open
LoneExile wants to merge 3 commits into
backnotprop:mainfrom
LoneExile:fix/idle-deliveras-omp
Open

fix(pi-extension): start a turn for annotate feedback on idle oh-my-pi#1423
LoneExile wants to merge 3 commits into
backnotprop:mainfrom
LoneExile:fix/idle-deliveras-omp

Conversation

@LoneExile

Copy link
Copy Markdown

Problem

On oh-my-pi, /plannotator-annotate (and review) can show Feedback Sent while the host agent never starts a turn.

Pi documents deliverAs as the streaming queue selector and starts a turn when idle. oh-my-pi honors an explicit deliverAs even when
idle: { deliverAs: "followUp" } parks the prompt as a pending follow-up with no turn to follow. The browser settles; the agent stays
idle.

isIdle() lives on ExtensionContext (ctx.isIdle), not ExtensionAPI. Probing pi is a no-op.

What this does

resolveIdleDeliveryOptions drops only deliverAs while ctx.isIdle() is true, and keeps every other caller option. No probe, a
non-function probe, or a throwing probe leaves the caller's options unchanged (Pi and older hosts stay as they are).

Wired in both send paths:

  • stored current-session send (setCurrentPiSession)
  • same-session fallback (sendUserMessageWithCurrentSessionFallback), with ctx passed from all four annotate/review call sites

Streaming still queues as followUp.

Tests

apps/pi-extension/current-pi-session.test.ts

  • idle ctx → deliverAs stripped so the host starts a turn
  • streaming ctx → followUp kept
  • missing / throwing isIdle → options unchanged
  • isIdle: true on the API object and false on ctx → followUp kept (the pi vs ctx probe)

RED: neutering the helper to probe pi fails the ctx tests. GREEN with ctx.

oh-my-pi honors an explicit deliverAs even when idle, so
{ deliverAs: "followUp" } parks annotate/review feedback as a pending
follow-up and never starts a turn. The browser reports "Feedback Sent"
while the agent never sees it.

Pi documents deliverAs as the streaming queue selector and starts a
turn when idle. Both hosts expose isIdle(), so drop only deliverAs
while idle and keep every other caller option. Hosts without the
probe, or a probe that throws, keep the caller's options unchanged.

Verified RED/GREEN by neutering the helper: 4 idle-drop cases fail,
then 11/11 pass with the helper restored.
isIdle lives on ExtensionContext (ctx.isIdle), not ExtensionAPI.
The previous commit probed `pi`, so the real oh-my-pi path never saw a
probe and kept deliverAs on idle sessions — the original bug.

Pass the updated ctx into the stored-session send and the same-session
fallback. A regression test keeps isIdle:true on the API object and
isIdle:false on ctx; deliverAs must survive.
Matches the surrounding types: no block comment on the helper.
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.

1 participant