Skip to content

feat(mcpx): in-script search also finds saved scripts (CODE-36) for #1937 - #9299

Merged
dezren39 merged 2 commits into
mainfrom
queue/9316-1937-search-recipes
Nov 13, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/9316-1937-search-recipes

Conversation

@dezren39

@dezren39 dezren39 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

CODE-36 for #1937: in-script search() also finds saved scripts

Part of task 9316 (remaining mcpx exec #1937 behaviors). PR #9205 landed CODE-35 (search offset paging) and CODE-30 (typed failure kinds); this lands CODE-36. CODE-19 (final top-level expression) remains open on #1937.

What changes

  • codegen: new RecipeMeta (name, summary, placeholder names) and ModuleWithRecipes(...); Module(...) delegates with no recipes, so existing callers' output is unchanged apart from the new empty __recipeMeta array (one generated search shape either way).
  • Generated search(): saved scripts are scored with the same rules as tools (a word in the name beats a word in the prose) and returned as kind: "recipe" matches beside kind: "tool" matches, in one stable order — tools by namespace then name, recipes by name under an empty namespace — so limit/offset paging across the combined list stays exact (CODE-35). ToolMatch gains the kind: "tool" discriminant; a recipe match carries name, description, params, required, and no callable.
  • daemon: both client-generation sites now supply the daemon's loaded recipes — registrySource (the exec service's ClientModule/ClientModuleFor, TypeScript target) and the consumer execScript path. Server.recipeMetas() converts recipes.Recipe → codegen.RecipeMeta; a recipe that opted out of tool exposure (@tool false) is not offered in search either. The Python target has no in-script search today and is unchanged.

Tests

  • TestGeneratedSearchIncludesRecipes (codegen): recipe data emitted, both kind discriminants present, plain Module still emits an empty __recipeMeta and no recipe it was not given. The CODE-35 shape test's comparator expectation updated to the unified sortKey.
  • TestSearchFindsRecipesAlongsideTools (execsvc, real runtime): a script calling search("screenshot") against a generated client gets recipe:screenshot-and-diff:url,baseline and tool:capture_screenshot:url.
  • Full packages on the laptop: go test ./internal/codegen ./internal/execsvc ./internal/daemon ./internal/cli ./internal/runner -count=1 — all pass; go vet clean; gofmt clean.

Docs


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

The generated client's search() ranked tools only; saved scripts (recipes) were matched from the CLI/daemon but not from inside a script. codegen gains RecipeMeta and ModuleWithRecipes (Module delegates with none, so existing callers keep one generated search shape, now with an empty __recipeMeta). search() scores recipes with the tools weighting and returns them as kind recipe matches beside kind tool matches in one stable order (tools by namespace/name, recipes by name under an empty namespace), so limit/offset paging across the combined list stays exact. The daemon supplies its loaded recipes at both generation sites (registrySource for the exec service, consumer execScript); a recipe that opted out of tool exposure is not offered in search either. Tests: TestGeneratedSearchIncludesRecipes (codegen shape), TestSearchFindsRecipesAlongsideTools (execsvc, real runtime); full codegen/execsvc/daemon/cli/runner packages pass on the laptop, vet and gofmt clean. Docs: interfaces.md and the CODE-36 register row.
@dezren39
dezren39 requested a review from a team as a code owner November 13, 2026 04:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 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-13T05:00:59.867356Z 1442718 Manual request
ℹ️ 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 13, 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 26 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: bcafef04-ee2c-4282-a6a6-a2618ced3e54
Commits

Reviewing files that changed from the base of the PR and between 1136079 and 1442718.

Files selected for processing: 9

  • pkgs/mcpx/docs/compare/register/code-mode.md
  • pkgs/mcpx/docs/interfaces.md
  • pkgs/mcpx/internal/codegen/codegen_test.go
  • pkgs/mcpx/internal/codegen/emit.go
  • pkgs/mcpx/internal/daemon/client_recipes_test.go
  • pkgs/mcpx/internal/daemon/consumer.go
  • pkgs/mcpx/internal/daemon/routes_exec.go
  • pkgs/mcpx/internal/daemon/server.go
  • pkgs/mcpx/internal/execsvc/execsvc_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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 61355ef7e0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pkgs/mcpx/internal/codegen/emit.go Resolved
…(CODE-36, #1937)

Codex review on PR #9299 (P2): handleClient in daemon/server.go emitted the client through language.EmitModule, which reaches codegen.Module and therefore an empty recipe list -- and that endpoint is the one local mcpx exec/run fetch, so saved scripts only appeared in search for daemon-hosted execution. The TypeScript branch of handleClient now emits ModuleWithRecipes with the daemon's loaded recipes; other languages are unchanged. Test: TestHandleClientIncludesRecipesInSearch serves a temp scripts dir through handleClient and asserts the recipe lands in the module.
@dezren39

Copy link
Copy Markdown
Member Author

@codex review

Both P2 findings on 3f1ee40 are fixed in bbe9dac (replies on each thread): the CLI envelope now forwards error/errorKind, and preflight timeouts are classified as timeout with the runner preserving the deadline signal. New regression tests in internal/cli, internal/execsvc, and internal/runner; all four affected packages pass on the laptop, vet clean.

@dezren39

Copy link
Copy Markdown
Member Author

@codex review

Correction to the previous comment (it carried the re-review text from PR #9205 by mistake): for PR #9299, the single P2 finding — the HTTP-generated TypeScript client (handleClient) emitting no recipes — is fixed in 1442718, replied on its thread, with the new TestHandleClientIncludesRecipesInSearch regression test. Please re-review head 1442718.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 14427184da

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@dezren39
dezren39 merged commit 936424f into main Nov 13, 2026
12 of 14 checks passed
@dezren39
dezren39 deleted the queue/9316-1937-search-recipes branch November 13, 2026 05:03
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