Skip to content

Make upstream deprecations visible in the test suite - #147

Open
tony wants to merge 2 commits into
masterfrom
deprecation-warnings-visible
Open

Make upstream deprecations visible in the test suite#147
tony wants to merge 2 commits into
masterfrom
deprecation-warnings-visible

Conversation

@tony

@tony tony commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Audits the agentgrep MCP surface against the MCP deprecated features registry and adds a standing guard so the next upstream deprecation surfaces on its own.

Audit result: nothing to migrate

MCP adopted a formal feature lifecycle (SEP-2596) — Active / Deprecated / Removed, with a twelve-month minimum window. Six features are currently Deprecated. agentgrep uses none of them:

Deprecated feature Deprecated in agentgrep
Roots 2026-07-28 not used
Sampling 2026-07-28 not used
Logging 2026-07-28 never sends log messages to clients
Dynamic Client Registration 2026-07-28 not used, no auth
includeContext: "thisServer" / "allServers" 2025-11-25 not used, no sampling
HTTP+SSE transport 2025-03-26 not used, stdio only

Verified by building the server and exercising all 11 tools, 6 resources, and 3 prompts under -W error::DeprecationWarning: zero warnings, no filterwarnings suppressing anything.

Worth recording for future work: Roots is the natural fit for passing directories to a search server, and it is now Deprecated. Its migration path is "pass directories or files via tool parameters," which search already does through cwd, repo, and branch. Project and repository awareness should keep using tool parameters rather than adopting Roots.

What this changes

Deprecation warnings are now errors in the suite. Python silences DeprecationWarning outside __main__ by default, so an upstream deprecation reaches end users before it reaches the suite — the cost lands on the release that removes a feature rather than the one that announces it. The suite is already clean under the setting, so this is free today and load-bearing later. The escape hatch is a narrow per-module ignore with the migration tracked, not relaxing the blanket rule.

fastmcp is capped below 4.0. FastMCP 4.0 renames camelCase result fields behind a deprecation bridge, and tests/test_mcp_response_limiting.py reads three of them (outputSchema, isError, structuredContent). Without the cap, a 4.x resolve would start emitting FastMCPDeprecationWarning — which the escalation above turns into a failure. The cap also protects the response-limiting middleware, which specializes the private _truncate_to_result. The lockfile already pinned 3.4.4, so this only affects consumers resolving the range themselves.

FastMCPDeprecationWarning subclasses DeprecationWarning, so the escalation genuinely covers it — verified by triggering one under the filter, not by inspection alone.

Test plan

Full gate green: ruff check, ruff format, ty check, pytest -m "" --reruns 0 (223 passed), just build-docs.

@tony
tony force-pushed the deprecation-warnings-visible branch from 1fdb40b to 59e0e6e Compare July 25, 2026 22:25
@tony tony changed the title Audit the MCP surface against upstream deprecations Make upstream deprecations visible in the test suite Jul 25, 2026
@tony
tony force-pushed the deprecation-warnings-visible branch from 59e0e6e to 36997db Compare July 26, 2026 11:17
@tony
tony force-pushed the deprecation-warnings-visible branch from 36997db to fdca3c3 Compare August 1, 2026 17:55
tony added 2 commits August 9, 2026 07:02
why: Two things make an unbounded range unsafe for end users.
AgentgrepResponseLimitingMiddleware specializes _truncate_to_result, a
private FastMCP helper carrying no compatibility guarantee, and FastMCP
4.0 is a documented breaking major that renames camelCase result fields
behind a deprecation bridge. The lockfile pins 3.4.4 for CI, so this
only affects consumers resolving the range themselves.

what:
- Constrain the runtime requirement to fastmcp>=3.4.0,<4 and record why
  the cap exists and what has to be verified before lifting it.
- Refresh uv.lock; resolution is unchanged at 139 packages.
why: Python silences DeprecationWarning outside __main__ by default, so
an upstream deprecation reaches end users before it ever reaches the
suite. The cost lands on the release that removes the feature rather
than the one that announces it, which is the expensive end. MCP now runs
a formal deprecation policy with a twelve-month window, so the signal
this surfaces is worth acting on.

what:
- Escalate DeprecationWarning and PendingDeprecationWarning to errors in
  the pytest configuration.
- Record the escape hatch: a narrow per-module ignore with the migration
  tracked, rather than relaxing the blanket rule.
@tony
tony force-pushed the deprecation-warnings-visible branch from fdca3c3 to f19b658 Compare August 9, 2026 12:02
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