Repository navigation
fix: close remaining gaps — FK doc, MCP cursor (#819/#820) - #906
Conversation
- #820: add explicit ON DELETE NO ACTION to parent_message_id FK - #819: add next_offset cursor to paginated MCP envelopes Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds pagination support to MCP response payloads and updates SQLite schema constraints. The first change enriches ChangesPagination Support in MCP Payloads
SQLite Schema Constraint Update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Closes remaining gaps from #819 and #820 by (1) making the archive schema’s self-referential messages.parent_message_id FK delete policy explicit, and (2) extending MCP paginated result envelopes with a next_offset cursor for page continuation.
Changes:
- Add explicit
ON DELETE NO ACTIONto themessages.parent_message_idforeign key in archive DDL. - Add
next_offsetto MCP paginated list/search payloads and populate it in payload builders.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
polylogue/storage/sqlite/schema_ddl_archive.py |
Makes the parent_message_id FK delete policy explicit in the archive schema DDL. |
polylogue/mcp/payloads.py |
Adds next_offset to paginated MCP result payloads and computes it for list/search responses. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| offset: int, | ||
| diagnostics: QueryMissDiagnostics | None = None, | ||
| ) -> MCPPaginatedQueryResultPayload: | ||
| next_offset = offset + len(conversations) if len(conversations) == limit and offset + limit < total else None |
| next_offset: int | None = None | ||
| diagnostics: MCPQueryMissDiagnosticsPayload | None = None |
- #819 (MCP envelopes): `polylogue/mcp/payloads.py` returns a populated `next_offset` cursor on paginated responses so MCP clients can iterate without recomputing offsets, completing the pagination contract introduced in PR #897. - #820 (storage integrity): `storage/sqlite/schema_ddl_archive.py` switches the message-FK policy from implicit to explicit `ON DELETE NO ACTION`, matching the documented invariant in the schema docstrings rather than relying on SQLite's default. Refs #819, #820
- #819 (MCP envelopes): `polylogue/mcp/payloads.py` returns a populated `next_offset` cursor on paginated responses so MCP clients can iterate without recomputing offsets, completing the pagination contract introduced in PR #897. - #820 (storage integrity): `storage/sqlite/schema_ddl_archive.py` switches the message-FK policy from implicit to explicit `ON DELETE NO ACTION`, matching the documented invariant in the schema docstrings rather than relying on SQLite's default. Refs #819, #820
#819: next_offset cursor. #820: explicit ON DELETE NO ACTION in DDL.
Summary by CodeRabbit
New Features
Chores