Repository navigation
fix(agents): keep a Claude Platform login across sessions - #353
Merged
Merged
Conversation
Claude Code 2.1.281's Claude Platform (Console) login no longer mints a primaryApiKey. It writes the Anthropic profile the SDKs share instead: a user-OAuth token pair in ~/.config/anthropic/credentials/default.json and the org, workspace and OAuth client in configs/default.json. The watcher never saw that login finish, nothing was captured, and a session started logged out. The adapter now stores the pair as platformOauth (in the claudeAiOauth shape, so expiry, merging and the refresh sweep treat both logins alike) plus platformProfile, renders both files back 0600 and agent-owned (the CLI refuses a group/world-readable credentials file), takes the CLI's own rotations back from a running session, and refreshes server-side against api.anthropic.com/v1/oauth/token. A Platform login is its own inference credential: it replaces a stored claude.ai login and vice versa, since the CLI prefers claude.ai when both are present. The image pre-creates ~/.config/anthropic, so a single-entry tar write does not leave the directories root-owned and the CLI can still rewrite the token. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
aixle-com Bot
pushed a commit
that referenced
this pull request
Nov 26, 2026
The Google-font scan read every file under app/frontend as UTF-8 and raised on the agent-logo PNGs. Read them with File.binread instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Aixle Flow <[email protected]>
dvislov
pushed a commit
that referenced
this pull request
Nov 30, 2026
The OFL-licensed variable woff2 files from @fontsource-variable 5.3.0, with the same unicode subsets Google Fonts serves, and one stylesheet under the family names the frontend theme uses. The v1 path segment is the cache buster: public/ is served with a one-year max-age. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Aixle Flow <[email protected]> Signed-off-by: Dmitry Vislov <[email protected]>
dvislov
pushed a commit
that referenced
this pull request
Nov 30, 2026
Every page, the static error pages and the admin panel sent each visitor's IP address to Google for fonts. They now link /fonts/v1/fonts.css, the mailer links no web font, and the CSP drops the Google hosts and the blanket https: source from font-src and style-src. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Aixle Flow <[email protected]> Signed-off-by: Dmitry Vislov <[email protected]>
dvislov
pushed a commit
that referenced
this pull request
Nov 30, 2026
The Google-font scan read every file under app/frontend as UTF-8 and raised on the agent-logo PNGs. Read them with File.binread instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Aixle Flow <[email protected]> Signed-off-by: Dmitry Vislov <[email protected]>
artempartos
added a commit
that referenced
this pull request
Nov 30, 2026
A font bundled by Vite is served from the asset host in production, where the policy is enforced, so font-src matches script-src and style-src. The partial takes no locals now; strict locals make a leftover `families:` call fail. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
artempartos
added a commit
that referenced
this pull request
Nov 30, 2026
* build(web): vendor Inter, JetBrains Mono and Spline Sans Mono (#353) The OFL-licensed variable woff2 files from @fontsource-variable 5.3.0, with the same unicode subsets Google Fonts serves, and one stylesheet under the family names the frontend theme uses. The v1 path segment is the cache buster: public/ is served with a one-year max-age. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Aixle Flow <[email protected]> Signed-off-by: Dmitry Vislov <[email protected]> * feat(web): load web fonts from our own origin, not Google (#353) Every page, the static error pages and the admin panel sent each visitor's IP address to Google for fonts. They now link /fonts/v1/fonts.css, the mailer links no web font, and the CSP drops the Google hosts and the blanket https: source from font-src and style-src. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Aixle Flow <[email protected]> Signed-off-by: Dmitry Vislov <[email protected]> * fix(web): scan files as bytes in the self-hosted fonts test (#353) The Google-font scan read every file under app/frontend as UTF-8 and raised on the agent-logo PNGs. Read them with File.binread instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Aixle Flow <[email protected]> Signed-off-by: Dmitry Vislov <[email protected]> * fix(web): allow asset-host fonts, forbid fonts partial locals (#353) A font bundled by Vite is served from the asset host in production, where the policy is enforced, so font-src matches script-src and style-src. The partial takes no locals now; strict locals make a leftover `families:` call fail. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]> --------- Signed-off-by: Aixle Flow <[email protected]> Signed-off-by: Dmitry Vislov <[email protected]> Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Aixle Flow <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Artem Petrov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Logging in to Claude Code through Claude Platform (the Console / API-usage-billing option) never finished in the auth modal, and even once a login existed a session could not use it.
Claude Code 2.1.281 no longer mints a
primaryApiKeyfor this login. It writes the Anthropic profile the SDKs share:~/.config/anthropic/credentials/default.json—type: oauth_token, access + refresh token,expires_at(epoch s, ~8h), scope, org/workspace/account~/.config/anthropic/configs/default.json— org, workspace,authentication: {type: user_oauth, client_id}Our watcher and adapter only looked at
.claude.json/.credentials.json, so the login was never detected or captured.What changes
access_tokenfinishes the login. Stored asplatformOauth(normalized to theclaudeAiOauthshape, so expiry, freshest-copy merging and the refresh sweep treat both logins alike) plusplatformProfile.Credentials file at … is group/world-readable), which is what broke the first live session. The config is rebuilt from the token block if it was never captured.api.anthropic.com/v1/oauth/token(JSON body,anthropic-beta: oauth-2025-04-20, the profile'sclient_id) — the endpoint the CLI itself uses. The URL is fixed in code, never taken from the profile'sbase_url, so a refresh token never goes to a host a container wrote down. A rejected refresh condemns the credential like a rejected claude.ai base login.credentials/default.jsonis accepted (rotation rules unchanged).docker/claude-code/Dockerfilepre-creates~/.config/anthropic/{credentials,configs}asclaude, 0700, so a single-entry tar write doesn't leave them root-owned.docs/design/oauth-implementation.md,docs/design/agent-credential-lifecycle.md.MITM logging is unaffected:
/oauth/tokenis already an auth path, so refresh bodies are never logged.Verification
platformOauth+platformProfile, a new interactive session started logged in ("API Usage Billing") and answered a prompt; the in-session write-back endpoint accepted the CLI's rotation.claudeAiOauthwins when both are present; exact refresh request shape read from the 2.1.281 binary.make check_allgreen (backend 93.31%, frontend 82.59%).Deploy note
Ship
main-imageswith or before the web change: with an old image the platform writes into root-owned auto-created directories. The CLI can still read the files, but cannot rewrite them on its own refresh (the server-side sweep still refreshes).🤖 Generated with Claude Code