Skip to content

fix(mcpx): completion limiter mints no buckets for unknown servers (#6978) - #8721

Merged
dezren39 merged 1 commit into
mainfrom
queue/14973-6978-completion-limiter-unknown
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/14973-6978-completion-limiter-unknown

Conversation

@dezren39

@dezren39 dezren39 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Fixes #6978.

What

handleComplete admitted through the completion rate limiter keyed by CanonicalName(req.Server), which returns a name the registry does not know unchanged -- so every distinct bogus server name minted a fresh pair of limiter buckets before the pool lookup rejected it, and the per-server window never bound an unknown name.

  • registry.go: new KnownServer(nameOrNS) -- configured name, live pool name, or a configured server's namespace; map reads only, no lease, no upstream (same contract as CanonicalName).
  • ops.go: limiter admission now runs only when KnownServer(req.Server); unknown names fall through to the pool lookup's existing 400 without counting anything. Refusal-before-pool for configured servers is unchanged.
  • Tests: the refusal-before-pool, per-server-window, hot-change, and shared-PID tests previously exercised the limiter through an UNKNOWN name on an empty registry -- the contract mcpx(completion): rate limiter admits before pool validation — unknown server names mint fresh limiter buckets, so the per-server window never binds bogus names and bucket growth is request-rate × window #6978 removes. They now run against a known-but-pool-less registry (configured view, no pool), preserving every existing expectation. New TestHandleCompleteUnknownServersMintNoLimiterBuckets pins: repeats under one unknown name never 429, 20 distinct unknown names all 400, limiter bucket count stays 0, and the same name under a knowing registry is still limited.

Verification

  • go test ./internal/daemon/ -run Complete -count=1: all 6 completion tests pass, including the new one.
  • Full package: go test ./internal/daemon/ -count=1 -- ok (169.8s), via fleet-build-lock on the laptop.

Task 14973 (lane code-b).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 11, 2026 15:26
@coderabbitai

coderabbitai Bot commented Nov 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 87bcf165-da8d-419a-892c-f38062d0113a
Commits

Reviewing files that changed from the base of the PR and between 8c17d5c and 816a236.

Files selected for processing: 3

  • pkgs/mcpx/internal/daemon/completion_ratelimit_test.go
  • pkgs/mcpx/internal/daemon/ops.go
  • pkgs/mcpx/internal/daemon/registry.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T15:28:19.081365Z 816a236 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant