Skip to content

fix(mcp): dynamically generate web search provider enum from registry - #10209

Merged
diegosouzapw merged 4 commits into
cheaper-inference:release/v3.8.50from
sadSanta-07:fix-mcp-clean
Aug 17, 2026
Merged

diegosouzapw merged 4 commits into
cheaper-inference:release/v3.8.50from
sadSanta-07:fix-mcp-clean

Conversation

@sadSanta-07

Copy link
Copy Markdown
Contributor

Fixes #10159

@kanishk619

Copy link
Copy Markdown

I think the same search registry can also be used for return search providers in /api/v1/search endpoints as it also doesn't evaluate the search providers dynamically, instead relies on if else block checks.

@diegosouzapw
diegosouzapw changed the base branch from main to release/v3.8.50 August 13, 2026 13:49
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Good direction — generating the web-search provider enum from the registry avoids drift. One check: the MCP tool schema is exposed to clients; could you confirm the dynamic enum doesn't break the Zod contract or scope? Otherwise mergeable.

@sadSanta-07
sadSanta-07 force-pushed the fix-mcp-clean branch 2 times, most recently from 2ce8afe to 39dd0e3 Compare August 13, 2026 15:53
sadSanta-07 and others added 3 commits August 15, 2026 08:53
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
…x firecrawl searchType arg

The enum-dynamic refactor dropped search.ts's no-explicit-any suppression
while a new Record<string,any> map re-introduced anys, and the response
normalizer map swapped the firecrawl searchType argument with query. Type
both maps explicitly, restore the base suppression (33 pre-existing anys),
and pass searchType (not query) to normalizeFirecrawlSearchResponse.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Babysit summary — CI green

Verdict: mostly STALE + two real defects fixed.

The PR was 76 commits behind release/v3.8.50; most of the reds (Merge integrity, Fast Quality Gates, unit-test shards, Build advisory, dast-smoke) were stale verdicts that a refresh-merge into the current base cleared. Two genuine defects were found and fixed.

Committed on the PR branch (preserving sadSanta-07 authorship, co-authored with maintainer):

  • 44b17e26 — fix(mcp): restore search.ts eslint suppression, type builder maps, fix firecrawl searchType arg
    • No new ESLint warnings: the enum refactor had removed search.ts's no-explicit-any suppression (33 pre-existing anys) while adding 2 new Record<string, any> builder/normalizer maps + an any typed firecrawl lambda. Typed both maps (SearchRequestBuilder, SearchResponseNormalizer) and restored the base 33-count suppression → lint:json --max-warnings 0 green.
    • Firecrawl regression (caught by firecrawl-search.test.ts): the response-normalizer map passed query as the searchType argument to normalizeFirecrawlSearchResponse, changing news-source results to web. Now passes searchType correctly — handleSearch firecrawl maps search_type news to sources news goes back to green.

Also incorporated 4a95ee81 (the contributor's test(mcp): add a contract test for dynamic web search provider enum) via the merge — it passes and was preserved, not overwritten.

Local validation: firecrawl-search, mcp-web-search-provider-enum-contract, search-handler-*, search-registry (89 tests) all pass; ESLint clean on all changed files with suppressions; prettier --check clean; check:t11-any-budget PASS.

CI (run against base tip, base green): No new ESLint warnings ✅ · Unit Tests fast-path 1–4/4 ✅ · Fast Quality Gates ✅ · Merge integrity ✅ · Build (advisory) ✅ · dast-smoke ✅ · All others ✅. No pending checks; PR is OPEN.

Ready for human review and merge.

@diegosouzapw

Copy link
Copy Markdown
Collaborator

✅ Evidência de merge-train antes do merge

#10209 foi embarcada no train combinado 8ed587f50410665b2924b372e59f518e420a02bd, validado em root@192.168.0.113 (tomni-proxmox-113). O log é /srv/omniroute-train/.claude/worktrees/merge-train-20260817-085938-suite.log.

Modo FAST verde: typecheck, file-size, complexidade ciclomática e cognitiva, changelog integrity, teste alterado mcp-web-search-provider-enum-contract.test.ts e Vitest. A suíte full da release continua sendo executada separadamente no tip acumulado.

Obrigado @sadSanta-07 pela contribuição; o PR segue para merge serializado em release/v3.8.50 sob a autorização da campanha.

@diegosouzapw
diegosouzapw merged commit 8ff3a1d into cheaper-inference:release/v3.8.50 Aug 17, 2026
16 checks passed
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…cheaper-inference#10209)

* fix(mcp): dynamically generate web search provider enum from registry

* test(mcp): add contract test for dynamic web search provider enum

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

* fix(mcp): restore search.ts eslint suppression, type builder maps, fix firecrawl searchType arg

The enum-dynamic refactor dropped search.ts's no-explicit-any suppression
while a new Record<string,any> map re-introduced anys, and the response
normalizer map swapped the firecrawl searchType argument with query. Type
both maps explicitly, restore the base suppression (33 pre-existing anys),
and pass searchType (not query) to normalizeFirecrawlSearchResponse.

Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>

---------

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>
Co-authored-by: sadSanta-07 <sadSanta-07@users.noreply.github.com>
Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
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.

[BUG] MCP omniroute_web_search missing firecrawl provider and has hardcoded provider enum

4 participants