Skip to content

web: recover a dead session — New session, abandoned ask_user, no duplicate 500 - #105

Merged
Code4me2 merged 2 commits into
mainfrom
cursor/dead-session-recovery-720f
Sep 1, 2026
Merged

Code4me2 merged 2 commits into
mainfrom
cursor/dead-session-recovery-720f

Conversation

@Code4me2

@Code4me2 Code4me2 commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Chrome polish PR 2 after #104 (place-to-type). Web-only. This is what the well does when the run is dead.

Closes

#46, #43, #50, #59, #52.

Tracked as the second slice of #103.

Locked decisions (do not reopen)

  • Fault band is the only home for a runtime fault.
  • New session is the recovery action (POST /sessions {profile: "orchestrator"}), never “Send again”.
  • ask_user after death is abandoned without a click. No sixth §7.4 / §7A.7 state.
  • Refresh on process_down / unreachable does not advance a held pin (sticky §4.5).
  • data-runtime-fault is the fact that a run died; data-stream-state stays the socket’s own answer. No sixth stream state. No reconnect wizard — no route backs one.

What changed (verified against main, not the issue hunches)

#46 — well does not stay “running” through sidecar death. §7.4 is still a socket claim; the badge already showed the fault once a session request failed. Pending ask_user widgets no longer stay answerable / “Waiting for an answer” beside runtime unreachable. When data-runtime-fault is set, every widget whose run has not produced a terminal renders data-ask-state="abandoned".

#43 — New session is reachable, and the copy stops lying. runtimeFaultNext no longer says “Send again”. The fault band’s primary action is the §7A.2 create pair. NewSessionAction still paints New session / Ask about <part> when GET /sessions left profiles = [] (the 500 that raised the fault). The pair also renders when the current tab cannot take a prompt (runtime fault, unknown_session, unread history), not only when there are zero rows.

#50 — ask_user after death is not a dead end. Abandoned copy names the restart. Controls are off with that reason. An answer accepted before death stays recorded, with a note that the run did not resume — not relabelled “already answered”.

#59 — §7A.11 refresh runs if the sidecar dies. process_down and unreachable invalidate the same keys as a terminal / prompt response (parts, git, builds, …). timeout does not (the process may still be there). The pin is not written; observeCurrent remains a no-op while held.

#52 — no duplicate HTTP 500 under the composer. Unnamed 5xx is data-send-state="unknown" (the turn may have started) and does not paint a refused/unknown footer that restates the band. Named liveness (process_down, timeout) settles idle so the band is the only statement. A real lost POST still shows §7A.5’s unknown recovery.

Out of this PR

Left for PR 3 (pin honesty + #100)

Honest split copy (#78/#96/#83), chip reads (#57/#88), Follow current when the selected part has no build (#90), sticky pin after create_part (#58/#54/#49). #100 gates Download — do not ship header Export produce-and-give (#77/#85) until the idempotency key is per-part. Held pin does not freeze the inspector.

Tests

pnpm typecheck, pnpm lint, and pnpm test in web/ all pass on this revision (36 files, 586 tests). Unit coverage added/retargeted for fault grade, create-pair visibility when the current tab cannot prompt, ask_user abandoned, refresh on process_down / unreachable without moving a held pin, and no duplicate 500 footer. Existing e2e selectors are unweakened.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 1, 2026 04:37
When the runtime dies the well now names New session on the fault band,
abandons pending ask_user widgets, refreshes workspace reads on
process_down/unreachable without moving a held pin, and keeps the HTTP
500 out of the composer footer. data-stream-state stays the socket.

Co-authored-by: Vel <Code4me2@users.noreply.github.com>
…ontract

Co-authored-by: Vel <Code4me2@users.noreply.github.com>
@Code4me2
Code4me2 marked this pull request as ready for review September 1, 2026 04:43
@Code4me2
Code4me2 merged commit aecd035 into main Sep 1, 2026
18 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.

2 participants