Skip to content

feat(credentials): Load Grok and Claude tokens and handle nullable quota fields - #29

Merged
euxaristia merged 2 commits into
mainfrom
feat/cairn-keyring-credentials
Aug 14, 2026
Merged

feat(credentials): Load Grok and Claude tokens and handle nullable quota fields#29
euxaristia merged 2 commits into
mainfrom
feat/cairn-keyring-credentials

Conversation

@euxaristia

@euxaristia euxaristia commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

Loads Grok (xAI) and Claude OAuth credentials from OS credential stores and canonical files, and handles nullable Claude quota response fields.

Changes

  • Updated keyring credential reading on Windows to probe {account}.{service} target formats and transparently decode UTF-16LE password blobs.
  • Updated credentials loaders to inspect the OS keyring for cairn-code Grok entries and prioritized ~/.claude/.credentials.json for active Claude Code sessions.
  • Updated Claude parser Bucket fields (resets_at, utilization) to Option<...> to survive null JSON values from Anthropic.
  • Added unit tests for parsing Grok OAuth payloads, Grok CLI map payloads, nested/direct Claude OAuth structures, and nullable Claude response fields.

Refs #28
Fixes #28

Test plan

  • Ran cargo fmt --check (clean)
  • Ran cargo clippy --all-targets --all-features -- -D warnings (clean)
  • Ran cargo test (155 tests passing)
  • Ran cargo run -- status and verified live tracking across Claude, Grok, Antigravity, OpenCode Go, Copilot, and Codex

Decode UTF-16LE password blobs in Windows Credential Manager and query {account}.{service} target formats so OAuth sessions created in cairn-code are recognized.

Refs #28
@euxaristia

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 33 minutes.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a5a6ebec-98ef-4095-b068-a55c4497121a

📥 Commits

Reviewing files that changed from the base of the PR and between 649a95f and 8d8b680.

📒 Files selected for processing (3)
  • src/credentials/keyring.rs
  • src/credentials/mod.rs
  • src/parsers/claude.rs

Comment @coderabbitai help to get the list of available commands.

…als file.

Make Bucket resets_at and utilization optional to survive null values in the usage response, and read ~/.claude/.credentials.json before keyring fallbacks.

Refs #28
@euxaristia euxaristia changed the title feat(credentials): Load Grok and Claude tokens from cairn-code keyring feat(credentials): Load Grok and Claude tokens and handle nullable quota fields Aug 14, 2026
@euxaristia
euxaristia marked this pull request as ready for review August 14, 2026 20:34
@euxaristia
euxaristia merged commit 350d208 into main Aug 14, 2026
1 of 4 checks passed
@euxaristia
euxaristia deleted the feat/cairn-keyring-credentials branch August 14, 2026 20: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.

Support Grok and Claude credentials stored in cairn-code keyring

1 participant