Repository navigation
fix(packager): end the session command with exit "$status" - #61
Merged
Merged
Conversation
67f4176 folded the `exit "$status"` line into a comment, so the generated start-auto-reply-session.command ended at `status=$?` and always exited 0 whatever the watchdog returned. Put the line back and pin the behavior with a test that runs the command against a stub Python exiting 7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Decision: merge. Evidence:
|
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.
Why
The goal is to leave twoimo/alden with no open PRs or issues, each one resolved on its merits. Reviewing the launchd runbook fix turned up a packager defect, and this PR fixes it.
scripts/prepare-auto-reply-session-runtime.pywritesstart-auto-reply-session.command, the file the session monitor'sauto-reply-host --tickstarts with/bin/sh. Commit67f4176("fix: stop macOS permission prompts on every host restart") merged the"exit \"$status\"\n"string literal into the end of a#comment line, so Python dropped it. The generated command ended atstatus=$?, and a shell script that ends with an assignment exits 0. The launcher therefore reported success whatever the watchdog returned.Impact
Today nothing reads that exit status: the tick spawns the command and does not wait. The fix stops the launcher from hiding a failed watchdog from anything that does read it later, such as a
launchctljob status or a manual run. The change reaches the host only at the next bake, which writes a new command and a new digest-pinned manifest.Verification
tests.test_auto_reply_session_packager.SessionRuntimePackagerTests.test_session_command_exits_with_the_watchdog_statusstages a runtime with a stub Python that exits 7, runs the generated command with/bin/sh, and expects 7. Before the fix it fails withAssertionError: 0 != 7. After the fix it passes.python3.11 -m unittest tests.test_auto_reply_session_packagerpasses all 12 tests.tests.test_auto_reply_menubarerrors withfrozen_menubar_missingon main too. CI documents that it cannot run on a fresh checkout.🤖 Generated with Claude Code