Skip to content

feat(web_search): add Exa provider support#34862

Closed
trolljode wants to merge 1 commit intoopenclaw:mainfrom
trolljode:feat/web-search-exa-provider
Closed

feat(web_search): add Exa provider support#34862
trolljode wants to merge 1 commit intoopenclaw:mainfrom
trolljode:feat/web-search-exa-provider

Conversation

@trolljode
Copy link
Copy Markdown

@trolljode trolljode commented Mar 4, 2026

Summary

  • add exa as a web_search provider with Exa Search API backend
  • add Exa API key resolution via tools.web.search.exa.apiKey and EXA_API_KEY
  • include Exa in provider auto-detection and missing-key guidance
  • extend runtime config schema, secret collectors/registry, and wizard messaging
  • update web docs + secret reference docs
  • add tests for Exa provider behavior and secrets coverage

Validation

  • pnpm vitest run src/agents/tools/web-tools.enabled-defaults.test.ts src/secrets/runtime.coverage.test.ts
  • pnpm oxlint --type-aware src/agents/tools/web-search.ts src/agents/tools/web-tools.enabled-defaults.test.ts src/config/zod-schema.agent-runtime.ts src/config/schema.help.ts src/config/schema.labels.ts src/secrets/runtime-config-collectors-core.ts src/secrets/runtime.coverage.test.ts src/secrets/target-registry-data.ts src/wizard/onboarding.finalize.ts
  • pnpm oxfmt --check docs/tools/web.md docs/reference/secretref-credential-surface.md docs/reference/secretref-user-supplied-credentials-matrix.json

@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M labels Mar 4, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR adds Exa as a sixth web search provider, integrating the Exa Search API throughout the codebase consistently with existing providers. The implementation follows established patterns: a typed ExaConfig/ExaSearchApiResponse, an EXA_API_KEY env-var fallback, withTrustedWebSearchEndpoint for guarded HTTP, wrapWebContent on all external strings, and a missing-key payload for user guidance.

Key changes:

  • src/agents/tools/web-search.ts — new runExaSearch, resolveExaConfig, resolveExaApiKey helpers; Exa inserted at auto-detection priority 2 (after Brave); createWebSearchTool updated for description and API-key resolution
  • src/config/zod-schema.agent-runtime.tsexa literal added to provider union; tools.web.search.exa sub-object registered
  • src/secrets/target-registry-data.ts, runtime-config-collectors-core.ts, and runtime.coverage.test.ts updated to cover the new secret path
  • src/wizard/onboarding.finalize.ts — Exa key/env handling added to the post-onboarding summary note
  • Docs and schema labels updated end-to-end

One minor style issue: after inserting Exa at step 2 in the auto-detection chain, the inline step comments for Kimi (// 3. Kimi), Perplexity (// 4. Perplexity), and Grok (// 5. Grok) were not incremented to match the updated documentation (steps 4, 5, and 6 respectively).

Confidence Score: 5/5

  • This PR is safe to merge — the Exa provider integration is complete, consistent, and well-tested.
  • All integration points (schema, secret registry, collectors, wizard, docs) are updated consistently. The implementation mirrors the patterns of existing structured-result providers (Brave, Perplexity) with no omissions in security wrapping or key resolution. Tests cover the missing-key path, the happy-path API call with result mapping, and the proxy-dispatch matrix. The only finding is a trivial comment-numbering inconsistency that has no runtime impact.
  • No files require special attention.

Last reviewed commit: d450a88

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 4, 2026

Additional Comments (1)

src/agents/tools/web-search.ts, line 519
Auto-detection step comments are off-by-one

After inserting Exa at position 2, the inline step comments for Kimi (// 3. Kimi), Perplexity (// 4. Perplexity), and Grok (// 5. Grok) were not incremented. The docs/tools/web.md auto-detection table now correctly shows Kimi at step 4, Perplexity at step 5, and Grok at step 6 — the code comments should match.

Update the three comments to // 4. Kimi, // 5. Perplexity, and // 6. Grok respectively to stay in sync with the documentation.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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: d450a88083

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

z.literal("grok"),
z.literal("gemini"),
z.literal("kimi"),
z.literal("exa"),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Sync public web-search types with the new Exa provider

Adding "exa" to the runtime schema here makes Exa a valid config at runtime, but the exported ToolsConfig type still only allows "brave" | "perplexity" | "grok" | "gemini" | "kimi" and has no search.exa block (src/config/types.tools.ts:443-487). That leaves TypeScript consumers unable to compile valid Exa configs even though the runtime accepts them, which is a real API contract regression for typed integrations.

Useful? React with 👍 / 👎.

@vincentkoc
Copy link
Copy Markdown
Member

I appreciate the contribution here.

I'm closing this as a duplicate of #52617. The merged PR now lands the bundled Exa provider on top of the rebased plugin-owned search path, so this branch is superseded.

If there is still a distinct behavior gap, point me to it and I can reopen review right away.

@vincentkoc vincentkoc closed this Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants