feat(ai-hud): scaffold status bar AI cost + cache HUD#28
Conversation
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 37 minutes and 12 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds documentation for a Prompt cache HUD status bar and a small test timing adjustment. The docs define HUD segments, data sources, daily total persistence, configuration flags, implementation notes, and acceptance criteria; the test increases GRACE_TIME and suite timeout to reduce flakiness. ChangesAI HUD Status Bar
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces documentation and a placeholder for a new AI cost and prompt-cache status bar HUD. The feedback highlights a path error in the README, potential storage growth issues with the proposed per-day key strategy, and technical limitations regarding per-segment coloring in the VS Code StatusBarItem API.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces documentation and a placeholder for a new 'Prompt cache HUD' feature, which provides real-time visibility into AI costs and prompt-cache usage. It also updates a test to skip execution on CI environments due to flakiness. Feedback suggests using global storage scope for cost tracking to ensure aggregate transparency across workspaces and recommends simplifying the CI environment check while linking a tracking issue for the skipped test.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the design and documentation for a Prompt cache HUD, a status bar feature for real-time AI cost and cache tracking. It also modifies a test in the MCP state handler to skip execution on CI due to flakiness. Feedback suggests improving the HUD design by persisting cache hit ratios across sessions, clarifying currency units in configuration, and adopting a more maintainable approach for pricing data. Regarding the test changes, it is recommended to use the test runner's built-in skip mechanism or address the underlying race condition rather than manually checking environment variables.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces documentation and a placeholder for the 'Prompt cache HUD,' a status bar feature designed to provide real-time transparency into AI costs and prompt-cache performance. It also increases the grace time in mcpStdioStateHandler.test.ts to mitigate test flakiness on CI. Feedback includes suggestions for internationalization support, addressing potential race conditions in storage persistence, improving user visibility for stale pricing data, and further increasing the test grace period to ensure stability.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces documentation for a new 'Prompt cache HUD' feature, which provides real-time AI cost and cache transparency in the status bar. It also includes stability improvements for MCP tests by increasing grace periods and timeouts to mitigate flakiness on slow CI runners. Feedback focuses on optimizing the persistence frequency of the cost tracking service to reduce disk I/O and improving the user experience for the stale pricing warning by making it configurable or dismissible.
Reserves 'src/vs/workbench/contrib/aiHud/' for the status bar item that surfaces AI cost and prompt-cache state. Design at 'docs/zeus-prompt-cache-hud.md'. This is the counter-positioning vs Cursor's credit model: show the raw numbers, never enforce a hard cap. Users decide whether to stop.
…note
- src/vs/workbench/contrib/aiHud/README.md: relative path is 5 levels
to docs/, not 6
- docs/zeus-prompt-cache-hud.md: replace per-day storage key
('zeus.ai.cost.today.<date>') with a single key holding
{date, total} that resets at local midnight, so the store doesn't
grow over time
- docs/zeus-prompt-cache-hud.md: note that the HUD is implemented as
multiple adjacent StatusBarItems because VS Code's API doesn't
support per-segment coloring in one item
- IStorageService scope: WORKSPACE -> APPLICATION (per-user). The user's daily spend shouldn't reset when they switch workspaces, since the goal is total-cost transparency. Future setting 'zeus.ai.hud.scope' can flip it per-project for users who want that. - Flaky test (mcpStdioStateHandler 'sigterm after grace'): drop the redundant GITHUB_ACTIONS check (CI is set by every major CI provider, so the second condition was always true when the first was). Add a 'FLAKY-ON-CI(zeus#28)' marker so the skip is traceable and removable later.
…p flake by bumping grace 100→250ms
…ce, nls.localize plan, UI stale-pricing warning, bump GRACE_TIME to 1000ms
…th mocha default 2000ms
…lity-only Address reviewer concerns: - Add zeus.ai.hud.stalePricingDays (default 30, null disables) so users on locked editor versions can suppress the stale-pricing glyph - Reword the 1s persistence cadence note: renderer windows stay in sync via IPC subscriptions, not by re-reading storage, so write frequency is purely a hard-kill durability bound
6b7501a to
de188c4
Compare
Goal
Reserve the workbench slot for the status bar HUD that surfaces AI cost and prompt-cache hit ratio in real time. This is the counter-positioning vs Cursor's credit model: show the raw numbers, never enforce a hard cap.
Design: `docs/zeus-prompt-cache-hud.md`
Counter-positioning
Cursor's credit pricing is what most heavy users complain about. Hard caps create anxiety. Zeus shows: live agent count, rolling cache-hit ratio, last-call cost, today's cumulative cost. Click to drill in; ignore if you don't care; configurable off entirely.
Depends on
#26 feat/agent-sdk — runtime event stream with `usage` data
Summary by CodeRabbit