Repository navigation
Description
What I observed
When a provider turn completes with a pending message-mode user_input clarifying question (responseCapability: { type: "message" }), ProviderEventIngestor.dismissNativeUserInputs intentionally leaves it in status: "pending" so the user can answer it as a new message.
If the user instead clicks Edit from here or Revert to checkpoint to roll back past that turn (checkpoint.rollback), CheckpointRollbackService (apps/server/src/orchestration-v2/CheckpointRollbackService.ts:513-534) marks the rolled-back run and its rootNode as status: "rolled_back", but never cancels pending runtimeRequests (or their user_input_request turn items / child nodes) owned by runsToRollback.
Because neither ProjectionStore.getThreadShell (apps/server/src/orchestration-v2/ProjectionStore.ts:8514), threadShellFromProjection, getThreadSnapshotWindow, nor client-side derivePendingThreadRequests (packages/client-runtime/src/state/threadRequests.ts:247-276) filters out pending requests belonging to rolled_back runs, the rolled-back turn's question remains stuck open on the rewound thread across web, desktop, and mobile.
Reproduction
- Commit:
main @ 9d3054a7bb - Environment: macOS 27.2.1, Node v26.13.1
UI steps (single user, single device, no race):
- Start a thread and run a turn where the agent asks a clarifying question (a
message-modeuser_inputrequest emitted by Codex/Claude/OpenCode or recovered across restart) and the turn finishes. - Click Edit from here or Revert to checkpoint on Turn 1 to roll back to checkpoint 0.
- Observe the composer, sidebar, and Resume controls on the rewound thread.
Programmatic server repro (ThreadManagementService + OrchestratorV2 + OrchestrationEffectWorkerV2):
- Dispatch
thread.createandmessage.dispatch(start_immediately). - Emit a
node.updated(kind: "user_input_request",status: "waiting"),runtime_request.updated(kind: "user_input",status: "pending",responseCapability: { type: "message" }), andturn_item.updated(type: "user_input_request",responseMode: "message",status: "waiting"), then complete the turn (provider_turn.updated+turn.terminalwithstatus: "completed"). - Dispatch
checkpoint.rollbackto checkpoint 0 (ordinalWithinScope: 0,restoreFiles: false) and drainOrchestrationEffectWorkerV2. - Read
getThreadProjection,getThreadSnapshotWindow, andgetThreadShell.
Expected behavior
Rolling back a run cancels all pending runtimeRequests (and updates their user_input_request turn items and child nodes) owned by runsToRollback, clearing shell.pendingRuntimeRequest, the composer question card, and the sidebar "Waiting for input" badge.
Actual behavior
The run is marked rolled_back and visibleTurnItems is empty, yet runtimeRequests[0] stays status: "pending", windowTurnItems still contains the waiting user_input_request, derivePendingThreadRequests still derives the question card, and getThreadShell still returns pendingRuntimeRequest.
In the UI, the rolled-back question card stays open in the composer, the sidebar stays on "Waiting for input", answering sends the dead question's response into the rewound thread, manual Resume (canResumeThread) and usage-limit auto-resume remain blocked, and t3_pending_request keeps reporting the stale question.
Evidence
Output from running the deterministic Effect/SQLite server repro (getThreadProjection, getThreadSnapshotWindow, getThreadShell after checkpoint.rollback to checkpoint 0):
{
"rollbackCount": 1,
"runs": [{ "id": "run:thread:thread%3Arepro-rollback-q:ordinal:1", "status": "rolled_back" }],
"runtimeRequests": [{ "id": "req:clarify-auth", "status": "pending" }],
"windowRuntimeRequests": [{ "id": "req:clarify-auth", "status": "pending" }],
"windowTurnItems": [
{ "id": "item:clarify-auth", "type": "user_input_request", "status": "waiting" },
{ "id": "...checkpoint...", "type": "checkpoint", "status": "completed" }
],
"pendingCardsDerivedByClient": ["req:clarify-auth"],
"shellPendingRuntimeRequest": {
"id": "req:clarify-auth",
"kind": "user_input",
"createdAt": "1970-01-01T00:00:01.000Z",
"blocking": false
},
"visibleTurnItemsCount": 0
}Additional investigation
- How found: Stateful property-based testing of
OrchestratorV2and its projections, minimized to a deterministic non-PBT Vitest/Effect repro. - Verified: Confirmed still present on
origin/main(9d3054a7bb);CheckpointRollbackService.ts:513-534only emitsrun.updatedandnode.updatedforrunandrootNode. - Duplicate check: Searched open and closed issues/PRs for
rollback pending question,revert question pending,rollback runtimeRequest,user_input rollback, andedit from here question— no matching issue found. - Impact: Major degradation whenever a user rewinds/edits past a clarifying-question turn.
Activity