docs(onboarding): gate Step 6.2 watch check on notifications token scope#333
docs(onboarding): gate Step 6.2 watch check on notifications token scope#333serenakeyitan merged 2 commits intomainfrom
Conversation
…scope Fixes #332. `gh api /repos/<repo>/subscription` returns 404 for every repo when the user's token lacks the `notifications` OAuth scope — which default `gh auth login` does not grant (`admin:org, gist, repo, workflow`). An agent following Step 6.2 on a default token would: 1. Run the check → get 404. 2. Conclude "not watching," tell the user to click Watch. 3. User already is watching, clicks again, refreshes, reruns → still 404. 4. Stuck. Change: - Step 6.2 now checks `gh auth status` for the `notifications` scope first; if missing, instructs the user to run `gh auth refresh -h github.com -s notifications` (interactive) and wait for confirmation. - Pitfalls section gains a bullet explaining the 404-without-scope trap, so agents that skim ahead still catch it. Discovered during v0.2.15 onboarding test.
yuezengwu
left a comment
There was a problem hiding this comment.
The new scope gate still has a false-positive path: gh auth status 2>&1 | grep -i 'notifications' is not scoped to the active github.com account. On setups with multiple hosts or multiple stored accounts, that grep can match a different host/account that has the scope, so the agent skips the refresh and lands back in the same /subscription 404 loop for the account it is actually using. Please scope the check to the active github.com auth context (for example gh auth status --active --hostname github.com 2>&1 | grep -i 'notifications') and mirror that wording in the pitfalls note.
This reply was drafted by breeze, an autonomous agent running on behalf of the account owner.
| watching or not: | ||
|
|
||
| ```bash | ||
| gh auth status 2>&1 | grep -i 'notifications' |
There was a problem hiding this comment.
This check is too broad for the problem you’re trying to solve. gh auth status reports all known hosts and, on a host, can include multiple stored accounts; a plain grep can succeed on some other host/account that has notifications while the active github.com account still lacks it. In that case the agent would skip the refresh and the later /subscription call would still 404. Please scope the probe to the active github.com auth context, e.g. gh auth status --active --hostname github.com 2>&1 | grep -i 'notifications'.
…m account Addresses review feedback on #333. On gh setups with multiple hosts or multiple stored accounts, a bare `gh auth status | grep notifications` can match a scope on a different host/account than the one `gh api` will actually use, letting the agent skip the refresh and loop back on the same 404. Change both the Step 6.2 check and the Pitfalls bullet to use `gh auth status --active --hostname github.com` so the grep only sees the active github.com account's token scopes.
|
Thanks — good catch. Pushed 045ad06 scoping both the Step 6.2 check and the Pitfalls bullet to |
yuezengwu
left a comment
There was a problem hiding this comment.
LGTM — 045ad06 scopes both the Step 6.2 check and the Pitfalls bullet to gh auth status --active --hostname github.com, which closes the multi-host / multi-account false-positive path. Thanks for the quick turnaround.
This reply was drafted by breeze, an autonomous agent running on behalf of the account owner.
## Summary Docs-only patch release so npm users get the updated onboarding narrative bundled into `first-tree tree help onboarding`. Unreleased since v0.2.15: - #333 — gate Step 6.2 watch check on notifications token scope (fixes #332) ## Test plan - [x] `pnpm release:check` green locally (version:check, validate:skill, typecheck, test, build, test:dist, test:release)
Fixes #332.
Problem
gh api /repos/<repo>/subscriptionreturns 404 for every repo when the user'sghtoken lacks thenotificationsOAuth scope — which defaultgh auth logindoes not grant (typical scopes areadmin:org, gist, repo, workflow). An agent following Step 6.2 on a default token would:Change
Step 6.2 now:
gh auth status | grep notificationsfirst.gh auth refresh -h github.com -s notifications(interactive) and waits for confirmation./subscriptioncheck.Also added a Pitfalls bullet so agents skimming ahead still catch the trap.
Test plan
skills/first-tree/references/onboarding.md.Discovered during v0.2.15 onboarding test.