Skip to content

Read JetBrains quota from JbaiQuota and Junie records - #886

Merged
Finesssee merged 3 commits into
mainfrom
feat/jetbrains-jbai-junie
Oct 15, 2026
Merged

Finesssee merged 3 commits into
mainfrom
feat/jetbrains-jbai-junie

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Port of upstream steipete#4457 (bab8d5d, v0.75.0). Newer JetBrains IDEs stopped logging New quota state is: Available(...) after the AI Assistant → Air migration.

  • jetbrains/quota_log.rs now also reads Junie AiaActivationTransmitter - Received message from junie: quota_update:{json} records and AI Assistant 262.x Available(quota=JbaiQuota(...)) / Known(refill=JbaiQuotaRefill(...)).
  • Skips the repeated disabled-assistant AIAssistantForbiddenException line; any other unsupported latest record still invalidates older quota. Same-IDE freshness and XML fallback unchanged (a newer Junie log replaces XML quota and does not borrow the XML refill).
  • License and quota IDs are never stored.
  • 8 tests ported from upstream fixtures; 4 failed before the fix. CHANGELOG line.

Commands

  • cargo test both manifests (rust 4521, tauri 721), cargo clippy both --all-targets -- -D warnings, cargo fmt --all

UI proof

Backend log parsing only; no UI change.

Summary by CodeRabbit

  • New Features
    • JetBrains AI quota tracking now recognizes quota updates from newer JetBrains AI Assistant and Junie activity, including quota and refill information when available.
    • The latest supported quota update is used, while existing XML quota data remains available as a fallback. The selected IDE’s freshness rules and top-up balance are preserved.

Factory Agent added 2 commits October 15, 2026 18:08
Parse the JbaiQuota and JbaiQuotaRefill layouts and the Junie
quota_update JSON relayed to idea.log. Malformed latest records still
reject the log, a disabled AI Assistant error is skipped, and same-IDE
freshness and the XML fallback are unchanged.
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: nesszer/Win-CodexBar/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 0691abcd-7b85-4977-9f58-1c4b1d5392d1
📥 Commits

Reviewing files that changed from the base of the PR and between bc8c1e3 and 0fcc0a7.

📒 Files selected for processing: 3
  • CHANGELOG.md
  • rust/src/providers/jetbrains/mod.rs
  • rust/src/providers/jetbrains/quota_log.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: nesszer/Win-CodexBar/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 96564053-1beb-4add-91b7-0cf140513f3d
📥 Commits

Reviewing files that changed from the base of the PR and between 7383bf8 and bc8c1e3.

📒 Files selected for processing: 3
  • CHANGELOG.md
  • rust/src/providers/jetbrains/mod.rs
  • rust/src/providers/jetbrains/quota_log.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

📝 Walkthrough

JetBrains quota log parsing now supports Junie JSON updates and newer JbaiQuota and JbaiQuotaRefill records. The parser selects the newest supported quota record, applies format-specific validation, and retains the existing XML fallback and same-IDE freshness behavior.

Changes: JetBrains quota parsing

Layer / File(s) Summary
Decode quota and refill records
rust/src/providers/jetbrains/quota_log.rs
The parser accepts Jbai quota and refill layouts and decodes Junie JSON quota updates. It validates quota values, expiry, and top-up amounts.
Select the newest supported quota record
rust/src/providers/jetbrains/quota_log.rs
Reverse scanning skips the specific disabled-assistant error. Tests cover record ordering, malformed records, and error handling.
Verify IDE quota integration
rust/src/providers/jetbrains/mod.rs, CHANGELOG.md
A provider test verifies that a newer Junie log quota supplies usage while retaining the XML top-up and leaving refill unset. The changelog documents the supported records and fallback.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to bc8c1

No merge-blocking quota behavior is established by the reviewed change. Merge after normal checks.

Pre-merge checks: Passed 8
Passed Passed checks: 8 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title is a concise imperative summary of the main change. It accurately identifies the JetBrains quota sources added by the pull request.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Provider Data Stays Siloed Passed The pull request changes only JetBrains provider parsing, JetBrains tests, and the changelog. The new parser extracts quota and refill values, while Junie license and quota ID fields are ignored and n…
Secrets Handled Safely Passed The changed JetBrains parser does not retain or emit credential fields. JunieQuotaUpdate decodes only quota values and expiry, so license and quotaID are dropped. The JbaiQuota regex matches t…
No Unapproved Dependencies Passed The pull request changes only CHANGELOG.md and JetBrains Rust source and test files. It does not modify Cargo.toml, package.json, npm/yarn lockfiles, or the pinned pnpm packageManager version. No unap…
Ui Changes Include Windows Proof Passed PASS. The PR changes only CHANGELOG.md and JetBrains quota parsing/tests. It does not change desktop UI files, tray rendering, the float bar, settings, or window chrome. The description also states:…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Finesssee
Finesssee merged commit 30adafa into main Oct 15, 2026
2 of 3 checks passed
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.

1 participant