Repository navigation
feat(tool-runtime): add optional Firecrawl web search provider - #160
Open
JuampiHernandez wants to merge 1 commit into
Open
JuampiHernandez wants to merge 1 commit into
JuampiHernandez wants to merge 1 commit into
Conversation
FIRECRAWL_API_KEY adds a firecrawl provider that calls Firecrawl /v2/search. It joins the default fallback chain only when the key is set, right after the first provider, and every existing provider keeps its order. WEB_SEARCH_PROVIDER and WEB_SEARCH_PROVIDER_PRIORITY can also select it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I'm Juan from the Firecrawl team. Lime's search fallback chain looked like a good fit for Firecrawl search, so I wanted to offer it as an optional provider.
变更摘要
WebSearchtool intool-runtime. It calls Firecrawl/v2/search(POST https://api.firecrawl.dev/v2/searchwith a Bearer key,limit10) and mapsdata.web[]to the existingSearchResult(title, url, description as the snippet). A result with no title uses its URL, and a result with no URL is skipped.FIRECRAWL_API_KEY. When it is unset or blank, the default chain is exactly what it is today and Firecrawl is never called. When it is set,firecrawljoins the default chain in second place, and every existing provider keeps its relative order.WEB_SEARCH_PROVIDER=firecrawlorWEB_SEARCH_PROVIDER_PRIORITYcan also select it, like the other providers. A failed request (missing key, HTTP error, bad JSON) is a single-provider error, in Chinese like the existing ones, and the chain moves on.lime-rs/crates/tool-runtime/src/web_search.rsandweb_search/support.rs. The Firecrawl request and response mapping live in a newweb_search/firecrawl.rs, included likesupport.rs, and the tests in a newweb_search/firecrawl_tests.rsmodule, soweb_search.rsonly gains the provider dispatch arm.serve_oncein the existing test module is nowpub(super)so the new module can reuse it. Docs: the env table inREADME.mdandREADME.zh-CN.md, and the search section ofinternal/aiprompts/architecture.md. Nothing deleted, no new dependency (reqwestandserde_jsonare already used by the crate). Contributed under the repository's GPL-3.0 license.i18n 影响
新增 / 变更 namespace
术语确认
internal/roadmap/i18n/glossary.md验证
npm run i18n:checknpm run verify:localcargo test -p tool-runtime --lib(all pass, including the newweb_search::firecrawl_tests),cargo clippy -p tool-runtime --lib --tests(no warnings on changed lines),cargo fmt -p tool-runtime -- --check, andnode scripts/governance/check-architecture-confirmation.mjsagainst this description (ok). Run on Linux with Rust 1.100.0 and the rusty_v8 artifacts fromscripts/lib/rusty-v8-artifacts.mjs.Live runs through
execute_web_searchinLivemode with a real Firecrawl key:WEB_SEARCH_PROVIDER=firecrawl:selected_providerisfirecrawlwith real results (docs.rs/tokio, tokio.rs).FIRECRAWL_API_KEYset: the first provider reports its missing key, thenfirecrawlanswers.FIRECRAWL_API_KEYunset:configured_prioritymatches main exactly andmulti_search_engineanswers.firecrawlattempt records the 401 and the chain falls through. The key doesn't appear in the output or metadata.Not run:
npm run verify:local,npm run test:contractsandnpm run verify:gui-smoke(no GUI on that machine). On Linux, buildingtool-runtimeneeded a local, uncommittedignore.workspace = trueinlime-rs/crates/linux-sandbox/Cargo.toml, becausebwrap.rsusesignore::without declaring it. That happens on unchangedmaintoo and isn't part of this PR.架构图确认
非重大原因:不适用;按仓库对 tool-runtime 敏感路径的门禁分类进行架构确认。实际范围是 web_search 内一个可选搜索提供商,没有新增协议、持久化或 runtime。
internal/aiprompts/architecture.md和相关执行计划架构影响:tool-runtime::web_search 的 provider selection 在 FIRECRAWL_API_KEY 非空时加入 firecrawl,位置紧接默认链路第一项;请求与响应适配留在 web_search 内,失败沿既有回退链和工具结果投影;不改变模型 Provider 控制面、权限或存储 owner。
架构图更新章节:internal/aiprompts/architecture.md 的“6.3 Provider 与工具组”本地网页搜索链路,新增可选 Firecrawl /v2/search adapter 一行和一段说明。
责任开发者确认:贡献者已核对目录归属、数据流、依赖方向、协议边界与定向回归,请维护者审阅时复核。
备注
FIRECRAWL_API_KEYis the name the Firecrawl CLI and SDKs also read, so someone who already has it set will seefirecrawljoin the default chain. If you'd rather keep it opt-in only (selected throughWEB_SEARCH_PROVIDER/WEB_SEARCH_PROVIDER_PRIORITY), it's a small change and I'm happy to make it.