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:
88ba5f5f-3c63-4a52-99bf-424d57117a28
📥 Commits
Reviewing files that changed from the base of the PR and between be6b8c21d4eea99de4f2b5387f83e3230e05f2b3 and 33cfce9762a5fe556c935f3c0cb27c5b81e65110.
📒 Files selected for processing: 8
apps/server/src/orchestration-v2/Orchestrator.tsapps/server/src/orchestration-v2/ProjectionStore.test.tsapps/server/src/orchestration-v2/ProjectionStore.tsapps/server/src/orchestration-v2/runtimeLayer.test.tsapps/web/src/components/ChatView.tsxpackages/client-runtime/src/state/threadExecution.tspackages/shared/src/orchestrationV2ThreadError.test.tspackages/shared/src/orchestrationV2ThreadError.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
📝 Walkthrough
The change adds a
queued-run.editingcommand and run state. The client marks runs during editing. Server queue advancement and presented-run selection account for edited queued runs.Changes: Queued-run editing
Layer / File(s) Summary Editing contract and client lifecycle
packages/contracts/src/orchestrationV2.ts,packages/client-runtime/src/operations/commands.ts,packages/client-runtime/src/state/threadCommands.ts,apps/web/src/components/chat/useQueuedRunEdit.ts,apps/server/src/orchestration-v2/testkit/OrchestratorScenario.tsThe contract and client runtime add queued-run.editing. The edit hook marks and clears the targeted queued run using captured identifiers.Presented-run selection
packages/shared/src/orchestrationV2ThreadError.ts,packages/client-runtime/src/state/threadExecution.ts,packages/client-runtime/src/state/threadWorkflows.ts,apps/web/src/components/ChatView.tsx,packages/shared/src/orchestrationV2ThreadError.test.tsLatest-run selection excludes held queued runs and queued runs at or after the earliest editing position. Client queue-state checks include editing runs. Queue processing and advancement
apps/server/src/orchestration-v2/Orchestrator.tsThe orchestrator validates editing updates, prevents editing runs from starting, clears editing on resume, and advances the queue after relevant commands. Projection and runtime validation
apps/server/src/orchestration-v2/ProjectionStore.ts,apps/server/src/orchestration-v2/ProjectionStore.test.ts,apps/server/src/orchestration-v2/runtimeLayer.test.tsShell projections and runtime tests cover editing order, reordering, provider failures, projection races, and explicitly stopped queues. Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
mermaid1 sequenceDiagram 2 participant useQueuedRunEdit 3 participant setQueuedRunEditing 4 participant Orchestrator 5 participant ProjectionStore 6 useQueuedRunEdit->>setQueuedRunEditing: Dispatch queued-run.editing 7 setQueuedRunEditing->>Orchestrator: Send editing state 8 Orchestrator->>Orchestrator: Hold edited queued runs 9 Orchestrator->>ProjectionStore: Record run.updated 10 ProjectionStore->>ProjectionStore: Exclude edited queued runs from latest-run selection 11 useQueuedRunEdit->>setQueuedRunEditing: Clear editing state 12 setQueuedRunEditing->>Orchestrator: Send editing=false 13 Orchestrator->>Orchestrator: Attempt queue advancement Possibly related PRs
- pingdotgg/t3code#15612: This PR also changes queued-run editing and queue holds.
- pingdotgg/t3code#18631: This PR also adds server-backed state for queued-run editing and release handling.
Suggested reviewers:
juliusmarminge
Merge Risk: 🟡 Moderate · up to 33cfc
A queued message can still start while its edit is opening. Resolve that timing gap before merging; the other queue-order concerns do not require changes.
Security architecture risk: 🔵 Low · up to 33cfc
The change retains existing authorization and thread boundaries. Its main design limitation is that the editing pause is shared rather than owned by an edit session, so one client's cleanup can release another client's active edit.
Retained concerns
- Low · reliability · inferred: The newly introduced editing hold is an unowned boolean. If two authorized clients edit the same queued run, either client's cleanup can set editing to false and trigger queue advancement while the other still edits. Capturing environment, thread, and run identity prevents misdirected cleanup but does not distinguish edit sessions. This is a limitation of the new hold's ownership guarantee, not evidence of new unauthorized access.
Security review details
Security Blast Radius
- inferred — The inspected mutation and resulting queue advancement are confined to the addressed thread within the authenticated environment. Environment-level operators retain their existing ability to control threads; no new cross-environment authority or provider privilege was established.
Security Findings and Attack Paths
- inferred — The supported adverse path is conflicting authorized edit sessions: both mark the same run, one ends and clears the shared boolean, and the queue can start the original message while the other still edits. This is not an authentication bypass, and the base already allowed queued messages to start during editing; the concern is the new control's lack of session ownership.
Trust Boundaries and Controls
- observed — Websocket session authentication and orchestration:operate authorization protect the generic dispatch route. The new handler additionally binds run identity to the supplied thread projection and queued status. The inspected path uses environment-level authority rather than a separate per-thread user-owner check, consistent with neighboring queued-run mutations.
Resilience and Maintainability Implications
- inferred — Entering edit mode does not await server acknowledgement: the hook discards the editing-command promise and immediately activates the composer. Queue completion can therefore win before the marker persists. This leaves part of the preexisting edit/start race unresolved rather than demonstrating that the PR worsens it; local command serialization does not serialize against server-originated completion.
Hardening Proposals
- proposed — If editing must provide a reservation across clients, use server-acknowledged edit acquisition and session-scoped release so stale cleanup cannot release a newer editor. Keep explicit resume as a deliberate recovery override rather than treating ordinary cleanup as equivalent authority.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title clearly and concisely describes the primary fix: preventing an edited queued message from starting when the active turn ends. Description check Passed The description is complete and relevant. It explains the problem, implementation, scope, approval context, verification coverage, performance considerations, and known limitation that browser behavio… Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Full details: Description check
Explanation
The description is complete and relevant. It explains the problem, implementation, scope, approval context, verification coverage, performance considerations, and known limitation that browser behavior was not tested.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create a new PR
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.