Skip to content

fix(update skill): seamlessly bounce monitor onto new code — no tab close required (#354) - #356

Merged
joelteply merged 1 commit into
canaryfrom
fix/airc-update-auto-restart-monitor-354
Apr 30, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/airc-update-auto-restart-monitor-354

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Joel's pain on the QA rig today, exact words: "having to close out of all claudes is a major point of friction, for every update. people keep these running all the time."

The old /update skill explicitly told the agent: "Leaves the running monitor untouched; report the new SHA and tell the user to teardown + connect to pick it up." That's the friction. Every airc update meant the user had to either close + reopen each Claude Code tab (lose context) or rote-remember to run airc teardown && airc join in each tab.

Change

Rewrites the /update skill so the agent does the full lifecycle itself, in-session, without user action:

  1. Run airc update; capture before/after SHA.
  2. If SHA changed: TaskStop the Monitor task this session armed for /join. (If task id is lost, fall through — airc teardown reaps by PID file regardless.)
  3. Run airc teardown — kills current scope's processes; preserves identity + peers + log + saved channel.
  4. Re-arm Monitor with airc join — new bash process loads the just-pulled binary fresh from disk.
  5. ONE short sentence to the user: "Updated to <sha>; monitor bounced onto new code." Don't narrate the lifecycle steps.

Net: "Updated, mesh blips for ~5s while host re-elects, you're back on the new code in the same tab" replaces "go close every tab."

Skill text changes are called out separately

Skill .md changes genuinely DO require a tab restart — the agent's prior reasoning in the conversation is locked-in from the old skill behavior, and Claude Code may session-cache the skill prompt. The skill instructs the agent to surface a single explicit hint when it sees changed SKILL.md files in airc update's output. That's the one piece of manual user action that remains, and it's surfaced explicitly so the user knows.

Tradeoffs

  • Monitor added to allowed-tools (was Bash-only). Necessary for the re-arm step.
  • Brief mesh blip (~5s) while the host re-elects after teardown. Peers see host disappear briefly, then reappear. Acceptable cost vs "close every tab".
  • Only the current scope is auto-bounced. Other tabs in different scopes still need their own /update. Same daemon-respawn semantics apply (with airc daemon install, the system respawns automatically).
  • AIRC_UPDATE_NO_BOUNCE=1 env var added as a power-user knob to opt out (e.g. for scripted batch updates where the caller will handle restart timing).

Relationship to #354

Complements but doesn't supersede #354's airc-binary-side hint. The binary side is for users running airc update directly from a shell; this skill side is for users invoking /update inside Claude Code. Both should land — the binary hint is still being filed as a separate small PR.

Test plan

  • In a tab on canary tip, run /update after a fix lands → agent runs airc update → SHA changes → agent silently teardowns + re-arms Monitor → user sees ONE line "Updated to <sha>; monitor bounced." and no manual action needed
  • Same flow when SHA didn't change → agent reports Already at <sha> and does nothing else
  • When update changed SKILL.md files → agent surfaces the explicit "close + reopen this tab" hint in addition to the bounce
  • AIRC_UPDATE_NO_BOUNCE=1 /update → agent skips the bounce, falls back to the warning-only behavior
  • Live: re-test on the QA rig that triggered the original pain (i.e. open a tab, /update, see no friction)

🤖 Generated with Claude Code

…lose required (#354)

Joel's pain: 'having to close out of all claudes is a major point of
friction, for every update. people keep these running all the time.'

The old /update skill explicitly told the agent: 'Leaves the running
monitor untouched; report the new SHA and tell the user to teardown +
connect to pick it up.' That's the friction. Every airc update meant
the user had to either:

- close + reopen each Claude Code tab (lose context, lose any in-flight
  conversation), or
- mentally remember to run 'airc teardown && airc join' in each tab
  (rote, easy to forget, splits the agent's thread)

Rewrites the /update skill so the agent does the full lifecycle itself,
in-session, without user action:

1. Run airc update; capture before/after SHA.
2. If SHA changed: TaskStop the Monitor task this session armed for
   /join. (If task id is lost, fall through — airc teardown reaps by
   PID file regardless.)
3. Run airc teardown — kills current scope's processes; preserves
   identity + peers + log + saved channel.
4. Re-arm Monitor with airc join — new bash process loads the just-
   pulled binary fresh from disk.
5. ONE short sentence to the user: 'Updated to <sha>; monitor bounced
   onto new code.' Don't narrate the lifecycle steps.

Net: 'Updated, mesh blips for ~5s while host re-elects, you're back on
the new code in the same tab' replaces 'go close every tab.'

Skill text changes are called out separately — those genuinely DO
require a tab restart because the agent's prior reasoning in the
conversation is locked-in from the old skill behavior, and Claude
Code may also session-cache the skill prompt. The skill instructs
the agent to surface a single explicit hint when changed SKILL.md
files are detected in the update output. That's the one piece of
manual user action that remains.

Adds Monitor to allowed-tools (was Bash-only). AIRC_UPDATE_NO_BOUNCE=1
env var added as a power-user knob to opt out of the auto-bounce.

This complements but doesn't supersede #354 (airc-binary-side hint
about skill restart). The binary side is for users running airc
update directly from a shell; the skill side is for users invoking
/update inside Claude Code.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit 735ee49 into canary Apr 30, 2026
6 checks passed
@joelteply
joelteply deleted the fix/airc-update-auto-restart-monitor-354 branch April 30, 2026 01:28
joelteply added a commit that referenced this pull request Aug 13, 2026
…B check on the trait (#356) (#1354)

The auto-close-queue-cards workflow has failed on every merge since ~Aug 5. Two
breaks: it invokes `./airc`, a repo-root dispatcher that no longer exists, and it
calls `queue close-merged <PR_URL> --merge-sha --actor`, a verb shape that exists
in NO form. The CLI has only two file-based primitives (CloseMergedMeta,
CloseMergedRefs) which take `gh pr view` JSON and close nothing; the composing
layer died with the dispatcher.

Joel's ruling: rebuild it in Rust, not workflow bash — "these shell boundaries are
fragile". The repo already agreed. airc_lib::gh::client owns a GhClient TRAIT,
ShellGhClient confines the `gh` spawn, and ReqwestGhClient does direct REST. The
YAML was the one caller routing around all of it.

This is slice 1, and deliberately ONE verb. Per CLAUDE.md's methodical process:
build outlier A + outlier B, prove the interface fits both WITHOUT forcing, write
the generator/pattern, then STOP. Every existing verb is PR-shaped; issue_view is
the first that addresses an issue and the first that treats free-form body content
as the payload. If GhClient only fit PRs, this is where it would have to be forced.
It is not — issues reuse repo+number addressing and the same GhError classification
— so issue_edit_body and issue_close are the same pattern and are NOT built until a
caller needs them.

The slice surfaced a real divergence the trait was hiding: the two backends
disagree on the same field. gh's CLI is GraphQL-backed and reports OPEN/CLOSED;
REST reports open/closed, and REST also sends `body: null` where the CLI sends "".
Left alone, the closer's idempotence check ("already closed? skip") would silently
depend on which backend was configured, and a bodyless issue would abort the run
via serde rather than being skipped. Both are normalized in ONE place
(parse_issue_view), so the impls are genuinely interchangeable — which is the
property the trait exists to provide.

Implemented across all three impls (Shell, Reqwest, Mock) since a trait method
lands in every one.

Gates: cargo fmt --check clean, clippy -D warnings clean, airc-lib 347 tests
(+2 new), airc-cli 345 tests, all green.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Fable 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant