Skip to content

add: solvent rate-limit — inspect and manage per-user rate limits#47

Draft
ianalloway wants to merge 1 commit into
claude/solvent-hackathon-improvements-633eflfrom
claude/solvent-ratelimit-cmd
Draft

add: solvent rate-limit — inspect and manage per-user rate limits#47
ianalloway wants to merge 1 commit into
claude/solvent-hackathon-improvements-633eflfrom
claude/solvent-ratelimit-cmd

Conversation

@ianalloway

Copy link
Copy Markdown
Owner

Summary

  • Adds solvent rate-limit CLI command with six sub-commands: stats, check, ban, unban, list-banned, cleanup
  • Reads burst/hourly/daily thresholds from SolventConfig so limits stay in sync with solvent config
  • All sub-commands support --json for machine-readable output and --db to target a non-default DB
  • Wires the new command into solvent/__main__.py

Test plan

  • 18 new unit tests in tests/test_rate_limit_cmd.py covering all sub-commands, JSON mode, ban/unban lifecycle, expired-ban filtering, and CLI dispatch
  • All 268 existing tests pass (6 skipped, no regressions)
  • solvent rate-limit stats telegram:12345 shows burst/hourly/daily counters
  • solvent rate-limit ban telegram:12345 --duration 3600 --reason spam bans and reports expiry time
  • solvent rate-limit list-banned omits expired bans
  • solvent rate-limit check <user> exits 1 when blocked, 0 when allowed
  • solvent rate-limit cleanup --json returns {"removed_events": N, "removed_bans": M}

🤖 Generated with Claude Code

https://claude.ai/code/session_01SGjM79GJpSksy9wSSBa7e6


Generated by Claude Code

Adds `solvent rate-limit` with sub-commands: stats, check, ban, unban,
list-banned, cleanup. Reads burst/hourly/daily limits from config.
Includes 18 tests and --json flag for machine-readable output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SGjM79GJpSksy9wSSBa7e6
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