Skip to content

fix(acp): preserve session cost across partial usage updates#275

Merged
carlos-algms merged 3 commits into
mainfrom
fix/session-cost-header-flicker
Jul 9, 2026
Merged

fix(acp): preserve session cost across partial usage updates#275
carlos-algms merged 3 commits into
mainfrom
fix/session-cost-header-flicker

Conversation

@carlos-algms

@carlos-algms carlos-algms commented Jul 7, 2026

Copy link
Copy Markdown
Owner
  • claude streams cost-less usage updates before cost
  • blind overwrite wiped cost, header flickered
  • shallow-merge usage, keep prior on partial update
  • reject cost object without numeric amount

- claude streams cost-less usage updates first
- blind overwrite wiped cost, causing header flicker
- shallow-merge usage, reject cost without numeric amount
- make test case-count check loop-aware
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a82605c6-0a9b-4fe4-b352-e728d6222703

📥 Commits

Reviewing files that changed from the base of the PR and between 9ca4902 and 2caa676.

📒 Files selected for processing (5)
  • .agents/skills/agentic-testing/SKILL.md
  • lua/agentic/acp/session_state.lua
  • lua/agentic/acp/session_state.test.lua
  • lua/agentic/ui/diagnostics_list.test.lua
  • tests/integration/test_tool_block_borders.lua

📝 Walkthrough

Walkthrough

This PR modifies SessionState:set_usage to merge partial usage updates rather than overwrite existing values, adding validation so cost is only applied when cost.amount is numeric, preserving prior cost data otherwise. New tests cover these merge and preservation behaviors. Two test files switch from nvim_win_set_width to nvim_win_set_config for window sizing. The agentic-testing skill documentation is updated to require reconciling expected vs. actual test case counts instead of checking marks via make test.

Possibly related PRs

Poem

A rabbit hops through usage data, merging fields with care,
No cost gets lost, no size erased — preserved beyond compare.
I nudge the window width with config, tidy and precise,
And count my it()s twice to make the checklist nice.
🐇 EXPECTED meets ACTUAL, matching in the burrow's light!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: preserving session cost across partial ACP usage updates.
Description check ✅ Passed The description matches the PR’s core behavior change and test intent, including partial updates and cost validation.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/session-cost-header-flicker

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.

@carlos-algms
carlos-algms marked this pull request as ready for review July 9, 2026 07:39
@carlos-algms
carlos-algms merged commit a37f19f into main Jul 9, 2026
10 checks passed
@carlos-algms
carlos-algms deleted the fix/session-cost-header-flicker branch July 9, 2026 17:45
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