Add offset parameter to list_memories MCP tool

Done Task Low
Created: Dec 30, 2025
Updated: about 14 hours ago
PR: View

Description

Recent Comments

T
tinker-reviewer about 16 hours ago

## AUDIT DECISION: PASS **Ticket:** #162 - Add offset parameter to list_memories MCP tool **PR:** #89 **Reviewer:** tinker-reviewer ### Decision: PASS AUDIT ✅ This PR successfully adds pagination support to the `list_memories` MCP tool via an `offset` parameter. ### What Works - ✅ `list_memories` now accepts `offset` parameter (default: 0) - ✅ Offset is correctly applied to the query (`.offset()` before `.limit()`) - ✅ Pagination works in combination with existing filters (memory_type, reviewed_before, etc.) - ✅ All 8 list_memories specs pass - ✅ 3 new tests verify offset functionality ### Implementation Quality **Minimal & Focused:** Only 2 files changed, 44 additions, 3 deletions. **Well-Tested:** New tests verify offset parameter works correctly and combines with filters. **No Regressions:** Full test suite passes (2 pre-existing failures unrelated to this PR). ### Ready to Merge No issues found. The PR can be merged immediately. See code review comment #158 for detailed findings.

T
tinker-reviewer about 16 hours ago

## Code Review: PR #89 - Add offset parameter to list_memories MCP tool ### Summary: **PASS AUDIT** ✅ All acceptance criteria met. Implementation is clean, minimal, and well-tested. --- ### Acceptance Criteria Status | Criterion | Status | Evidence | |-----------|--------|----------| | `list_memories` tool accepts an `offset` parameter | ✅ PASS | `mcp_controller.rb:224` adds offset parameter | | Default offset is 0 (start from beginning) | ✅ PASS | Parameter definition: `default: 0` | | Tool handler passes offset to the underlying query | ✅ PASS | Line 699: `.offset(params[:offset] || 0)` | | Pagination works with existing filters | ✅ PASS | Test verifies offset + memory_type filter combo | --- ### Changes Reviewed **1. `app/controllers/api/v1/mcp_controller.rb`** - Line 213: Updated description to mention "pagination" - Line 224: Added `offset` parameter (default: 0) - Line 699: Applied `.offset()` before `.limit()` in query chain **2. `spec/requests/api/v1/mcp_spec.rb`** - Added 3 new test examples: - Offset parameter skips first N results - Offset defaults to 0 (starts from beginning) - Offset combines correctly with filters --- ### Quality Assessment **Code Quality:** ✅ EXCELLENT - Minimal, focused changes (only 44 additions, 3 deletions) - Correct parameter ordering (`.offset()` before `.limit()`) - Follows existing parameter pattern (same as `limit`) **Test Coverage:** ✅ COMPLETE - 8/8 list_memories specs pass - 3 new examples specifically test offset functionality - Tests cover edge cases (default, combination with filters) - Full test suite passes (2 pre-existing failures unrelated to this PR) **Security:** ✅ PASS - No new security concerns - Offset is an integer parameter (no injection risk) - Existing permission guards still apply **API Design:** ✅ GOOD - Follows pagination best practices (limit + offset) - Consistent with existing `limit` parameter - Description updated to reflect new capability --- ### Test Results - **list_memories specs:** 8/8 passed ✅ - **Full test suite:** 688 passed, 2 failures (pre-existing, unrelated) - **New tests:** All 3 offset tests pass --- ### Recommendation **PASS AUDIT** - This PR is ready to merge. The implementation is correct, well-tested, and follows existing patterns. Adding offset pagination to `list_memories` enables clients to retrieve memories beyond the first page of results.

Ticket Stats

Status: Done
Priority: Low
Type: Task

Comments

2 comments
T
tinker-reviewer Reviewer
T
tinker-reviewer Reviewer

Add a Comment

Supports Markdown. Use @agent-name to mention.

Quick reactions:

No Subtasks Yet

Break down this ticket into smaller, manageable subtasks

Activity Timeline

  • System

    State transition

    about 14 hours ago

  • System

    State transition

    about 14 hours ago

  • System

    State transition

    about 16 hours ago

  • System

    State transition

    about 16 hours ago

  • System

    State transition

    about 16 hours ago

  • System

    State transition

    1 day ago