Repository navigation
desk-hub deploy: an interrupted run removes its lock, the prompt stays interruptible, the staging stop line names its cause, production-run.sh's default path - #308
Merged
Conversation
…min prompt reads /dev/tty without blocking the loop; the lock refusal says when its holder is gone; the staging run's stop line names the cause withRunLock installs SIGINT, SIGHUP and SIGTERM handlers while any lock is held: each lock still this process's (by its token) is removed and the process exits 128+n; the handlers go once no lock is held. Node's default action had skipped the finally, so an admin pair interrupted in its pending wait left keys.json.org.json.lock behind. With a handler installed, a signal at a blocking readSync of /dev/tty was held until a byte came (libuv's SA_RESTART), so Ctrl-C at the approve prompt did nothing until Enter. The terminal (now deploy/terminal.ts) reads /dev/tty through its own non-blocking descriptor, polled every 50 ms. A refused lock whose holder is on this host and whose pid no longer exists says so; removal stays manual. The staging phone run's stop line follows the error's cause chain (code and message, four levels), cutting every URL and query string. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…p, so its dashes stay dashes
Under zsh 5.9, ${${1:-$HOME/.local/share/maws-desk-deploy}:A} leaves zsh's internal Dash token (0x9b) for every '-' of the default word, so checkout with no path named .../maws\x9bdesk\x9bdeploy and git worktree add refused it (Illegal byte sequence). Found in the production rollout, where the owner works around it by passing the path explicitly. The only such shape in the repository; a test evaluates the step's own assignment under zsh byte for byte, and another reads every deploy script for a nested default given a modifier.
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
openTerminal(false) still passed stdin to a blocking readSync, so with the run lock's handlers installed a Ctrl-C or SIGTERM at a local admin prompt waited for input and the lock stayed (review round 1, P2). A terminal on stdin is now read as /dev/tty through its own non-blocking descriptor, as a deployment's is; a pipe or a file through Node's stream, what follows a line unshifted for the next reader. The end of input waits one poll before it returns, so a hung-up terminal's SIGHUP is handled before an empty answer is acted on. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…again Review round 2 (two P2s): reading a pipe through process.stdin set O_NONBLOCK on the open file description a parent or sibling shares, and the unshifted rest of a chunk stayed inside this process, out of the next reader's reach. A pipe or file on the local hub's stdin goes back to the blocking byte-by-byte readSync of fd 0; terminals keep /dev/tty through a non-blocking descriptor of their own. The accepted limit, in terminal.ts: a signal while a piped prompt waits on an empty pipe is handled at the run's next turn of the loop once input comes. Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
SSFSKIM
added a commit
that referenced
this pull request
Oct 28, 2026
…s cancel flake fixed (O8) Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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.
desk-hub deploy: an interrupted run removes its own lock; the prompt stays interruptible; the staging stop line names its cause; production-run.sh's default checkout path.
These are follow-ups to P5 O13 M7. All four were found during the owner's staging sitting and production rollout.
1. A run ended by a signal removes its own lock (
deploy/run-lock.ts)Before: an
admin pairinterrupted during its 600 s pending wait, by Ctrl-C or a closed terminal, died through Node's default signal action. That skipsfinally, sokeys.json.org.json.lockstayed behind and the owner had to remove it by hand.Now: while any lock is held,
withRunLockinstalls one set of SIGINT, SIGHUP and SIGTERM handlers. They remove every lock this process holds, matched by token, and exit with 128 plus the signal number. The handlers come off when the last lock is released. A stale lock is still never taken over.The refusal message: when the holder is on this host and its pid is gone, the refusal says so:
pid N on H is gone: remove the file once you've checked no run is going. Removal stays manual.The blocking prompt. The concern was a confirmation that read /dev/tty with a blocking
readSync. A python pty experiment confirmed it:fs.readwas rejected: with a threadpool read pending,process.exithangs.The fix, in the new
deploy/terminal.ts, whichadmin.tsnow imports:2. The staging run's stop line names its cause (
test/endpoint/staging/run.ts)Before: the first owner run,
own1, stopped on a barethe run stopped: fetch failed.Now:
stopLinefollows thecausechain up to four levels, showing each level's code and message, then…. URLs and query strings are stripped at every level, and no headers or bodies are printed.3. production-run.sh's default checkout path (
deploy/production-run.sh:75)This was found in the owner's production rollout. The owner is working around it by passing the path explicitly.
P=${${1:-$HOME/.local/share/maws-desk-deploy}:A}. Under zsh 5.9, when the default word is used, the nested:Akeeps zsh's internal Dash token (0x9b) in place of each-.git worktree addthen fails with "Illegal byte sequence".P=${1:-…}; P=${P:A}.apps/desk-hub/deploy/*.shandtest/endpoint/staging.Validation Evidence
apps/desk-hub/test/deploy/run-lock.test.ts: 25/25, three runs in a row. It covers spawned children holding the lock and signalled, the pty prompt cases on a deployment terminal and a local TTY, a piped prompt leaving the next reader's bytes on fd 0, O_NONBLOCK still clear on the inherited pipe, and the empty-pipe limit.test/deploy/without production-scripts: 215/215.test/endpoint/staging/pieces.test.ts: 19/19.pnpm typecheckand eslint on the touched files are clean.--gates static,unit,probes --class1a pool --label o13-runlock-3, GREEN, run 40739163857. On Linux, run-lock.test.ts ran 25 tests and production-scripts.test.ts ran 52.src/mawsd/cli-prompt.test.ts:131, outside this branch. That is a race in that test:hiddenPromptwrites the question beforesetRawMode(true), and the test readsstty -aas soon as the question appears. It passed on the next run.Residue
src/mawsd/cli-prompt.test.ts:131races its own prompt. It readsstty -abeforesetRawMode(true)has run. The fix is to set raw mode before writing the question, or to have the test wait for-echo.Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)