Skip to content

Post the login link for /login while still logged in (2.5.5) - #86

Merged
ESJavadex merged 2 commits into
ESJavadex:mainfrom
nsleigh:fix/login-watcher-relogin
Nov 12, 2026
Merged

ESJavadex merged 2 commits into
ESJavadex:mainfrom
nsleigh:fix/login-watcher-relogin

Conversation

@nsleigh

@nsleigh nsleigh commented Nov 11, 2026

Copy link
Copy Markdown

Low priority, like #85: no release needed on its own. It numbers itself
2.5.5 after #85 (2.5.4); happy to rebase or renumber if the order changes.

Problem

Running /login to renew a login or switch account posted no "Claude Code
login" notification. The watcher (scripts/login-url-watcher.sh) only
looked for a login link while Claude was logged out, and while the old
login is still valid it counts as logged in, so the new link was skipped.

Fix

  • Look for a new login link all the time, not only while logged out. The
    set of links already posted is unchanged, so a link is still never
    posted twice, and old links can't come back after a restart (the tmux
    session starts empty).
  • Dismiss the notification once the saved login has changed and is
    valid, rather than as soon as any valid login exists (which the old one
    already was). The change is spotted with a checksum of
    .credentials.json, so the watcher never reads the tokens.
  • DOCS.md: mentions re-running /login, and that the watcher reads the
    window Claude starts in.

If Claude refreshes its token while a /login is half done, the
notification can be dismissed early; the link is still in the terminal.

Tests

tests/test-login-url-watcher.sh gains a re-login case: logged in, a new
link appears → posted; the credentials don't change → it stays; the new
login is saved → dismissed. It fails on the old watcher. The existing
cases (first login, expiry with the old link in scrollback, a later new
login) still pass, as do the full suite and ShellCheck.

Tested

On Home Assistant OS: in the dev add-on, while logged in, /login posted
the notification, and it cleared once the code was pasted.

🤖 Generated with Claude Code

https://claude.ai/code/session_018rxd5pKHfU3wFULG6yLDE6

The login URL watcher only looked for a link while Claude was logged
out, so /login to renew a login or switch account (old login still
valid) never posted a notification.

Look for new links all the time; a link already posted is still never
posted again. Dismiss the notification once the saved login has changed
(a checksum of the credentials file, so the tokens are never read) and
is valid, rather than as soon as any valid login exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018rxd5pKHfU3wFULG6yLDE6
@ESJavadex
ESJavadex merged commit 2c4ad18 into ESJavadex:main Nov 12, 2026
6 checks passed
@ESJavadex

Copy link
Copy Markdown
Owner

Thanks, @nsleigh — I reviewed the /login notification flow and the checksum-based credential-change check; the watcher never emits token contents. The updated branch passed the full CI matrix, including browser and both architecture builds. Merged as 2.5.5.

@nsleigh
nsleigh deleted the fix/login-watcher-relogin branch November 13, 2026 08:35
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