auth: make `auth status` context-aware; hit /me on the active core · Entire

auth: make auth status context-aware; hit /me on the active core

721ad68→main·

toothbrush·1mo ago·4 files·+205 added/-150 removed

auth status queried /me against the static api.AuthBaseURL(), so with an active context on a different core (e.g. auth use eu.auth.entire.io while AuthBaseURL defaults to us.*) it sent the context's token to the wrong core and got a 401 — surfaced as a raw ogen decode dump because the 401 body was text/plain.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

1385b003c7a8View transcript

Changes

4

118 unmodified lines

if errors.Is(err, auth.ErrNotLoggedIn) { return true } // A 401 whose body isn't JSON (e.g. a gateway returning text/plain) fails // the ogen typed decode, so it never becomes an ErrorModelStatusCode — it // arrives as a decode error whose message carries "(code 401)". Match that // so the user still gets the re-login hint, not a raw decode dump. if strings.Contains(err.Error(), "code 401") { return true } return strings.Contains(err.Error(), "token exchange: status 4") }

35 unmodified lines

}

}

// RunAuthStatus reports auth state without listing server-side sessions // ...