Optional: announce a SIGKILLed claude from the launch line (the #177c wrapper, descoped) #194
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lz/agent-nexus#194
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Split out of #177. #177c shipped the floor — server-side claude liveness, observed in the exec pass
convergeSessionsalready makes (probeLiveClaudeCwds->sessions.claude_alive). This issue is the latency optimisation that was originally specified in its place, kept because it is still defensible and because the measurements below should not have to be redone.What is already covered, and by what
/exit, logoutSessionEndhookSessionEnd, reasonotherSessionEnd, reasonotherSessionEnd, reasonotherclaude_aliveobservationclaude_aliveobservationSo the gap a launch-line reporter would close is latency on the bottom two rows, bounded today by
RESYNC_INTERVAL_MS(60s).Measured, against the installed claude 2.1.278 — do not re-derive
SessionEndis not graceful-exit-only.shutdown(e = 0, n = "other", r)awaitsexecuteSessionEndHooksbeforeforceExit;process.on("SIGTERM")->shutdown(143, "other"), SIGHUP ->shutdown(129),uncaughtException->shutdown(1). Driven end to end: a realclaude --printSIGTERM'd at 6s exits 143 and writes{"hook_event_name":"SessionEnd","reason":"other"}.otheris already in the plugin's matcher. Negative control: SIGKILL at 1.2s fires nothing. AGENTS.md fact #26 has been corrected.$?carries the code./bin/sh -c "cd $W && claude ...; echo WRAPPER_SAW=$? >> log"gaveWRAPPER_SAW=0on a clean run andWRAPPER_SAW=137underkill -9, with no SessionEnd file in the second case.spawnSessionPanealready passes['/bin/sh', '-c', launchCmd]as argv, and"$?"inside a JS template literal is literal.restartSession(stop and restart, bothrespawn-window -k),closeWorkspaceSession,openWorkspaceSessiononto an existing window,deleteSession(kill-window), container stop/kill (PID 1 isexec tmux attach, so the daemon SIGKILLs the rest), tmux server death, and Nexus being unreachable./usr/local/bin/nexus-report-exitgives onenot foundline on the pane's stderr; the wrapper continues toexec bashand exits 0. Visible on every session of every un-recreated workspace until the image release lands.pane-diedhook is not a substitute. Withremain-on-exit onit does deliver the code (pane_dead_status=137) and the window stays inlist-windows, so convergence is undisturbed — butrun-shelldoes not inherit the window's-eenvironment, soNEXUS_SESSION_IDis unset and the hook cannot say which session died.spawnSessionPanesets that per window precisely for attribution. It would also cost dropping; exec bash.Three things to get right
rc=$?BEFORE any guard command. Reversed,command -vresets$?and every crash reports 0 — silently.SessionEndaccounted for it", never "exit code non-zero". 143 and 129 are orderly shutdowns that already wroteattention_state='ended'; overwriting that with a fault paints a deliberate stop as a crash, which is the distinction fact #26 exists to keep.AGENT_CALLBACKS(fact #23) or every report 401s at the gate while the producer swallows the status — how the attention feature shipped dead once already.hooks.server.test.tswalkssrc/routes/api/agent/in both directions, so adding the route tells you if you forgot.Cost
A worker image release, which is owed anyway (
worker/entrypoint.shchanged in #184). Check whether #183 is close enough to release once for all of them.Not worth doing if
The 60s resync is fast enough for a SIGKILLed agent. It probably is for a single operator — which is why this is filed rather than built.