Note
Reviews paused
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Use the checkboxes below for quick actions:
- ▶️ Resume reviews
- 🔍 Trigger review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cee262a4-7345-4a81-bb6e-b6b64efe0f8e
📥 Commits
-
Reviewing files that changed from the base of the PR and between 4d48109e5e838fea233deec0afdedcf364ad4e96 and f8c9469439d4528224ec5ab2b224ce8919aac18b.
📒 Files selected for processing (21)
-
apps/mobile/src/features/threads/ThreadQueueControl.tsxapps/mobile/src/state/queued-run-edit.test.tsapps/mobile/src/state/queued-run-edit.tsapps/mobile/src/state/thread-task-permissions.test.tsapps/mobile/src/state/use-thread-composer-state.tsapps/server/src/orchestration-v2/Orchestrator.tsapps/server/src/orchestration-v2/ProjectionStore.test.tsapps/server/src/orchestration-v2/ProjectionStore.tsapps/server/src/orchestration-v2/QueuedRunEditing.test.tsapps/server/src/orchestration-v2/testkit/OrchestratorScenario.tsapps/web/src/components/ChatView.tsxapps/web/src/state/entities.tsdocs/user/composer.mdpackages/client-runtime/src/operations/commands.test.tspackages/client-runtime/src/operations/commands.tspackages/client-runtime/src/state/threadCommands.tspackages/client-runtime/src/state/threadDetail.test.tspackages/client-runtime/src/state/threadState.tspackages/client-runtime/src/state/threads-sync.test.tspackages/client-runtime/src/state/threads.tspackages/contracts/src/orchestrationV2.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
📝 Walkthrough
Walkthrough
Queued-message editing now creates a server-side edit hold. The server keeps an edited run in its queue until the edit is saved or canceled. Web and mobile clients send edit IDs, track edit ownership, and show which queued runs are being edited.
Changes
Queued message editing
Layer / File(s) Summary Edit commands and runtime ownership
packages/contracts/src/orchestrationV2.ts,packages/client-runtime/src/operations/commands.ts,packages/client-runtime/src/state/*The contract and client runtime add begin and cancel commands, track thread-state sequence numbers, and determine whether an edit is pending, owned, or lost. Save commands can include an edit ID. Server edit lease and queue dispatch
apps/server/src/orchestration-v2/Orchestrator.ts,apps/server/src/orchestration-v2/testkit/OrchestratorScenario.ts,apps/server/src/orchestration-v2/QueuedRunEditing.test.tsThe server records and validates edit IDs, blocks dispatch and steering for edited runs, and attempts queue startup after edit completion. Tests cover saves, cancels, stale IDs, queue pauses, and dispatch timing. Held queue position and presentation
apps/server/src/orchestration-v2/ProjectionStore.ts,apps/server/src/orchestration-v2/ProjectionStore.test.ts,packages/shared/src/orchestrationV2ThreadError.ts,packages/client-runtime/src/state/threadExecution.test.tsQueue-position and latest-run calculations account for edit-held runs. Tests cover shell projections and runtime status. Web and mobile edit flows
apps/web/src/components/ChatView.tsx,apps/web/src/components/chat/QueuedRunsControl.tsx,apps/web/src/state/entities.ts,apps/mobile/src/features/threads/ThreadQueueControl.tsx,apps/mobile/src/state/*,docs/user/composer.mdWeb and mobile clients begin, save, and cancel edits with edit IDs. They preserve existing draft content, respond to lost ownership, display editing status, and prevent steering of edited runs. The composer guidance describes edit holds. Priority: ➖ Normal
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix · Severity of issue fixed: Medium
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant ChatView 3 participant ClientRuntime 4 participant Orchestrator 5 ChatView->>ClientRuntime: Begin edit with runId and previousEditId 6 ClientRuntime->>Orchestrator: Dispatch queued-run.edit.begin 7 Orchestrator->>Orchestrator: Record queueEditId and hold the run 8 ChatView->>ClientRuntime: Save or cancel with editId 9 ClientRuntime->>Orchestrator: Dispatch edit or cancel command 10 Orchestrator->>Orchestrator: Validate and clear matching edit ID Suggested reviewers:
t3dotgg,juliusmarminge
Merge Risk: ⚪ Minimal · up to f8c94
Queued messages are now held on the server while they are edited, and the earlier stale-editor problem is fixed on web and mobile. The browser reopen race fix has not been re-tested by the reviewer, so retest it before merging.
Security Architecture Review
-
Security architecture risk: 🔵 Low · up to
f8c94The change prevents queued messages from executing during an edit and rejects stale saves. Existing access controls remain in place, and abandoned edits can be reopened. Full app-close recovery and downgrade compatibility remain unverified.
Retained concerns No architecture-level concerns identified.
Security review details
Security Blast Radius
- inferred — One accepted hold affects an eligible queued user message and the later queue positions in its thread. Repeated commands can affect multiple threads available to an environment session with orchestration-operate authority. The downstream outcome is delaying or releasing existing provider runs, not granting additional provider privileges.
Trust Boundaries and Controls
- observed — The new commands traverse the pre-existing authenticated WebSocket dispatch boundary. Session scope middleware requires orchestration-operate authority before dispatch; knowing an edit token does not replace this permission. Server checks additionally restrict edits to queued user messages in the named thread and reject automatic completion and notification messages.
Resilience and Maintainability Implications
- observed — Loss of in-memory editor metadata does not make a persisted hold irrecoverable: web and mobile reopen using the current projected edit ID, acquire a replacement token, and can then save or cancel. The documented recovery action is to reopen the queued message. Removing the queued run transitions it to cancelled, so its retained metadata no longer represents an executable queued hold.
Hardening Proposals
- proposed — Define a hold-aware downgrade procedure and validate it with persisted active edits. Before reverting to a server that lacks hold enforcement, explicitly resolve or remove affected queued messages rather than relying on the unchanged protocol version to preserve the no-dispatch guarantee.
Pre-merge checks | Passed 4
-
✅ Passed checks (4 passed)
-
Check name Status Explanation Title check Passed The title clearly and concisely describes the main change: queued messages remain held while they are being edited. Description check Passed The description covers the problem, fix, scope, linked issues, cross-client behavior, regression tests, manual verification, screenshots, and untested areas. It also states that maintainer approval is… Linked Issues check Passed Issue [ #15611] requires the server to hold a queued message while its editor is open. The current implementation adds edit-begin, save, and cancel commands with edit IDs.QueuedRunEditing.test.tsve…Out of Scope Changes check Passed The changes remain within queued-message editing for [ #15611]. Server edit leases, stale-editor protection, projection status, shared client commands, web and mobile controls, queue-pause handling, re…
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.