fix(cli): pace generated MCP clients#2809
Conversation
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 require-ready-label-and-ciWonderful, this rule succeeded.
|
Greptile SummaryThis PR fixes a gap where generated MCP clients for non-sniffed specs passed
Confidence Score: 5/5Safe to merge. The change is narrowly scoped to the rate-limit argument of The old branching logic left non-sniffed MCP clients with pacing fully disabled. The fix is a one-liner in the template backed by a named constant, the test guards against the old No files require special attention. The template and its six golden outputs are all in sync. Important Files Changed
|
Merge Queue Status
This pull request spent 24 minutes 9 seconds in the queue, including 23 minutes 55 seconds running CI. Required conditions to merge
|
Summary
Generated MCP servers now construct their client with a non-zero MCP rate limit instead of passing
0and disabling pacing. This keeps agent-driven MCP fan-out on the adaptive limiter path while preserving the existing no-cache behavior for fresh MCP reads.The generator test now covers both normal and sniffed specs, asserts the old
client.New(..., 0)call is absent, and compiles the generated module. Golden MCP fixtures were updated for the emitted constant and call-site change.Closes #2706
Tests
go test ./internal/generator -run '^TestGenerateMCPNewClientUsesPoliteRateLimitAndSkipsCache$'scripts/golden.sh verifyscripts/verify-generator-output.shgo test ./internal/pipelinego test ./...go build -o ./cli-printing-press ./cmd/cli-printing-pressgolangci-lint run ./...Note: the first
go test ./...run hit unrelatedinternal/pipelinelive-check 5s subprocess timeouts under load. A targetedgo test ./internal/pipelinererun passed, followed by a passing fullgo test ./...rerun.