Skip to content

test: execute disabled usage preference persistence - #1819

Merged
openwong2kim merged 1 commit into
openwong2kim:mainfrom
snowyukitty:test/session-save-disabled-usage
Oct 6, 2026
Merged

openwong2kim merged 1 commit into
openwong2kim:mainfrom
snowyukitty:test/session-save-disabled-usage

Conversation

@snowyukitty

@snowyukitty snowyukitty commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Execute the save-side coverage requested after #906: both enabled and disabled
usage preferences must survive session JSON serialization.

Changes

  • Extract and transpile the actual buildSessionData function from AppLayout
    for the existing test harness, then assert that its serialized output owns
    anthropicUsageEnabled with the exact true or false value.
  • Name UsagePoller.start()/stop() in the hydration comment, matching the
    existing IPC toggle implementation and its idempotent lifecycle methods.

CHANGELOG entry

no CHANGELOG — internal only; tests and a source comment.

Stability tier impact

  • No external surface touched (internal refactor / docs / tests / CI).

Substrate contract impact (Substrate 3.0)

n/a

Test plan

  • Focused save/load session tests passed.
  • npm run typecheck:quiet passed.
  • Full npm test passed in an isolated Linux container: 1,670 parallel test
    files and 22 runtime test files passed; 4 parallel and 11 runtime files were
    skipped by their existing platform/environment guards.
  • Used the repository postinstall patches and a Node-native node-pty build
    for runtime tests. No manual UI verification was performed.

Related issues / PRs

Follow-up to #906, covering the two optional review notes.

Reviewer checklist

  • CHANGELOG entry above is filled in or explicitly marked n/a.
  • Stability tier impact is correctly classified.
  • Substrate contract docs (PROTOCOL.md, inventory.md, stability.md) updated if the surface changed (n/a).
  • Tests cover the new behavior and the regression case (if a bug fix).
  • No accidental commit of secrets, tokens, .env, or unrelated large binaries.

Summary by CodeRabbit

  • Tests
    • Strengthened coverage for preserving the Anthropic usage preference when session data is saved and restored, helping ensure the setting remains consistent.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4324eb5f-9e48-451e-8c40-11f1eecf2ee5
📥 Commits

Reviewing files that changed from the base of the PR and between b00ef66 and 9d53529.

📒 Files selected for processing (2)
  • src/renderer/components/Layout/__tests__/appLayout.sessionSaveInvariants.test.ts
  • src/renderer/hooks/useNotificationListener.ts

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


📝 Walkthrough

Walkthrough

The session-save test now executes the production builder and verifies that the Anthropic usage setting survives JSON serialization. A usage-poller comment now names the start() and stop() operations.

Changes

Session-save invariant test

Layer / File(s) Summary
Execute and verify session-data serialization
src/renderer/components/Layout/__tests__/appLayout.sessionSaveInvariants.test.ts
The test runs buildSessionData with both boolean values, JSON-round-trips the result, and checks that anthropicUsageEnabled remains present and unchanged.

Usage-poller comment

Layer / File(s) Summary
Update poller operation names
src/renderer/hooks/useNotificationListener.ts
The comment now says the IPC toggle calls UsagePoller.start()/stop() and retains the idempotency claim.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Suggested reviewers: openwong2kim

Merge Risk: ⚪ Minimal · up to 9d535

The change strengthens session-save coverage and updates a poller comment; no merge-blocking behavior or operational issue is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the new test coverage for disabled usage preference persistence. It highlights the main change, although the test also covers the enabled value.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · 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.

@openwong2kim
openwong2kim merged commit 3f14308 into openwong2kim:main Oct 6, 2026
10 checks passed
bluemas added a commit to bluemas/wmux that referenced this pull request Oct 6, 2026
Brings in openwong2kim#1819, openwong2kim#1820, openwong2kim#1840 and openwong2kim#1841. openwong2kim#1832-openwong2kim#1834 and openwong2kim#1836 are the
fork's own changes squash-merged upstream; they add only their changelog
fragments here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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