Skip to content

Conversation

@roshan-c
Copy link
Contributor

@roshan-c roshan-c commented Dec 27, 2025

This PR adds full support for tracking GitHub Copilot usage statistics in CodexBar. It implements a secure authentication flow and fetches quota data from the internal GitHub Copilot API.

@steipete
Copy link
Owner

Screenshot 2025-12-27 at 21 50 47

I tried this, but it's not working as intended. I'll take a look.

@steipete
Copy link
Owner

codex analysis:

• Yes — not closing is expected with current flow; we have two real bugs:

  • waitingAlert.runModal() blocks, and we never close the alert window; NSApp.stopModal alone
    doesn’t reliably dismiss the NSAlert.
  • We start two polling tasks; cancel only stops the unused one. The real poll keeps running
    (or failing), so the modal never ends.

Likely also failing to ever get a token: the device‑flow endpoints expect form‑urlencoded
bodies, but we send JSON. That can leave polling stuck even though the web page says
success.

Fix plan (small, safe):

  1. CopilotDeviceFlow: send application/x-www-form-urlencoded bodies for both device code +
    token. Keep Accept: application/json.
  2. CopilotLoginFlow: single polling task; on success call NSApp.stopModal and
    waitingAlert.window.close() (or switch to beginSheetModal).
  3. Cancel should cancel the same task.

@steipete steipete merged commit e32f49a into steipete:main Dec 27, 2025
1 of 2 checks passed
@steipete
Copy link
Owner

Thanks @roshan-c! We merged this into main and added a credit in the CHANGELOG.

@greptile-apps
Copy link

greptile-apps bot commented Dec 28, 2025

Queued: Greptile will review this PR after it finishes indexing your repository.

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.

2 participants