Repository navigation
fix(resume): stale-gist 404 must not silent-exit (closes #118) - #119
Merged
Merged
Conversation
When a joiner's saved room_gist_id refers to a gist that's been deleted (host teardown'd), the resume path's gist-probe runs 'gh api gists/<id>' under 'set -euo pipefail' with no '||' guard. A 404 — which is the EXPECTED signal that the host wiped the gist and we should self-heal — trips set -e instead. The script exits 1 silently, BEFORE the 404 classification + self-heal logic below it can run. The very signal the code uses to detect "gist gone" was also the trigger that killed the script before processing it. Symptom: 'airc canary && airc teardown && airc join' from the joiner side, after the host re-hosted, prints 'Resuming as joiner of...' and then exits 1 with no stderr in the user's event stream. Hit 2026-04-26 by vhsm-Claude during PR #116/#117 verification — wasted ~10 minutes thinking it was a Bug-3 self-heal regression before tracing to set-e on the gh api call. Fix: pre-declare '_gist_probe_rc=0' and use '|| _gist_probe_rc=\$?' on the 'gh api' line. set -e no longer trips on 404; the existing classification correctly self-heals into discovery for the saved room_name. Test: scenario_resume_404_gist_no_silent_exit synthesizes joiner state with a known-bogus gist_id and saved room_name, asserts neither silent-exit nor missing self-heal banner. Skipped when gh isn't authed or lacks gist scope (the gh-health gate would short- circuit before the bug fires). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Fixes airc connect resume behavior in room mode so that an expected GitHub gist 404 (deleted/rotated room gist) does not trigger set -e and silently terminate before self-heal logic can run.
Changes:
- Guard the
gh api gists/<id>probe in the resume path so non-zero (notably 404) is captured instead of aborting underset -euo pipefail. - Add an integration scenario that reproduces the stale/deleted
room_gist_idresume path and asserts “no silent exit” + 404 classification/self-heal messaging. - Wire the new scenario into the integration test runner modes and
all.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
airc |
Prevents set -e abort on expected gh api 404 by capturing the probe exit code for downstream classification/self-heal. |
test/integration.sh |
Adds resume_404_gist_no_silent_exit scenario and hooks it into the test runner to prevent regressions of the silent-exit resume bug. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 of 6 tasks
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.
Summary
Closes #118.
When a joiner's saved
room_gist_idrefers to a gist that's been deleted (host teardown'd), the resume path's gist-probe runsgh api gists/<id>underset -euo pipefailwith no||guard. A 404 — the EXPECTED signal that the host wiped the gist and we should self-heal — trips set -e instead. Script exits 1 silently before the 404 classification + self-heal can run. The signal we use to detect "gist gone" was also the trigger that killed the script before processing it.Hit 2026-04-26 by vhsm-Claude during PR #116/#117 verification:
airc canary && airc teardown && airc joinfrom the joiner after the host re-hosted producedResuming as joiner of...followed by silent exit-1, no stderr.Fix
Pre-declare
_gist_probe_rc=0+|| _gist_probe_rc=\$?on thegh apicall. set -e no longer trips on the expected 404; the existing classification (-ne 0 && stderr matches 404|not found) correctly self-heals into fresh discovery for the savedroom_name.Test plan
bash test/integration.sh resume_404_gist_no_silent_exit— 2/2 pass (no silent-exit, 404 self-heal banner fires). Skipped without gh+gist-scope.Saved room gist ... no longer on your gh — room dissolved or rehosted+ re-exec into discovery.Platform
||-rc-capture is POSIX-standard. No platform-specific change.🤖 Generated with Claude Code