Skip to content

fix(auth): make Claude file expiry aware of project credentials - #31696

Closed
teamleaderleo wants to merge 4 commits into
feat-cmux-nextfrom
lane/ask-e79-claude-expiry
Closed

teamleaderleo wants to merge 4 commits into
feat-cmux-nextfrom
lane/ask-e79-claude-expiry

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 6d8af6d: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr31696 -f ref=lane/ask-e79-claude-expiry -f platform=macos -f backend_mode=local

@github-actions github-actions Bot added the risk:high Risk tier (docs/ci/risk-tiers.md) label Nov 2, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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.

@teamleaderleo teamleaderleo changed the title fix(auth): detect expired Claude file login before send fix(auth): make Claude file expiry aware of project credentials Nov 2, 2026
@blacksmith-sh

blacksmith-sh Bot commented Nov 2, 2026

Copy link
Copy Markdown

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)/
test_every_compile_job_names_its_warm_sources (main.ThisTree.test_every_compile_job
_names_its_warm_sources)
View Logs
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)/
test_the_repository_highlights_validate (main.DigestTests.test_the_repository_highl
ights_validate)
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

BLOCK at 6d8af6d

[blocking] claude_auth::find_sources records a custom ANTHROPIC_BASE_URL in found.endpoint, but does not include that uncertainty in expired_file_login/credential_sources_complete. With an expired subscription token and a custom/local endpoint that ignores that token, fresh_auth_in returns Expired and prevents a previously working first prompt. Preserve Unknown for custom endpoint configurations (both environment and settings sources) rather than concluding that the subscription expiry invalidates the endpoint. Add regression cases for each source. This is separate from the already-fixed registered-provider-route guard in #31694.

Visual verdict: no visual change in this finding.
Follow-ups: none.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Orphaned: no activity for 13 h, and no lane holds a lease on it. The orphan sweep could not merge feat-cmux-next in: conflicts in cmux-tui/crates/acpmux/src/harness_health/mod.rs. Listed for a lane to resolve.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · took over from an earlier session · session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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.

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 6d8af6d8 Deployed Nov 2, 2026 by teamleaderleo via cmux-tui tree preflight #98796
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:high Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant