Repository navigation
fix(qa): daemon bootstrap I/O error + 'airc msg @peer text' quoted-arg parse - #440
Merged
Merged
Conversation
…@peer text' quoted-arg parse Found by self-QA on the fresh-install path Joel asked about. Both hit first-time users + are quick fixes. ## #9: launchctl bootstrap "Input/output error" on macOS daemon install Pre-fix `airc daemon install` over an existing daemon (e.g., switching scopes or re-installing after a stale registration) emits: Wrote /Users/joelteply/Library/LaunchAgents/com.cambriantech.airc.plist Bootstrap failed: 5: Input/output error Try re-running the command as root for richer errors. ERROR: launchctl bootstrap failed. Plist written but not loaded; check Console.app for errors. Then `die`s. But the plist file IS written + the service IS often loaded (launchd's "Input/output error 5" is actually "service already loaded" — bootstrap's stderr lies). Two real bugs: 1. bootout (line 200) doesn't wait for the previous PID to fully exit before bootstrap fires. Result: launchd sees "service still loaded" → bootstrap fails. 2. die() on bootstrap stderr alone is wrong — verify by checking `launchctl list` for the service. If listed, success regardless of stderr noise. Fix: - After bootout, poll `launchctl list` for up to 3s (6×500ms) until the service disappears. - Bootstrap with stderr captured (don't die on it). - Verify by `launchctl list` post-bootstrap. If listed → success. If not → die loud with the captured stderr. This makes daemon install idempotent + reliable across re-installs, which matters for fresh-install confidence + scope-switching workflow. ## #10: 'airc msg "@peer some text"' rejected as invalid peer name Pre-fix the strict charset reject in cmd_send.sh:163 fired when the user quoted the @peer + body together: $ airc msg "@continuum-b69f comms check" ERROR: Invalid peer name in '@continuum-b69f comms check' — must match [a-z0-9-]+ ... Strict parsing assumed `airc msg @peer "body"` (separate args). Common UX intuition (and IRC clients like /msg) accept the single- quoted form as a single line. The reject was correct for safety but unfriendly. Fix: pre-process $@ before the parse loop. If $1 starts with @ AND contains whitespace, split on first whitespace — front becomes the @-peer arg, back becomes the start of the message body. Then the existing loop processes them as if they'd been separate args. Verified: 'airc msg "@peer text"' now passes the @-parse step and proceeds to send (or hits a downstream init/scope error, which is fine — proves the parse changed). Original separate-args form ('airc msg @peer "text"') still works. ## Verification - `bash -n` clean on both modified files - #10 reproduced + fixed: parse error gone ## Pairs with - #422 (canary→main — keep clearing first-time-user bugs) - #439 (deeper-QA fixes — same QA pattern) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Two fresh-install bugs caught while answering Joel's 'is daemon clean for new installs?' question.
launchctl listinstead of trusting stderrairc msg "@peer some text"(quoted single-arg) rejected as invalid peer nameWhy both matter for fresh installs
/msg peer textis a single line). Strict parsing was correct for safety, hostile for first-use.Verification
bash -ncleanPairs with
🤖 Generated with Claude Code