Pin Lite's MCP read tools under the #4198 response budget (#4198) - #4290
Merged
Merged
Conversation
Part of #4198. Mirrors Darling's McpReadToolBudgetLiveTests: reflects over every [McpServerTool] in the Lite service assembly, excludes analyze_*/ compare_*/audit_config/mute_analysis_finding, binds each remaining tool's parameters generically and asserts the reply stays under McpResponseBudget.DefaultBytes on one busy DuckDB-only fixture. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TszxYhJJbTEh4LrZ56NYo3
The exempt row's comment said "#4268, still open", but #4268 merged. Word it like Darling's twin row: #4268 compacts only healthy collectors, this fixture's are not, so the tool stays over and open under #4198. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FVjn4PBJN71NQXdFo6ZxNQ
erikdarlingdata
marked this pull request as ready for review
September 25, 2026 14:48
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4198.
Why
#4224 added a test that measures every Darling MCP read tool against the shared 32 KB response budget. If a change makes a tool's default answer too big, that test fails. Lite has 89 MCP tools and had no such test. A tool that grew past the budget on Lite alone went unnoticed.
What changes
This PR adds
Lite.Tests/McpReadToolBudgetTests.cs, Lite's version of Darling's test. It runs on DuckDB and needs no PostgreSQL rig, like the other*BudgetTestsclasses in Lite.[McpServerTool]method in the Lite assembly by reflection. A new tool is measured with no change here.analyze_*(5 tools),compare_analysisandaudit_configby name. It skips write tools through an exact list. The lane checked all 89 tool names for add, create, update, delete, remove, set and mute verbs. Lite has no MCP tools for adding servers, Custom Views, custom alert rules or notification routes, somute_analysis_findingis its only write tool. As in Darling's test, a new write tool must be added to the list on purpose.LocalDataService,ServerManager,AnalysisServiceandMcpToolGuideCatalogcome by type, andserver_nameis the seeded server. Every other parameter keeps its default.McpPageContractTests,QueryStoreRegressionsBudgetTestsandQueryStoreTopBudgetTestsalready use against this DuckDB schema. The seed holds:McpResponseBudget.DefaultBytes. The test fails when a tool is over the budget and not inExemptOffenders. It also fails when an exempt tool now fits, or when an exempt name was not measured at all.The exempt list
get_collection_health#4268 made
get_collection_healthcompact only healthy collectors with nothing to report. This fixture's collectors are not healthy on purpose, so nothing compacts and the answer stays over the budget. Darling's test exempts the same tool for the same reason. #4268 is merged, and the tool stays open under #4198. No other Lite tool measured over the budget.The largest answers on this fixture
get_collection_healthget_query_store_regressionsget_plan_correctionsget_long_query_completionsget_query_store_topget_collection_logget_blocked_process_reportsget_blocked_process_xmlget_deadlock_detailget_deadlocksget_blocking_statsThe test measured 81 read tools: 89 tools, minus the write tool and the 7 skipped by name. The other 70 answered 2,373 bytes or less.
Known gaps
Some tools pass without a real test:
get_mute_rules(itsMuteRuleServiceis not built by the test),get_perfmon_trend(counter_name),get_plan_xml(query_hash),get_query_trend(query_hash,database_name) andget_wait_trend(wait_type).get_index_usageandget_object_locking(index_object_stats),get_query_heatmap,get_top_queries_by_cpuandget_top_procedures_by_cpu(query_stats), orget_analysis_findings.Test plan
dotnet build Lite.Tests/Lite.Tests.csproj -c Debug: 0 warnings, 0 errors.McpReadToolBudgetTests: 1 test, 0 failed.origin/devwas already merged in.8e0c6214ran it: build, Darling PostgreSQL tests and Lite tests all pass.8e0c6214: MCP budget: get_collection_health compacts healthy collectors under the size budget (#4198) #4268 is merged, and the row stays open under MCP read tools have no default response-size budget: at default arguments 12 tools return >50 KB and 3 return >100 KB for one server, more than an agent client's per-result cap #4198.CHANGELOG entry
None. This PR changes tests only.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FVjn4PBJN71NQXdFo6ZxNQ