Skip to content

fix(join skill): auto-trigger gh auth login instead of dumping a manual command on the user - #352

Merged
joelteply merged 1 commit into
canaryfrom
fix/join-skill-auto-trigger-gh-auth
Apr 30, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/join-skill-auto-trigger-gh-auth

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Carl on a fresh tab tried /join, hit gh auth invalid, and saw the agent dump:

Run this in the prompt (the ! prefix runs it in this session so output lands here):

! gh auth login -h github.com -s gist

Joel had to close Claude and re-auth manually. install.sh already does the auto-trigger when stdin is TTY (via #339) — the skill just had stale text saying "install + gh auth login" without telling the agent to RUN it.

Change

Updated skills/join/SKILL.md section 1:

  • Spell out the auto-trigger pattern explicitly: agent runs gh auth login -h github.com -s gist -p https -w itself via Bash. The -h/-p/-w flags skip every interactive prompt; -w uses the browser device code; gh blocks until the user completes auth in the browser → Bash blocks with it → success returns → agent continues to airc join.
  • Note device-code-line surfacing — Bash output buffering can hide the First copy your one-time code: XXXX-XXXX line if the agent isn't deliberately quoting it back to the user.
  • Add the rate-limit-vs-real-auth pre-flight (mirrors the cmd_connect.sh fix from fix(gh): distinguish secondary rate limit from auth failure + skill scope-doc correction (#341) #344): probe gh api rate_limit first; if reachable, the token is fine and gh is misreporting a secondary-rate-limit 403 as 'token invalid'. Tell the user to wait, not re-auth.

Why it's doc-only

Skills are markdown — the file IS the agent's runtime prompt. Updating it changes behavior on the next /join invocation across every Claude Code session that picks up the new skill (via airc update or fresh install). No code change needed.

Caught from

Joel's two-tab cross-machine test on the QA rig — second Claude tab tried /join, told user to re-auth, user had to close Claude. The skill should mirror what install.sh already does.

Test plan

  • Fresh Carl tab where gh keyring token has been revoked → /join triggers gh auth login automatically; user clicks browser link; auth completes; airc join proceeds — no "close Claude and re-run" friction
  • Same scenario but during a secondary-rate-limit cooldown → /join says "GitHub rate-limited, wait 5-15 min" instead of triggering an unneeded re-auth
  • Agent shows the device-code line prominently (not buried in Bash output)

🤖 Generated with Claude Code

Carl on the other tab tried /join, hit 'gh auth invalid', and saw the
agent dump 'Run this in the prompt: ! gh auth login -h github.com -s gist'
back at them. Joel had to close Claude and re-auth manually. install.sh
already does this auto-trigger when stdin is TTY (via #339); the skill
just had stale text saying "install + 'gh auth login'" without telling
the agent to RUN it.

Updated /join SKILL.md section 1:
- Spell out the auto-trigger pattern explicitly: agent runs
  `gh auth login -h github.com -s gist -p https -w` itself via Bash.
  -h/-p/-w skip every interactive prompt; -w uses browser device code;
  gh blocks until the user completes auth in the browser → Bash blocks
  with it → success returns → agent continues to airc join.
- Note device-code-line surfacing — Bash output buffering can hide it
  if the agent isn't deliberately quoting it back to the user.
- Add the rate-limit-vs-real-auth pre-flight (mirrors the cmd_connect.sh
  fix from #344): probe `gh api rate_limit` first; if reachable, the
  token is fine and gh is misreporting a secondary-rate-limit 403 as
  'token invalid'. Tell the user to wait, not re-auth.

Doc-only — no code change. The skill text is the agent's runtime
prompt; updating it changes behavior on the next /join invocation
across every Claude Code session that picks up the new skill.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@joelteply
joelteply merged commit be6d6d5 into canary Apr 30, 2026
6 checks passed
@joelteply
joelteply deleted the fix/join-skill-auto-trigger-gh-auth branch April 30, 2026 01:03
joelteply added a commit that referenced this pull request Apr 30, 2026
…ebug session (#353)

Previous fix (#352) added a 'pre-flight diagnose' step that the agent
narrated to the user — Carl typing /join saw 'running gh api rate_limit
... token is actually fine ... issue #341 case ... proceeding with
join'. That looks like a bug. The diagnose should be a silent gate, not
a story the user sits through.

Reframed the section: don't pre-flight at all. Just run airc join. If
airc itself surfaces a gh-auth message (rate-limited / token invalid /
auth invalid), react minimally:

- 'rate-limited' → tell user verbatim, do nothing else (airc already
  disambiguated via #344's cmd_connect.sh pre-flight; re-probing is
  redundant and chatter)
- 'token invalid' → run 'gh auth login -h github.com -s gist -p https -w'
  silently, surface only the device-code line for the user, then retry
- 'gh missing' → install + auth, one short line, proceed

The principle stated explicitly: Carl running /join should see airc
events + outcomes, not auth-handling internals. Internal disambiguation
silent; user-actionable result one short sentence.

Joel caught this on the 2-tab cross-machine test minutes after #352
landed — the agent dutifully followed #352's instructions, ran the
narrated pre-flight, and produced exactly the "looks like a bug"
output Carl shouldn't see.

Co-authored-by: joel <[email protected]>
Co-authored-by: Claude Opus 4.7 (1M context) <[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