Skip to content

test(mcpx): execute the generated search() — ordering, tie-break, offset paging (#9598) - #9779

Merged
dezren39 merged 1 commit into
mainfrom
queue/16152-9598-search-test
Nov 14, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/16152-9598-search-test

Conversation

@dezren39

@dezren39 dezren39 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Fixes #9598 (task 16152): adds the behavioral test for the generated search() that CodeRabbit's PR #9205 review asked for.

What

New pkgs/mcpx/internal/codegen/search_behavior_test.go: TestGeneratedSearchBehavior generates a client from a fixture catalog (three namespaces, five tools, two recipes), writes it to a temp dir, and executes its search() under deno — the same runtime harness this package already uses for TestGeneratedClientWithAwkwardNamesTypeChecks (skips when deno is absent).

Fixture scoring for the query word "alpha" is deterministic: a word in a namespace/tool name scores 10, in prose only 1; ties break by sortKey (a recipe's "/name" key wins ties against tools).

Cases asserted on executed results

  • Full ordering across differing scores (10s before 1s) and tied scores across namespaces, tools, and recipes (recipe wins the tie).
  • Consecutive pages (limit 2 at offsets 0/2/4) tile the full order exactly.
  • A final partial page (limit 4, offset 4 yields the last 2).
  • An offset beyond the results yields [].
  • Negative offset behaves as 0; negative limit yields [].
  • Fractional offset/limit truncate (offset 1.9 starts at index 1; limit 2.9 yields 2).
  • Multi-word queries require every word (only mid/alphaprime matches "alpha prime"); empty query yields [].

Verification

  • go test ./internal/codegen/ -count=1: PASS (whole package, including the new test).
  • Mutation check: reversing the emitted score comparator (b.score - a.score) makes the new test FAIL while the source-string tests still pass — the regression class from the review is now covered.

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 14, 2026 05:37
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T05:37:19.569569Z
We couldn’t complete this review. Comment @codex review to try again.
e23c0f3 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.

@coderabbitai

coderabbitai Bot commented Nov 14, 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 2 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: 3943bff8-620b-4877-a377-c1d89e934249
Commits

Reviewing files that changed from the base of the PR and between 765802a and e23c0f3.

Files selected for processing: 1

  • pkgs/mcpx/internal/codegen/search_behavior_test.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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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.

mcpx codegen: generated search() has no behavioral test — offset-paging test only asserts emitted source strings (PR #9205)

1 participant