Skip to content

feat(collaboration): queue worker completion reports - #2654

Merged
Tioit-Wang merged 2 commits into
mainfrom
feat/queued-collaboration-reports
Nov 29, 2026
Merged

Tioit-Wang merged 2 commits into
mainfrom
feat/queued-collaboration-reports

Conversation

@Tioit-Wang

Copy link
Copy Markdown
Collaborator

What

Queue worker completion reports so a subagent that finishes while the owner
session is mid-turn is delivered as a settled transcript message instead of
being dropped or interleaved into the running turn.

Why

A delegated worker can settle during an owner turn. Previously the completion
report could arrive out of order, be lost on owner restart, or interleave into
the active turn's message stream. This change makes settlement durable and
ordered:

  • Host-core records completion batches with admission (session_turn_admission)
    so a report is either admitted into the next turn or persisted as pending.
  • The agent host owns a TurnQueue; completion reports waiting on an owner turn
    are queued and flushed in settlement order.
  • Transport failures re-arm the pending receipt rather than dropping it.
  • Report text is rendered server-side (report_text) and projected as a
    normal transcript message with collaboration provenance.

Validation

  • pnpm build:js pass
  • pnpm --filter @pi-desktop/desktop typecheck pass
  • packages/agent-host tests 70/70
  • packages/host-runtime tests 192 passed / 3 skipped
  • node --test focused: queued-turn-finalization, session-collaboration-service,
    session-message-input, session-message-presentation
  • cargo test -p host-core --locked pass
  • git diff --check clean

Rebased onto origin/main @ 325167720.

Spec / ADR

  • docs/adr/0239-session-collaboration-messages.md
  • docs/spec/03-runtime/0{1,2,4,6}-*.md
  • docs/spec/06-delivery/e2e/conversation.md
  • docs/spec/07-plugins/03-plugin-api.md

Persist bounded completion receipts and deliver them to parent sessions as one durable input. Keep source provenance and permission ceilings across dispatch and restart.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Deploying pi-desktop with  Cloudflare Pages  Cloudflare Pages

Latest commit: 411797c
Status: ✅  Deploy successful!
Preview URL: https://32be53c4.pi-desktop.pages.dev
Branch Preview URL: https://feat-queued-collaboration-re.pi-desktop.pages.dev

View logs

@Tioit-Wang
Tioit-Wang merged commit 917bfc9 into main Nov 29, 2026
7 checks passed
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