Repository navigation
Session relaunch: in-repo install and automated inverse, and background sessions by claude respawn - #1187
Open
seathatflowsinourveins wants to merge 2 commits into
Open
Session relaunch: in-repo install and automated inverse, and background sessions by claude respawn#1187seathatflowsinourveins wants to merge 2 commits into
seathatflowsinourveins wants to merge 2 commits into
Conversation
…e, and background sessions by claude respawn The command center's rulings of 2026-10-15 route #1116's automated inverse to the new host's install stage: upstream at 2.1.301 still has no relaunch after a boot (claude daemon --help line 12; agent-view docs lines 817, 823, 884-886 at sha256 c8e2b810), so the in-repo tool stays and ships with its install and inverse. - tools/session-relaunch/install.sh ports the applied host install v6 (apply.sh, install_id ba61c343) with its gates unchanged; sources are the tool's committed bytes at HEAD, the host config comes in with --config, and the install state has its own root. - tools/session-relaunch/uninstall.sh ports v6's manual inverse with its gates unchanged; the expected file records are the recorded source commit's bytes in the checkout. - Background rows with a profile are respawned with claude respawn <id> (agent-view docs line 766) only when they are listed with no process and their saved transcript exists; otherwise the handoff gives claude attach <id>. A probe at 2.1.301 saw a respawn without a saved transcript re-send the dispatch prompt, against CHANGELOG 2.1.290 L794 (anthropics/claude-code@03b5892e): recorded as an untested boundary. - The handoff names the real reason a row is left (the :249-250 follow-up); background rows are no longer skipped (the :420 follow-up); config.example.json gains the ns51 profile. Tests: tests/test_session_relaunch_install.py runs both scripts against the v6 simulation's systemctl stand-in with its fixtures (A, F-B4, F-B3, F-B1a, F-B1b, F-B1c, F-D, E, C, R) plus G, W and K, each refusal asserted by its reason; tests/test_session_relaunch.py gains six background, reason and profile cases. On main's tree they fail (72 run: 15 failures, 9 errors); a mutant of uninstall.sh for each v5 P1 class fails exactly its fixture. After: 72 OK; validate rc 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ope so the supervisor outlives the boot unit A probe at 2.1.301 (2026-10-15) ran `claude respawn <id>` from a transient Type=oneshot user unit with no supervisor running, as the boot unit does: the unit returned 0, but the on-demand supervisor it started lived in the unit's cgroup, and the unit's exit killed the supervisor and the session (systemd's default KillMode=control-group, systemd.kill(5)). Through `systemd-run --user --scope --quiet --` (systemd-run(1)) both outlived the unit, and the session was listed with a process by `claude agents --json`, with and without --all. respawn_one now runs the call that way (config key systemd_run, default /usr/bin/systemd-run). tests/test_session_relaunch.py: the respawn goes through the scope wrapper (an error before the fix, OK after). The probe receipt gains cases U and U-scope; the README and the decision record state the finding, and the boot's own environment stays an untested boundary. Publication files name 2604's applied install by date, not by its id. After: 73 tests OK; the three uninstall.sh mutants still fail exactly their fixtures; validate rc 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
5 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
install.sh) and its automated inverse (uninstall.sh), both ported from the applied host install v6 with their gates unchanged. It also restarts profiled background sessions with the client's ownclaude respawn <id>, only when such a session has no process and its saved transcript exists. The new host's install stage (New WSL clean install plan (NativeHorizonNY) and the host Claude config reconciliation #1174) pins this commit and does not re-implement it.8053f14e7e0817d2502dff2bb284bfb7e1b0152flane:foundationtools/session-relaunch/(install.sh, uninstall.sh, session_relaunch.py, README.md, config.example.json),tests/test_session_relaunch.py,tests/test_session_relaunch_install.py,docs/decisions/2026-10-15-session-relaunch-install-and-inverse.md,evidence/artifacts/session-relaunch-install-20261015/, the test count inevidence/artifacts/session-relaunch-20261014/README.md,manifests/evidence.json.The command center's rulings of 2026-10-15 (coordination records, cited by name and date) asked for this as ONE PR:
session_relaunch.py:420follow-up;ns51profile in the example config.The reason-text follow-up at
:249-250is fixed in the same hunk.claude respawn <id>is the scripted form of the attach/reply path the command center named; it approved that design after the probe below. 2604 keeps its v6 install and manual inverse.Commits
93cdc6ea: the install, the inverse, background respawn, the reason text and thens51profile.6708e120: each respawn runs in its own transient scope. Before the first cue, a probe found that the boot oneshot's exit kills the on-demand supervisor a respawn starts inside it (receipts, case U).SOTA sources
claude daemon --helpline 12: service install is disabled, and the daemon runs on demand;claude respawn --help;claude agents --help(--json,--all).c8e2b81092b94b4b3ded2c86b40b8329e73b8f39b36acb3288bd56385bc83266(the same bytes as the 2026-10-14 read):claude respawn <id>restarts a session, running or stopped, and a session with a saved conversation resumes it;CHANGELOG.md(sha2560551b63e…): L794 (2.1.290) and L4147 (2.1.211), the respawn fixes.--user --scopeand systemd.kill(5)KillMode=(defaultcontrol-group): each respawn runs in its own scope.catalogs/landscape/foundation.json/layers/12, pinned at 255.4-1ubuntu8.17; this host runs 259.5-0ubuntu3.4):enable,disable --now,reset-failed,show -p LoadState/ActiveState;OnFailure=.apply.sh,MANUAL-INVERSE.md) and its simulationrun_sim_v6.sh(v6 PASS 16 FAIL 0, v5 PASS 9 FAIL 7): coordination records of 2026-10-15, cited by name and date. Both scripts port them.Evidence-class table
receipts/sources.jsonclaude respawnresumes a process-less row with a saved transcript on its own session id, from a non-interactive shell, and its process stays upreceipts/respawn-probe.jsoncase Sreceipts/respawn-probe.jsoncase Fsystemd-run --user --scopeboth outlive the unit and the session is listed with a process byclaude agents --jsonwith and without--allreceipts/respawn-probe.jsoncases U, U-scopetests/test_session_relaunch_install.pyreceipts/tests.jsontests/test_session_relaunch.pyBackgroundLocal commands run
Decision record
docs/decisions/2026-10-15-session-relaunch-install-and-inverse.md. It covers:Overturn: a release that relaunches sessions after a boot, which this tool would then defer to; or a clean reproduction of the respawn re-send, which would make the transcript gate a recorded upstream defect.
Host evidence
Not applicable: no
evidence/hosts/change.Follow-ups
stack-alert@template first, becauseinstall.shrefuses until it loads.plan-restartis labelled unplanned) belongs to the command center's restart checklist. The README states the command.Checklist
permissions: {}and grant each job only what it needs. (None changed.)🤖 Generated with Claude Code