[PR #8986] fix(opencode): add oauth polling safety margin in copilot device authentication #12937

Closed
opened 2026-02-16 18:17:49 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8986

State: closed
Merged: Yes


What does this PR do?

Fixes https://github.com/anomalyco/opencode/issues/8552

  • Add 3-second safety buffer to all OAuth polling intervals
  • Handle slow_down errors by increasing interval per RFC 8628 spec
  • Prevents clock skew/timer drift issues in VMs/WSL with fast monotonic clocks

Inspired by conversation over in this ticket https://github.com/cli/cli/issues/9370 and the changes they've made to fix gh cli here: https://github.com/cli/oauth/compare/main...wm/add-interval

How did you verify your code works?

I tested it and was able to authenticate with github device flow - was unable to do so previously

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8986 **State:** closed **Merged:** Yes --- ### What does this PR do? Fixes https://github.com/anomalyco/opencode/issues/8552 - Add 3-second safety buffer to all OAuth polling intervals - Handle `slow_down` errors by increasing interval per RFC 8628 spec - Prevents clock skew/timer drift issues in VMs/WSL with fast monotonic clocks Inspired by conversation over in this ticket https://github.com/cli/cli/issues/9370 and the changes they've made to fix `gh cli` here: https://github.com/cli/oauth/compare/main...wm/add-interval ### How did you verify your code works? I tested it and was able to authenticate with github device flow - was unable to do so previously
yindo added the pull-request label 2026-02-16 18:17:49 -05:00
yindo closed this issue 2026-02-16 18:17:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12937