Repository navigation
Console: a reloaded console keeps its HALT after the remote lifetime (#985) - #1001
Merged
Merged
Conversation
…985) Since #983 the server admits a halt carrying the session cookie and the halt token past the 12 h remote session lifetime, but /api/pulse - the only endpoint serving the token - keeps the lifetime, so a console reloaded after it drew no HALT button. Owner-approved design: the expired /api/pulse refusal (GET/HEAD only) carries #958's {halt_token, resume_command} when the request carries this session's cookie (KeelHandler._expired_pulse_halt, keyed on ApiRoute.halt_on_failure). Without the cookie it carries nothing extra. It is still a 403 "Session expired" with data null: no release, no setup write, no other read re-opened, no other endpoint serves the halt token, and the gates token is served nowhere (#968). Client: paint's data-null branch takes the HALT arm (pulseFailedView) before the 403 arm, branching on the presence of `halt`, never on the refusal's title. Docstrings that said a reloaded console cannot get the token are corrected; the #634 guard pin allows the `} else ` prefix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eaitbrahim
commented
Oct 13, 2026
eaitbrahim
commented
Oct 13, 2026
…halt's second caller (#985) The release POSTs passed by vacuum: the expired session refused them whatever token they carried, so a mutant serving gates_token survived. Assert the served token is the halt token and not the gates token, and that each release is refused by the expiry gate. pulse_halt's docstring now names _expired_pulse_halt as its second caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eaitbrahim
commented
Oct 13, 2026
eaitbrahim
commented
Oct 13, 2026
eaitbrahim
commented
Oct 13, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eaitbrahim
commented
Oct 13, 2026
This was referenced Oct 13, 2026
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.
Closes #985
What changes
Since #983 (PR #987) the server takes a halt carrying the session cookie and the halt token past the 12 h remote session lifetime on
keel serve --external-host, but/api/pulse, the only endpoint that serves the token, keeps the lifetime. So a console reloaded after the lifetime drew no HALT button.This follows the design the owner approved on the issue:
GET /api/pulsecarries Console: HALT should stay reachable when the Pulse payload fails to build #958's{halt_token, resume_command}(api.pulse_halt) when the request carries this session's cookie (KeelHandler._expired_pulse_halt, keyed onApiRoute.halt_on_failure, so it applies to Pulse only). Without the cookie, or with a wrong one, the refusal carrieshalt: null. Nothing else changes: it is still a 403 "Session expired" withdata: null. No release, setup write or other read is reopened, no other endpoint serves the halt token, and the gates token is served nowhere (Console: the HALT token served on /api/pulse also releases resume routes #968).do_GETis untouched.paint'sdata: nullbranch, the HALT arm (pulseFailedView) now comes before the 403 arm. It branches on whetherhaltis present, never on the refusal's title.server.py,security.py,gates.py,api.py,payload.py,api.js,render.js,actions.jsandmain.jsthat said a reloaded console cannot get the token. The An installed PWA cannot authorise itself after a serve restart — start_url carries no token #634 guard pin intest_pwa.pynow allows the} elseprefix and nothing else.Tests (TDD: written first, failed because
haltwasNone)halt: nulland no token in the body./api/*GET (13 routes plus the CSV export, with a count asserted):halt: null./api/pulseafter expiry:halt: null.data.halt_token, envelopehalt: null.paint, the halt arm comes before the refused arm, which comes before the stopped view. Each arm appears exactly once, andmain.jscontains no "Session expired" literal.Mutation checks (each on a saved copy, with a check that the source changed, then restored): dropping the cookie check, the method check, the route check, the
halt=argument orrefusal_document's pass-through, serving the gates token, a dead client arm, and a branch on the title. All of them were killed.Verification
node --checkis clean on main.js, render.js, api.js and actions.js.kill_switchreadtruefrom the database (opened read-only).halt: null.Known limit, unchanged by this PR: a browser with no cached shell is refused the page itself after the lifetime, so the refusal still names
keel kill.🤖 Generated with Claude Code