Skip to content

fix(mcp): retire duplicate archive query tools - #3056

Merged
Sinity merged 2 commits into
masterfrom
feature/fix/mcp-query-continuations
Jul 18, 2026
Merged

Sinity merged 2 commits into
masterfrom
feature/fix/mcp-query-continuations

Conversation

@Sinity

@Sinity Sinity commented Jul 17, 2026 •

Copy link
Copy Markdown
Owner

Summary

Retires the duplicate MCP-only archive_list_sessions and
archive_search_sessions compatibility tools.

Problem

Those aliases bypassed the canonical cursor-resumable query transaction. Their
response-budget fallback could return an empty continuation, so an agent could
not recover an oversized result safely.

Solution

The MCP registrar and executable declaration registry no longer expose the
legacy aliases. Generated discovery/reference surfaces and contract pins now
name only canonical list_sessions and search; API and HTTP helper contracts
are unchanged.

Verification

  • devtools render all
  • devtools test tests/unit/mcp/test_tool_discovery.py tests/unit/mcp/test_envelope_contracts.py
    • 100 passed

Ref polylogue-z9gh.

Summary by CodeRabbit

  • Changes
    • Removed the archive session listing and search tools from the available MCP tool set.
    • Updated the documented tool inventory and total count to reflect the reduced set.
    • Added coverage for other archive and action-related tools in compatibility checks.
    • Updated tool contract and discovery validation to match the current inventory.

Problem:
The legacy archive_list_sessions and archive_search_sessions tools bypassed
the canonical paged query contract. Their overflow fallback could return an
empty continuation, leaving agents unable to recover the bounded response.

What changed:
Remove both obsolete MCP registrations and their generated declarations. The
canonical list_sessions and search tools remain the single query surface and
own bounded, cursor-resumable reads.

Compatibility:
The retired names were MCP-only compatibility aliases. Python API and HTTP
archive helper contracts are unchanged.

Co-Authored-By: Claude <[email protected]>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c420dafd-21c3-43d3-b666-5db80638b1bf

📥 Commits

Reviewing files that changed from the base of the PR and between dd9a793 and f386a74.

📒 Files selected for processing (11)
  • polylogue/api/archive.py
  • polylogue/cli/commands/status.py
  • polylogue/daemon/http.py
  • polylogue/mcp/server_support.py
  • polylogue/mcp/server_tools.py
  • tests/unit/api/test_facade_contracts.py
  • tests/unit/cli/test_query_expression.py
  • tests/unit/cli/test_status.py
  • tests/unit/daemon/test_web_reader.py
  • tests/unit/mcp/test_query_tool_schema_derivation.py
  • tests/unit/mcp/test_tool_contracts.py
📝 Walkthrough

Walkthrough

Two archive session tools are removed from MCP registration and declaration metadata. Related test baselines and envelope/discovery contracts are updated, and the generated MCP reference lists 102 registered tools instead of 104.

Changes

MCP archive tool removal

Layer / File(s) Summary
Registration and declaration removal
polylogue/mcp/server_tools.py, polylogue/mcp/declarations/registry.py
Removes MCP decorators, inventory rows, compatibility mappings, and special declaration logic for archive_list_sessions and archive_search_sessions.
Test contract alignment
tests/infra/mcp.py, tests/unit/mcp/*
Updates expected tool names and removes envelope, discovery, and archive contract coverage for the removed tools.
Generated reference update
docs/mcp-reference.md
Changes the registered-tool count to 102 and removes both archive tool names from the index.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • Sinity/polylogue#2890: Adds the generator that renders the MCP reference tool index from the expected tool-name inventory.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The core sections are present, but the required Changelog entry for user-visible tool removal is missing. Add a one-line Changelog entry for the removed MCP tools and include any rollout or migration notes; add Risks/Follow-ups only if anything remains.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: removing duplicate MCP archive query tools.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix/mcp-query-continuations

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.

Problem: duplicate archive list/search entry points left an unpaged MCP\ncompatibility surface alongside the canonical query transaction.\n\nWhat changed: remove the obsolete API and MCP handlers, rename the\nHTTP helper to its canonical session-list role, and route paging proof\nthrough canonical search and list_sessions. Keep response-budget pages\nuseful for search hits and advance cursor requests with the effective\narchive offset.\n\nCompatibility/migration: the two obsolete MCP and Python API names are\nremoved without redirects; callers use search, list_sessions, or\nquery_sessions.\n\nCo-Authored-By: Codex <[email protected]>
@Sinity
Sinity merged commit c21717b into master Jul 18, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the feature/fix/mcp-query-continuations branch July 18, 2026 00:22
Sinity added a commit that referenced this pull request Jul 20, 2026
)

Ref polylogue-93cp demo program (runbook category A).

## Summary
Refreshes the deterministic basic-usage walkthrough artifacts against
current master — first refresh since #3178 (transcript crash fix), #3179
(import parity), #3182 (all-origins seeding) landed.

## Problem
Committed walkthrough outputs predated three merged changes that alter
demo-visible behavior: corpus grew 16→19 sessions / 62→71 messages
across 8 origins, index schema v40→v42, embeddings v3→v4, and the MCP
surface consolidation (#3056) renamed the tools the MCP walkthrough
exercises.

## Solution
Re-ran every walkthrough recorded command against a fresh scratch seed:
1-4 (find/read/search/resume) byte-identical — surface stability
demonstrated; 5/8 (cost, status/debt) refreshed with expected
corpus-growth deltas; 7 (MCP round-trip) refactored onto the query/read
dispatchers preserving the search→summary pattern; README stamp + schema
refs updated. Cold-reader gate re-answered from directory contents
alone. Produced by a Haiku lane; branch harvested by coordinator.

## Verification
Each walkthrough re-executed against a fresh `polylogue demo seed` in a
scratch root; diffs classified per-artifact (table in lane report);
`devtools verify --quick` 16/16 green.

Co-authored-by: Claude <[email protected]>
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