Repository navigation
fix(cmd_connect): fall back to host channel when intent bootstrap fails - #536
Conversation
Pre-fix the JOIN MODE diverged-intent path (user wants channel A, host's mesh advertises channel B) called `ensure_channel_subscribed_with_gist` on the user's intent FIRST and `die`'d the entire join when that one call failed (cmd_connect.sh:1496). The host's channel was warning-only when it failed (line 1498), so the asymmetry made one recoverable hiccup fatal while leaving the actual failure mode it should have guarded against silent. Observed in the wild today (continuum-8e97 on Windows): Found mesh on your gh account → joining (df40c8ae...) Resolving gist df40c8ae... ... ✓ Resolved invite from gist. ✓ Multi-address pick: 192.168.1.223:7547 (from host.addresses) ⚠ Could not resolve gist for #general: ERROR: Could not bootstrap #general; refusing to join with broken state The user's auto-scope intent was #general; host advertised #cambriantech. #general gist resolution hiccupped (gh API path returned empty without stderr — likely transient sub-bucket throttling on a busy session). The mesh was reachable. The host's channel was reachable. There was no reason to refuse the join — but `die` exited 1 with no recovery. Same shape as the two recently-fixed identity leaks (#511/#521/#534): a single recoverable failure mode hard-coded as fatal, surfacing as an inexplicable airc exit. Fix: try both intent and host channels, fall back to whichever bootstraps. Joined-mesh / joined-intent-only / joined-host-only-fallback are the three success paths; only `die` when BOTH are gone (no viable subscription either way). Adds AIRC_TEST_FAIL_ENSURE_CHANNEL — a test-only env hook the structural regression scenario uses to deterministically lock in the fix without needing a real gh-rate-limit reproducer. Behavioral coverage is limited by the integration suite's offline constraints (the diverged path requires a real gist), so the scenario is structural: parses clean, hook is wired, fallback message present, the unconditional intent die is gone. Manual reproducer at /tmp/repro.sh. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Codex review pass: the fallback direction is right, but I found one load-bearing gap and pushed a hardening commit ( Issue: the PR originally tried the host channel fallback by calling Fix pushed: preseed Validation after my commit:
LGTM from Codex with that patch included. Watching CI next. |
Summary
cmd_connect's JOIN MODE diverged-intent path (user wants channel A, host's mesh advertises channel B) calledensure_channel_subscribed_with_giston the user's intent FIRST anddie'd the entire join when that one call failed (cmd_connect.sh:1496). The host's channel was warning-only when it failed (line 1498). The asymmetry made one recoverable hiccup fatal.Observed today on continuum-8e97 (Windows):
User's auto-scope intent was #general; host advertised #cambriantech. #general gist resolution hiccupped (gh API returned empty stdout with no stderr — likely transient sub-bucket throttling). The mesh was reachable. The host's channel was reachable. No reason to refuse the join.
Same shape as the two recently-fixed identity leaks (#511 / #521 / #534): a single recoverable failure mode hard-coded as fatal, surfacing as an inexplicable airc exit.
Fix
Try both channels; fall back to whichever bootstraps. Three success paths:
_intentresolved_room_namedie— no viable subscriptionTest
Adds
scenario_join_intent_failure_falls_back_to_hosttotest/integration.sh. Coverage is structural — full behavioral coverage of the diverged path requires a live gh account + room gist fixture, out of scope for offline integration tests. The scenario locks in:cmd_connect.shparses cleanAIRC_TEST_FAIL_ENSURE_CHANNELis wired (lets future tests force the failure path deterministically)die(refusing to join with broken state) is goneLocal run on Windows WSL2 (canary base):
Related
--attachidentity leak🤖 Generated with Claude Code