fix(pi-extension): start a turn for annotate feedback on idle oh-my-pi - #1423
Open
LoneExile wants to merge 3 commits into
Open
fix(pi-extension): start a turn for annotate feedback on idle oh-my-pi#1423LoneExile wants to merge 3 commits into
LoneExile wants to merge 3 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On oh-my-pi,
/plannotator-annotate(and review) can show Feedback Sent while the host agent never starts a turn.Pi documents
deliverAsas the streaming queue selector and starts a turn when idle. oh-my-pi honors an explicitdeliverAseven whenidle:
{ deliverAs: "followUp" }parks the prompt as a pending follow-up with no turn to follow. The browser settles; the agent staysidle.
isIdle()lives onExtensionContext(ctx.isIdle), notExtensionAPI. Probingpiis a no-op.What this does
resolveIdleDeliveryOptionsdrops onlydeliverAswhilectx.isIdle()is true, and keeps every other caller option. No probe, anon-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:
setCurrentPiSession)sendUserMessageWithCurrentSessionFallback), withctxpassed from all four annotate/review call sitesStreaming still queues as
followUp.Tests
apps/pi-extension/current-pi-session.test.tsdeliverAsstripped so the host starts a turnfollowUpkeptisIdle→ options unchangedisIdle: trueon the API object andfalseon ctx →followUpkept (thepivsctxprobe)RED: neutering the helper to probe
pifails the ctx tests. GREEN withctx.