Repository navigation
fix(auth): make Claude file expiry aware of project credentials - #31696
teamleaderleo wants to merge 4 commits into
Conversation
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
|
|
Review (subagent): BLOCK at 9d3d1ec. [blocking] The new global-file expiry verdict does not account for valid project .claude/settings.json or settings.local.json authentication sources. This can reject a working project before send. Keep this PR unlanded while the implementation carries selected-project source context or otherwise proves no alternate source applies. The initial fleet selector omitted the Rust module prefix; zero executed tests would not count as regression evidence. |
|
Found 2 test failures on Blacksmith runners: Failures
|
|
BLOCK at 6d8af6d [blocking] Visual verdict: no visual change in this finding. |
|
Orphaned: no activity for 13 h, and no lane holds a lease on it. The orphan sweep could not merge |
|
Owned by an agent session · took over from an earlier session · session |
|
Superseded by #31694: feat-cmux-next already carries this PR's whole change (claude_auth expiry evidence, the session-scoped check and the claude_expiry tests). It also has the custom-endpoint guard that the BLOCK at 6d8af6d asked for, which reports Unknown when a custom endpoint is set. Merging base into this branch gives a tree identical to base, so nothing is left to land. |
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
HOLD: Awaiting focused fleet red/green proof at the current head.
Claude’s built-in authentication check treated any credentials file as signed in, including an expired OAuth access token with no refresh token. A stale global file cannot prove authentication failure because project settings can provide another credential. The host-wide check now reports Unknown for that case; a new session-scoped check can report Expired only after checking the supplied project directory and ancestor settings for alternative credentials.
Leo: “Also, we need to be fixing authentication issues, like the whole onboarding situation.”
Leo-ask: ask-e79e3d6ca8
The session-scoped API is additive; the existing no-directory caller remains conservative. Follow-on session and New Tab integration will supply their selected directory. Environment/settings/helpers, saved API keys, refreshable tokens, unknown formats and macOS keychain ambiguity retain their existing behavior. Malformed/unreadable settings, unresolved environment references and custom settings arguments prevent a conclusive expiry verdict. Helpers are never executed and credentials are never logged or modified.
Validation: synthetic health-RPC and credential-source tests cover file expiry, refresh tokens, unknown formats, alternate sources, project/local and ancestor settings, and invalid/unreadable settings. Static pre-push checks pass. Independent review passed at 6d8af6d. Focused fleet run https://github.com/manaflow-ai/cmux/actions/runs/41381323313 failed before executing tests because the base Cargo.lock is inconsistent with the fs4 manifest edge from #31462. Existing repairs #31654 and #31697 own that correction. The final-head fleet step is https://github.com/manaflow-ai/cmuxterm-hq/actions/runs/41381616430 (pending). No passing test verdict is claimed.
Prior art: #26658 preserves expired verdicts reported by failed turns/checks; this adds file-expiry evidence without assuming it is the session’s only credential. #26502’s provider-switch semantics and #25950’s source diagnostics remain intact. The earlier head’s project-source review blocker is fixed by checking those sources and retaining Unknown when context is incomplete.
Agent session: agent session