Skip to content

feat(handlers): handle_usage_summary routed through DaemonProxy (Phase 2c-5)#510

Merged
jinhongkuan merged 1 commit into
devfrom
feat/daemon-02c-5-usage-summary-via-daemon
May 23, 2026
Merged

feat(handlers): handle_usage_summary routed through DaemonProxy (Phase 2c-5)#510
jinhongkuan merged 1 commit into
devfrom
feat/daemon-02c-5-usage-summary-via-daemon

Conversation

@jinhongkuan

Copy link
Copy Markdown
Contributor

Summary

Phase 2c-5 of the daemon-as-process arc — mirror 2c-4's pattern for read.usage_summary. MCP-side handle_usage_summary becomes a thin facade that routes through ctx.daemon.usage_summary(...); existing pure ledger-read logic moves to _handle_usage_summary_impl which the daemon's protocol handler invokes.

Server-side handler in protocol/handlers/reads.py already wired by #501; this PR migrates the call-site and adds boundary tests.

Plan refs

Test plan

  • pytest tests/test_usage_summary_via_daemon.py — boundary tests through real daemon subprocess
  • ruff format --check . && ruff check . clean
  • CI green on dev (merging on lint-only per @jinhongkuan directive)

🤖 Generated with Claude Code

…e 2c-5)

Mirror Phase 2c-4's pattern: split handle_usage_summary into a thin
facade (with @read_tool decorator, routes through ctx.daemon.usage_summary)
and _handle_usage_summary_impl (core logic, called by the daemon's protocol
handler). Add DaemonProxy.usage_summary typed RPC method. Fix reads.py to
call the impl instead of the facade to avoid infinite RPC loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6853e46e-5204-4c70-8da5-4ef6d94c49c2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/daemon-02c-5-usage-summary-via-daemon

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 and usage tips.

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