feat(cli): emit session queue state for remote clients - #12297
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Since the last review (
All three previously-flagged style suggestions (const-only Files Reviewed (2 files changed since last review)
Previous Review Summaries (4 snapshots, latest commit 3474e50)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 3474e50)Status: No Issues Found | Recommendation: Merge The latest commit ( All three earlier style suggestions remain resolved from the prior review (const-only Files Reviewed (no new PR changes since last review)
Previous review (commit 868d37d)Status: No Issues Found | Recommendation: Merge All three previous suggestions were addressed in 173ba94:
The latest commit ( Files Reviewed (no new PR changes since last review)
Previous review (commit 173ba94)Status: No Issues Found | Recommendation: Merge All three previous suggestions were addressed in 173ba94:
No new issues found in the incremental diff. Files Reviewed (2 files changed since last review)
Previous review (commit b888ed8)Status: 3 Issues Found | Recommendation: Merge (non-blocking suggestions) Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (7 files)
All changed logic sits in Kilo-owned paths ( Reviewed by claude-sonnet-5 · Input: 24 · Output: 6.3K · Cached: 664.3K Review guidance: REVIEW.md from base branch |
b888ed8 to
173ba94
Compare
…n-message-queue # Conflicts: # packages/opencode/test/kilocode/sessions/remote-sender.test.ts
|
(bot) Closing and reopening to re-trigger a stuck Kilo Code Bot review check suite (queued with no progress for 3+ hours after the origin/main merge push, while newer PRs' suites completed normally in the same window). |
…ickydisk hang for 5 consecutive runs on the previous head)
…n-message-queue # Conflicts: # packages/opencode/test/kilocode/sessions/remote-sender.test.ts
* feat(cli): emit session queue state for remote clients * chore: retrigger CI (HttpApi exerciser stuck on a Blacksmith cache/stickydisk hang for 5 consecutive runs on the previous head) * chore(cli): remove kilocode_change markers from kilo-owned files
Summary
Adds a new Kilo-owned bus event,
session.queue.changed { sessionID, queued: MessageID[] }, carrying the authoritative FIFO snapshot of user-message IDs enqueued behind a running turn but not yet started. This lets remote clients (mobile) show a "Queued" indicator on follow-up messages sent while an agent session is busy.KiloSessionPromptQueue(prompt-queue.ts) tracks a per-session ordered waiting list: pushes on enqueue-while-busy, shifts on slot-start-running, clears on cancel/version bump — publishing the event at each transition.snapshot(sessionID)accessor exposes the current waiting list.remote-sender.ts'sreplay()now always sends the current queue snapshot (including empty) to a (re)subscribing client, so reconnects reconcile away stale badges.session.queue.changedalready carriessessionIDin a shapeextractSessionIdrecognizes.Companion PR
cloud: normalizes this event into the shared SDK's
pendingMessagesstate and renders the mobile "Queued" badge.Testing
bun test ./test/kilocode/session-prompt-queue.test.ts ./test/kilocode/sessions/remote-sender.test.ts— 69/69 passingbun run typecheck(frompackages/opencode/) — cleanminor)Note: the full
bun testrun frompackages/opencode/exhibits pre-existing, non-deterministic flakiness in unrelated test files (npm-publish retry timing, SessionImportService, worktree indexing, BackgroundProcess timing, and one real-provider session-prompt integration test) across repeated runs with different failures each time — none of these touch this PR's changed files. The touched test files pass deterministically in isolation and combined, repeatedly.Non-goals
Per-message dequeue/edit/reorder API; no session-ingest/relay changes (forwarding is automatic and unchanged).