Skip to content

fix(mac): preserve explicit Copilot disconnect - #1278

Merged
iamtoruk merged 4 commits into
getagentseal:mainfrom
avs-io:codex/copilot-disconnect-1273-20260909
Sep 10, 2026
Merged

iamtoruk merged 4 commits into
getagentseal:mainfrom
avs-io:codex/copilot-disconnect-1273-20260909

Conversation

@avs-io

@avs-io avs-io commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Refs #1273.

After Disconnect, discoverable Copilot credentials could reactivate quota tracking on the next refresh or relaunch. Persist the explicit opt-out, preserve it during automatic refresh, and clear it only when the user connects again. Credentials and historical usage are preserved. Plan, Settings, and Capacity Dock distinguish an explicit disconnect from missing credentials.

Validation: the initial fix passed 46 focused/adjacent standalone tests and 47 integrated tests, including in-flight cancellation and same-defaults relaunch. The presentation follow-up passed 16 focused tests. A universal native QA build passed compilation and strict ad-hoc signature verification. Actual UI checks exercised Disconnect, Refresh, normal Quit, same-profile relaunch remaining disconnected, and explicit Connect resuming discovery. Capacity Dock's incorrect OAuth guidance was reproduced and the corrected message and Connect action verified in the app. Tests used a separate bundle identity, a fictional token, and blocked network/Keychain access; no live-account or release-signing acceptance is claimed.

Plan and Settings treated sticky .notBootstrapped after Disconnect as
missing credentials. Keep first-use and real noCredentials sign-in copy;
disconnected state says quota tracking is off, credentials untouched,
and Connect resumes.
Nil-quota Capacity Dock used generic OAuth retry copy. Explicit
Disconnect leaves credentials, so reuse the existing disconnected
Settings detail for Copilot only.
@avs-io
avs-io marked this pull request as ready for review September 9, 2026 19:51
@iamtoruk

Copy link
Copy Markdown
Member

Pushed 1ffa3ec: removed the six post-await isSet guards. disconnectCopilot bumps copilotRefreshGen in the same MainActor block it sets the flag, so the existing generation guard on the line above already returns; all 8 focused tests pass without them. Full swift test 442/442. Note the Dock's "Complete Copilot OAuth, then click Retry" copy still shows for the no-credentials and terminal-failure cases; Kimi, Gemini and Antigravity have the same resurrect-on-relaunch bug. Merging.

@iamtoruk iamtoruk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified: bug reproduced on main, fix single-writer and provider-namespaced, 442/442 swift tests.

@iamtoruk
iamtoruk merged commit 0fea397 into getagentseal:main Sep 10, 2026
9 checks passed
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