Repository navigation
activate: reset gh cooldown on explicit /sk-activate - #39
Conversation
…tivate trySilentGhActivate writes a 24-hour cooldown to credentials.json on FAILURE_COOLDOWN paths: gh missing, empty token, HTTP 4xx from the activation endpoint, or malformed JSON. The cooldown is then checked at the top of the same function and short-circuits subsequent calls. The cooldown was designed to protect automated hook paths from hammering GitHub / the activation endpoint on every event. Since PR #35 no hook calls trySilentGhActivate — only activate.js does, and activate.js is always a deliberate user action triggered by /sk-activate. Consequence: if a user's `gh auth` scopes are wrong the first run writes a 24h cooldown. The user fixes `gh auth refresh --scopes read:user,read:org` and re-runs /sk-activate immediately. Silent is skipped for the next 24h, so activation is forced through the device flow every time, even though silent would now succeed. Fix: call credstore.setGhFallbackRetryAfter(0) at the top of activate.js::main(), right before trySilentGhActivate. The helper already deletes the key entirely when called with 0. Verified: - node -c activate.js — syntax clean - Prime cooldown to now+86400, call setGhFallbackRetryAfter(0), confirm getGhFallbackRetryAfter() returns 0 and the gh_fallback_retry_after key is absent from the on-disk JSON. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe activation flow now clears the GitHub fallback cooldown immediately after validating the device ID and before attempting silent activation, rather than only after successful license exchange. This prevents cached cooldown values from affecting silent activation retries within the same activation attempt. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
`trySilentGhActivate` writes a 24-hour FAILURE cooldown to `credentials.json` on common fail paths — gh missing, empty token, HTTP 4xx from the activation endpoint, malformed JSON. That cooldown is checked at the top of the same function and short-circuits subsequent calls.
It was designed to protect automated hook paths from hammering GitHub and the activation endpoint on every event. After #35 no hook calls `trySilentGhActivate` anymore — only `activate.js` does, and that is always a deliberate user action triggered by `/sk-activate`.
Concrete bad UX:
Change
Single line in `skillmeter/scripts/activate.js::main()`: call `credstore.setGhFallbackRetryAfter(0)` right before `trySilentGhActivate`. The helper already deletes the key entirely (credstore.js:169-173) when called with 0, so no new API surface.
Not touched:
Verified
🤖 Generated with Claude Code
Summary by CodeRabbit