Skip to content

Notice an agent that signs in again in the connect dialog - #4960

Merged
yannickmonney merged 1 commit into
mainfrom
fix/connect-dialog-reconnect
Oct 13, 2026
Merged

yannickmonney merged 1 commit into
mainfrom
fix/connect-dialog-reconnect

Conversation

@yannickmonney

Copy link
Copy Markdown
Contributor

What

The connect dialog (#4958) stayed on Waiting for your agent to sign in… for good when the agent had been connected before. Found by running the real Claude Code login with the dialog open.

  • Why. Allowing an app that is already connected changes its one live connection rather than adding another (AGCONN-R6), so a second sign-in of the same agent (a reinstall, a new machine, a refreshed grant) produces no new id, and the dialog only looked for new ids.
  • The fix. The list already returns when each connection was last allowed (updatedAt, which the consent sets on every allow, even for the same access). The dialog's baseline is now each connection's updatedAt: one that was made or allowed again since counts, one merely listed again does not. Only values the server wrote are compared, so a clock that is off cannot change the answer.
  • A second flaw behind the first. The baseline came from the first fresh answer, which arrives late when the page sits behind the terminal (a hidden tab does not poll); by then it already held the sign-in being waited for. The dialog now reads the list when it opens, whatever the cache holds (refetchOnMount: 'always'), and keeps polling while the page is in the background.

Proof

  • Unit: the watcher with a re-allowed connection (counts), an untouched one (does not), several (names the newest) and a value that went back (does not); the hook with an agent that signs in again, and with a cached list that is fresh and would not be read again on its own. Mutants: reverting to id-only fails the two re-allow tests; dropping the forced read fails the mount test.
  • Live, the real Claude Code 2.1.296 (a verified app, claude.ai) against a real provider: with the dialog open and its page behind the agent's tab, claude mcp login tale completed and the dialog changed from Waiting for your agent to sign in… to Connected: Claude Code, its prompt to Try this first. Before the fix the same run left it waiting while Claude Code reported ✔ Connected.
  • Gate on the committed tree (pinned bun 1.4.2), every step green: oxfmt --check, lint:links, lint:manual, lint:conflicts, knip, oxlint (type-aware) and both typechecks; shared 974, platform server + pii 89 114, platform UI 8 185, the two changed browser files 36, docs 716.
  • Manual box SET-F89 now holds the re-sign-in case.

Not here

Nothing else changes: the type gains updatedAt, which the list endpoint already sent.

The connect dialog said Waiting for your agent to sign in until the list
gained a connection it had not held when the dialog opened. Allowing an
app that is already connected changes its one live connection instead of
adding another, so an agent that signed in a second time (a reinstall, a
new machine, a refreshed grant) left the dialog waiting for good. Found by
running the real Claude Code login with the dialog open.

The list already carries when each connection was last allowed; the
dialog now takes the baseline as each connection's `updatedAt`, so one that
was made or allowed again since counts and one merely listed again does
not. Only values the server wrote are compared, so a clock that is off
cannot change the answer.

A second flaw hid behind the first: the baseline came from the first fresh
answer, which arrives late when the page sits behind the terminal, and by
then it already held the sign-in being waited for. The dialog now reads the
list when it opens whatever the cache holds, and keeps polling while the
page is in the background.
@yannickmonney
yannickmonney merged commit 0333fd4 into main Oct 13, 2026
@yannickmonney
yannickmonney deleted the fix/connect-dialog-reconnect branch October 13, 2026 17:44
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.

1 participant