Skip to content

fix(server): stream a prompt Pi queued after the server turn ended - #429

Open
oxwen11 wants to merge 1 commit into
mainfrom
fix/queued-prompt-idle
Open

oxwen11 wants to merge 1 commit into
mainfrom
fix/queued-prompt-idle

Conversation

@oxwen11

@oxwen11 oxwen11 commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Requirement

A follow-up sent while Pi still considered itself streaming, after Pie had already closed the turn, failed with Pi queued a prompt without an active server turn. The UI froze. Pi kept running the prompt with nobody listening.

Expected behavior

  • A prompt Pi queues while Pie has no active turn is streamed as a new turn, not rejected.
  • A prompt Pi reports as handled still does not open a turn.
  • A follow-up queued onto a turn Pie is already streaming stays attached to that turn.

Changes and risks

packages/server prompt admission. The Pi RPC response now includes disposition. No stored-data or wire-contract change for clients. An old child that omits disposition and returns started: false while idle is treated as queued and streamed.

Verification

  • Revision: 919aa344
  • pnpm exec vitest run test/harness/pi/agent.test.ts in packages/server: 24 passed.
  • Not verified against a live Pie.app or a real model turn.

Pi can still be streaming after Pie has consumed the finish event. A follow-up was then rejected as "queued without an active server turn", so the UI froze while Pi ran the prompt unobserved.
@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2026

Copy link
Copy Markdown
npx https://pkg.pr.new/oxwen11/pie/@getpie/cli@429

commit: 919aa34

@oxwen11

oxwen11 commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

auto-merge: no

head: 919aa344e24debae39eea95a0824bbf2cc69dbb2

Fail closed on exclusions + no matching allowed group:

  • non-presentational fix: packages/server/src/harness/pi/process.ts changes prompt-admission control flow (handled/queued idle path instead of AgentOperationError).
  • RPC/schema/wire: rpc-mode.ts / rpc-types.ts add disposition on prompt success data (started | queued | handled).
  • Tests in agent.test.ts cover the new product control flow — not an allowed group.

Din review-first; no merge.

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.

2 participants