fix(pagination): declare page bounds in the schema and clamp instead of refusing (v0.4.4) #15

Merged
jlxq0 merged 2 commits from fix/clamp-pagination into main 2026-10-10 04:25:20 +00:00
Owner

Vryan's coaching cron asked list_workouts for page_size 50 on 8 and 9 Oct and got page_size must be between 1 and 10 both times. The input schema showed a bare integer, so the limit was only discoverable by failing.

  • Every paged tool (7) now declares page minimum 1 / default 1 and page_size minimum 1, maximum 10 (100 for the exercise-template tools), default 5 in its JSON schema.
  • Out-of-range values are clamped to Hevy's limit instead of refused; the result carries pagination_note saying what was returned and which page comes next.
  • Exercise-template tools get their own params struct for the 100 limit.
  • Release commit: 0.4.4.

Tests: every_paged_tool_declares_its_page_size_bounds (schema), oversized_page_size_is_clamped_and_noted_not_refused (wiremock sees pageSize=10 for a 50 request), in_range_paging_carries_no_note, pagination_clamps_every_bound. fmt, clippy 1.98.0, test (59 passed), cargo +1.93.0 check, deny bans/licenses/sources and cargo audit pass locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BbPgHm7ND8CnztzqxLEn5T

Vryan's coaching cron asked `list_workouts` for `page_size` 50 on 8 and 9 Oct and got `page_size must be between 1 and 10` both times. The input schema showed a bare integer, so the limit was only discoverable by failing. - Every paged tool (7) now declares `page` minimum 1 / default 1 and `page_size` minimum 1, maximum 10 (100 for the exercise-template tools), default 5 in its JSON schema. - Out-of-range values are clamped to Hevy's limit instead of refused; the result carries `pagination_note` saying what was returned and which page comes next. - Exercise-template tools get their own params struct for the 100 limit. - Release commit: 0.4.4. Tests: `every_paged_tool_declares_its_page_size_bounds` (schema), `oversized_page_size_is_clamped_and_noted_not_refused` (wiremock sees `pageSize=10` for a 50 request), `in_range_paging_carries_no_note`, `pagination_clamps_every_bound`. fmt, clippy 1.98.0, test (59 passed), `cargo +1.93.0 check`, deny bans/licenses/sources and cargo audit pass locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01BbPgHm7ND8CnztzqxLEn5T
A model asked list_workouts for page_size 50 twice in two days and got
"page_size must be between 1 and 10" each time: the input schema showed a
bare integer, so nothing told it the limit before the call, and the refusal
cost the turn.

Every paged tool now states page >= 1 (default 1) and page_size 1..10
(1..100 for exercise templates; default 5) in its JSON schema. Whatever
still arrives out of range is clamped to Hevy's limit and the result carries
a pagination_note saying what was returned and which page comes next.
list_exercise_templates and search_exercise_templates get their own params
struct, because they share the 100 limit the others do not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BbPgHm7ND8CnztzqxLEn5T
chore(release): 0.4.4
All checks were successful
CI / cargo (pull_request) Successful in 35s
CI / docker (pull_request) Successful in 52s
0da896138a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BbPgHm7ND8CnztzqxLEn5T
jlxq0 merged commit a6c8bd5dd0 into main 2026-10-10 04:25:20 +00:00
Sign in to join this conversation.
No reviewers
No labels
waiting-on-julian
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jlxq0/hevy-mcp!15
No description provided.