Skip to content

Harden reliability and account isolation - #193

Merged
tsouth89 merged 2 commits into
mainfrom
codex/reliability-trust-audit
Aug 1, 2026
Merged

Harden reliability and account isolation#193
tsouth89 merged 2 commits into
mainfrom
codex/reliability-trust-audit

Conversation

@tsouth89

@tsouth89 tsouth89 commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace trust-critical settings, credential, history, geometry, and cache files atomically so interrupted writes cannot truncate the last known-good state
  • fix Claude OAuth credential replacement on Windows and surface Claude HTTP-client initialization failures instead of panicking a refresh task
  • scope chart history, quota-run efficiency, and chart caches by Ceiling's stable account ID so seats sharing an email cannot blend data
  • add regression coverage for atomic replacement and multi-account isolation

Validation

  • cargo test --manifest-path rust/Cargo.toml (779 library tests plus binary/doc tests)
  • cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml (463 tests)
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
  • cargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warnings
  • pnpm test (349 tests across 55 files)
  • pnpm run build
  • pnpm audit --json (0 vulnerabilities)
  • cargo audit (no blocking vulnerabilities; transitive maintenance/yanked warnings remain)

@coderabbitai

coderabbitai Bot commented Aug 1, 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: 58 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: 07f5c54c-d6b4-4ced-9cc3-76b3f9b95705

📥 Commits

Reviewing files that changed from the base of the PR and between 1ae07c0 and 7553eac.

📒 Files selected for processing (21)
  • apps/desktop-tauri/src-tauri/src/capacity_events.rs
  • apps/desktop-tauri/src-tauri/src/commands/chart.rs
  • apps/desktop-tauri/src-tauri/src/geometry_store.rs
  • apps/desktop-tauri/src-tauri/src/quota_run_history.rs
  • apps/desktop-tauri/src-tauri/src/usage_history.rs
  • apps/desktop-tauri/src/components/MenuCard.tsx
  • apps/desktop-tauri/src/lib/tauri.ts
  • apps/desktop-tauri/src/surfaces/ChartsPanel.test.tsx
  • apps/desktop-tauri/src/surfaces/ChartsPanel.tsx
  • apps/desktop-tauri/src/surfaces/ProviderComparison.tsx
  • apps/desktop-tauri/src/surfaces/ProviderDetailView.tsx
  • apps/desktop-tauri/src/surfaces/TrayPanel.test.tsx
  • apps/desktop-tauri/src/surfaces/settings/providers/ProviderDetailPane.tsx
  • apps/desktop-tauri/src/surfaces/settings/providers/sections/charts/ChartsSection.test.tsx
  • apps/desktop-tauri/src/surfaces/settings/providers/sections/charts/ChartsSection.tsx
  • rust/src/core/jsonl_scanner.rs
  • rust/src/core/openai_dashboard.rs
  • rust/src/core/widget_snapshot.rs
  • rust/src/providers/claude/oauth/credentials_store.rs
  • rust/src/providers/claude/web_api.rs
  • rust/src/secure_file.rs

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ceiling 7553eac Commit Preview URL

Branch Preview URL
Aug 01 2026, 04:35 AM

@tsouth89
tsouth89 marked this pull request as ready for review August 1, 2026 04:22
Copilot AI review requested due to automatic review settings August 1, 2026 04:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens local state persistence against interrupted writes and tightens multi-account isolation by keying history/cache data off Ceiling’s stable account ID (preventing cross-seat data blending when accounts share an email). It also improves Claude provider reliability by surfacing HTTP client construction failures instead of panicking background refresh work.

Changes:

  • Introduces atomic file replacement (atomic_write) and adopts it across state/cache/history/geometry writers.
  • Makes Claude Web API fetcher resilient to HTTP client initialization failures and uses atomic credential replacement for refreshed OAuth tokens on Windows.
  • Scopes chart caches, usage history, and quota-run efficiency by stable accountId (with regression coverage across Rust and React tests).

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rust/src/secure_file.rs Adds atomic_write with restrictive permissions + atomic replace; adds regression test ensuring no temp artifacts remain.
rust/src/providers/claude/web_api.rs Stores client build result and propagates initialization failures through provider errors instead of panicking.
rust/src/providers/claude/oauth/credentials_store.rs Switches OAuth credential refresh persistence to atomic replacement via secure_file::atomic_write.
rust/src/core/widget_snapshot.rs Uses atomic replacement for widget snapshot + selection persistence.
rust/src/core/openai_dashboard.rs Uses atomic replacement when persisting OpenAI dashboard cache.
rust/src/core/jsonl_scanner.rs Uses atomic replacement when persisting JSONL scan cache.
apps/desktop-tauri/src/surfaces/TrayPanel.test.tsx Updates expectations for the expanded getProviderChartData call signature.
apps/desktop-tauri/src/surfaces/settings/providers/sections/charts/ChartsSection.tsx Keys chart caching + efficiency fetches by stable accountId (fallback to email).
apps/desktop-tauri/src/surfaces/settings/providers/sections/charts/ChartsSection.test.tsx Adds regression asserting chart/efficiency requests include accountId.
apps/desktop-tauri/src/surfaces/settings/providers/ProviderDetailPane.tsx Passes accountId through to ChartsSection.
apps/desktop-tauri/src/surfaces/ProviderDetailView.tsx Includes accountId when requesting chart data and in effect dependencies.
apps/desktop-tauri/src/surfaces/ProviderComparison.tsx Includes accountId in comparison chart fetches.
apps/desktop-tauri/src/surfaces/ChartsPanel.tsx Updates chart section keying and plumbs accountId into ChartsSection.
apps/desktop-tauri/src/lib/tauri.ts Extends Tauri bridge wrappers to accept/pass accountId for chart + efficiency calls.
apps/desktop-tauri/src/components/MenuCard.tsx Includes accountId in chart fetch + effect deps to avoid stale cross-account data.
apps/desktop-tauri/src-tauri/src/usage_history.rs Scopes history series by accountId and persists atomically; adds multi-account isolation regression tests.
apps/desktop-tauri/src-tauri/src/quota_run_history.rs Scopes run history/efficiency by accountId and persists atomically; updates tests.
apps/desktop-tauri/src-tauri/src/geometry_store.rs Persists geometry atomically to avoid truncation.
apps/desktop-tauri/src-tauri/src/commands/chart.rs Threads accountId through chart cache keys, history lookup, refresh scheduling, and bumps cache version.
apps/desktop-tauri/src-tauri/src/capacity_events.rs Persists capacity event history atomically.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/desktop-tauri/src/surfaces/ChartsPanel.tsx Outdated
Comment thread apps/desktop-tauri/src-tauri/src/usage_history.rs
@tsouth89
tsouth89 merged commit a132308 into main Aug 1, 2026
11 checks passed
@tsouth89
tsouth89 deleted the codex/reliability-trust-audit branch August 1, 2026 04:39
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.

2 participants