Skip to content

feat(tools): add MiniMax as bundled web search provider#54648

Merged
steipete merged 1 commit intoopenclaw:mainfrom
JithendraNara:feat/minimax-web-search-provider
Apr 4, 2026
Merged

feat(tools): add MiniMax as bundled web search provider#54648
steipete merged 1 commit intoopenclaw:mainfrom
JithendraNara:feat/minimax-web-search-provider

Conversation

@JithendraNara
Copy link
Copy Markdown

@JithendraNara JithendraNara commented Mar 25, 2026

Summary

  • MiniMax is the only first-class model provider in OpenClaw without a bundled web search provider — users had to rely on MCP. This adds native support via their Coding Plan search API (POST /v1/coding_plan/search).
  • Supports global (api.minimax.io) and CN (api.minimaxi.com) endpoints, inferred from explicit region config, model provider base URL, or minimax-portal OAuth base URL.
  • Prefers MINIMAX_CODE_PLAN_KEY over MINIMAX_API_KEY in credential fallback, matching existing repo precedence.
  • Accepts SecretRef objects for webSearch.apiKey, matching all other bundled web search providers.
  • What did NOT change: existing providers, config schema, MiniMax model/auth/media-understanding logic.

Change Type

  • Feature

Scope

  • Skills / tool execution
  • Integrations

Linked Issues

User-visible / Behavior Changes

  • minimax available as tools.web.search.provider option
  • Auto-detection picks MiniMax when MINIMAX_CODE_PLAN_KEY or MINIMAX_API_KEY is set (priority 15)
  • openclaw configure --section web lists MiniMax as a search provider

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No — reuses existing env vars and standard credential resolution
  • New/changed network calls? Yes — POST /v1/coding_plan/search via withTrustedWebSearchEndpoint()
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Verification

pnpm build
pnpm check
pnpm test:extension minimax          # 18 passed
pnpm test -- src/plugins/bundled-web-search.test.ts  # 4 passed (alignment)
pnpm test:contracts                  # 130 passed

Manual API verification: curl -X POST https://api.minimax.io/v1/coding_plan/search returns structured organic results.

Human Verification

  • Verified: API returns valid results, build/lint/check/contracts all pass, existing tests unaffected
  • Edge cases: missing key error, CN endpoint inference from base URL, portal OAuth CN path, SecretRef schema
  • Not verified: openclaw configure --section web UI, auto-detection with all providers active simultaneously

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery

  • Set tools.web.search.provider to another provider, or revert 9 changed files
  • Watch for: auth errors when minimax auto-detected but key is non-Coding-Plan

Risks and Mitigations

  • Risk: Search API is Coding Plan only
    • Mitigation: clear error message with both env var names; API returns distinct status codes

AI-assisted (Claude Code). I understand what the code does.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 25, 2026

Greptile Summary

This PR adds MiniMax as a new bundled web search provider, following the established pattern of existing providers (Brave, Kimi) with caching, credential resolution, trusted-endpoint wrapping, and base_resp error checking. The integration is structurally sound and the registration wiring in index.ts, bundled-web-search-registry.ts, and bundled-web-search-provider-ids.ts all look correct.

Key concerns found during review:

  • Cache key omits endpoint (minimax-web-search-provider.ts line 173): The cache key is built from ["minimax", query, resolvedCount] but does not include the resolved endpoint. Global and CN region configurations sharing the same query and count will collide on the same cache entry, causing one region's results to be silently served to the other. This is a correctness bug that should be fixed before merge (compare Kimi, which includes baseUrl in its key).
  • count not forwarded to the API (lines 88–93): The POST body only contains { q: query }; the resolved count is applied client-side via .slice(). If the MiniMax Coding Plan API supports a result-count parameter, this means the API always returns its default page size and users requesting more results than that default will silently receive fewer.
  • No test file: Unlike Brave and Kimi, no .test.ts companion was added for the new provider, leaving internal helpers (resolveMiniMaxEndpoint, runMiniMaxSearch) without unit coverage.

Confidence Score: 3/5

  • One real correctness bug (cache key missing region/endpoint) should be fixed before merge; otherwise the implementation is clean and well-structured.
  • The cache-key omission of endpoint is a concrete correctness bug: global and CN regions will silently share and corrupt each other's cached search results. This is the primary user path for the new feature, so it warrants a 3. The implementation is otherwise well-aligned with existing providers and the wiring changes are minimal and correct.
  • extensions/minimax/src/minimax-web-search-provider.ts — cache key construction and API request body.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/minimax/src/minimax-web-search-provider.ts
Line: 88-93

Comment:
**`count` not forwarded to the API request**

`params.count` is resolved and passed to `runMiniMaxSearch`, but the `POST` body only ever sends `{ q: params.query }`. The result set is then trimmed client-side with `.slice(0, params.count)`.

If the MiniMax Coding Plan API supports a result-count parameter (e.g. `num` or `n`), not forwarding it means the API always returns its default page size. When the user requests more results than the API default, the slice will silently under-deliver without any error.

Consider adding `num: params.count` (or whatever the API field is called) to the request body so the API is asked for the right number of results upfront.

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: extensions/minimax/src/minimax-web-search-provider.ts
Line: 173

Comment:
**Cache key missing `endpoint` (region)**

The cache key only includes `["minimax", query, resolvedCount]` but omits the `endpoint`. Because the endpoint differs between global and CN regions, two separate configurations with the same query and count will collide on the same cache entry — a global-region result would be returned for a CN-region request (and vice versa).

Kimi's implementation shows the pattern: it includes `baseUrl` in the cache key to prevent exactly this kind of cross-region collision. The fix is to add `endpoint` as a component:

```
buildSearchCacheKey(["minimax", endpoint, query, resolvedCount])
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat: add MiniMax as bundled web search ..." | Re-trigger Greptile

Comment on lines +88 to +93
},
body: JSON.stringify({ q: params.query }),
},
},
async (res) => {
if (!res.ok) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 count not forwarded to the API request

params.count is resolved and passed to runMiniMaxSearch, but the POST body only ever sends { q: params.query }. The result set is then trimmed client-side with .slice(0, params.count).

If the MiniMax Coding Plan API supports a result-count parameter (e.g. num or n), not forwarding it means the API always returns its default page size. When the user requests more results than the API default, the slice will silently under-deliver without any error.

Consider adding num: params.count (or whatever the API field is called) to the request body so the API is asked for the right number of results upfront.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/minimax/src/minimax-web-search-provider.ts
Line: 88-93

Comment:
**`count` not forwarded to the API request**

`params.count` is resolved and passed to `runMiniMaxSearch`, but the `POST` body only ever sends `{ q: params.query }`. The result set is then trimmed client-side with `.slice(0, params.count)`.

If the MiniMax Coding Plan API supports a result-count parameter (e.g. `num` or `n`), not forwarding it means the API always returns its default page size. When the user requests more results than the API default, the slice will silently under-deliver without any error.

Consider adding `num: params.count` (or whatever the API field is called) to the request body so the API is asked for the right number of results upfront.

How can I resolve this? If you propose a fix, please make it concise.

const resolvedCount = resolveSearchCount(count, DEFAULT_SEARCH_COUNT);
const endpoint = resolveMiniMaxEndpoint(searchConfig);

const cacheKey = buildSearchCacheKey(["minimax", query, resolvedCount]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Cache key missing endpoint (region)

The cache key only includes ["minimax", query, resolvedCount] but omits the endpoint. Because the endpoint differs between global and CN regions, two separate configurations with the same query and count will collide on the same cache entry — a global-region result would be returned for a CN-region request (and vice versa).

Kimi's implementation shows the pattern: it includes baseUrl in the cache key to prevent exactly this kind of cross-region collision. The fix is to add endpoint as a component:

buildSearchCacheKey(["minimax", endpoint, query, resolvedCount])
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/minimax/src/minimax-web-search-provider.ts
Line: 173

Comment:
**Cache key missing `endpoint` (region)**

The cache key only includes `["minimax", query, resolvedCount]` but omits the `endpoint`. Because the endpoint differs between global and CN regions, two separate configurations with the same query and count will collide on the same cache entry — a global-region result would be returned for a CN-region request (and vice versa).

Kimi's implementation shows the pattern: it includes `baseUrl` in the cache key to prevent exactly this kind of cross-region collision. The fix is to add `endpoint` as a component:

```
buildSearchCacheKey(["minimax", endpoint, query, resolvedCount])
```

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds MiniMax as a bundled/native web search provider (MiniMax Coding Plan search API), wiring it into the bundled web search registry and provider-id compatibility mapping so it can be discovered and used like existing providers (Brave/Kimi/etc.).

Changes:

  • Introduces a new minimax web search provider implementation with caching, credential resolution, and trusted endpoint wrapping.
  • Registers the MiniMax web search provider in the MiniMax extension entrypoint.
  • Adds MiniMax to the bundled web search registry and provider-id compatibility map.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/plugins/bundled-web-search-provider-ids.ts Adds minimaxminimax compat provider-id mapping.
src/bundled-web-search-registry.ts Adds the MiniMax extension to the bundled web search plugin registrations list.
extensions/minimax/src/minimax-web-search-provider.ts Implements the MiniMax Coding Plan web search provider/tool (endpoint selection, request/response mapping, caching).
extensions/minimax/index.ts Registers the new MiniMax web search provider with the plugin API.

Comment thread src/bundled-web-search-registry.ts Outdated
Comment on lines +52 to +57
{
get plugin() {
return minimaxPlugin;
},
credentialValue: "sk-test",
},
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

bundledWebSearchPluginRegistrations now includes the minimax plugin, but src/plugins/bundled-web-search-ids.ts (and the metadata tests that assert alignment) still omit minimax. This will break the “fast-path ids aligned with the registry” invariant and can cause resolveBundledWebSearchPluginIds to keep excluding the new bundled provider. Add minimax to BUNDLED_WEB_SEARCH_PLUGIN_IDS and update the expected bundled id lists accordingly.

Copilot uses AI. Check for mistakes.
const resolvedCount = resolveSearchCount(count, DEFAULT_SEARCH_COUNT);
const endpoint = resolveMiniMaxEndpoint(searchConfig);

const cacheKey = buildSearchCacheKey(["minimax", query, resolvedCount]);
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The search cache key doesn’t include the resolved endpoint/region. If a user switches between Global and CN endpoints (or if different configs run in the same process), cached results can be served for the wrong region. Include endpoint (or the region string) as part of buildSearchCacheKey inputs.

Suggested change
const cacheKey = buildSearchCacheKey(["minimax", query, resolvedCount]);
const cacheKey = buildSearchCacheKey(["minimax", endpoint, query, resolvedCount]);

Copilot uses AI. Check for mistakes.
function missingMiniMaxKeyPayload() {
return {
error: "missing_minimax_api_key",
message: `web_search (minimax) needs a MiniMax API key. Run \`${formatCliCommand("openclaw configure --section web")}\` to store it, or set MINIMAX_API_KEY in the Gateway environment.`,
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The missing-credential message only mentions MINIMAX_API_KEY, but this provider also supports MINIMAX_CODE_PLAN_KEY (and advertises both in envVars). Update the guidance so users can resolve auth using either env var (and/or point at the configured secret path, consistent with other providers).

Suggested change
message: `web_search (minimax) needs a MiniMax API key. Run \`${formatCliCommand("openclaw configure --section web")}\` to store it, or set MINIMAX_API_KEY in the Gateway environment.`,
message: `web_search (minimax) needs a MiniMax API key. Run \`${formatCliCommand(
"openclaw configure --section web",
)}\` to store it, or set MINIMAX_API_KEY or MINIMAX_CODE_PLAN_KEY in the Gateway environment.`,

Copilot uses AI. Check for mistakes.
: undefined;
return region === "cn" ? MINIMAX_SEARCH_ENDPOINT_CN : MINIMAX_SEARCH_ENDPOINT_GLOBAL;
}

Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

This new provider introduces non-trivial logic (endpoint selection, response mapping, related-search extraction, caching). Other bundled web search providers typically include a small *.test.ts plus an exported __testing surface for deterministic unit tests. Add at least a couple of unit tests for endpoint resolution (Global vs CN) and for mapping/extracting results from a representative API response shape.

Suggested change
export const __testing = {
MINIMAX_SEARCH_ENDPOINT_GLOBAL,
MINIMAX_SEARCH_ENDPOINT_CN,
resolveMiniMaxEndpoint,
runMiniMaxSearch,
};

Copilot uses AI. Check for mistakes.
Comment on lines 7 to 9
kimi: "moonshot",
minimax: "minimax",
perplexity: "perplexity",
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The bundled provider-id map now includes minimax, but the alignment test in src/plugins/bundled-web-search.test.ts doesn’t assert the minimax mapping. Add a corresponding expectation there so future edits don’t accidentally break this new compat id.

Copilot uses AI. Check for mistakes.
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: 68d9f3702c

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

Comment on lines +232 to +233
setConfiguredCredentialValue: (configTarget, value) => {
setProviderWebSearchPluginConfigValue(configTarget, "minimax", "apiKey", value);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Store MiniMax web key in a schema-valid config path

This writes the credential into plugins.entries.minimax.config.webSearch.apiKey, but the MiniMax plugin manifest currently defines configSchema as an empty object with additionalProperties: false (extensions/minimax/openclaw.plugin.json), so config.webSearch is invalid for that plugin. In practice, configuring MiniMax search via onboarding/configure will produce a plugin-schema validation error instead of persisting the key (unless users only rely on environment variables).

Useful? React with 👍 / 👎.

const resolvedCount = resolveSearchCount(count, DEFAULT_SEARCH_COUNT);
const endpoint = resolveMiniMaxEndpoint(searchConfig);

const cacheKey = buildSearchCacheKey(["minimax", query, resolvedCount]);
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 Include endpoint/region in MiniMax search cache key

The cache key omits endpoint/region even though requests are routed to either global or CN endpoint based on searchConfig.minimax.region. If region changes (or different sessions in one process use different regions), cached results from one endpoint can be served for the other until TTL expiry, returning stale/wrong-region data. The key should include endpoint (or normalized region) to avoid cross-region cache collisions.

Useful? React with 👍 / 👎.

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: 674d4a8b86

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

Comment on lines +60 to +64
typeof searchConfig?.minimax === "object" &&
searchConfig.minimax !== null &&
!Array.isArray(searchConfig.minimax)
? (searchConfig.minimax as Record<string, unknown>).region
: undefined;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Derive MiniMax search endpoint from configured CN base URL

resolveMiniMaxEndpoint only reads tools.web.search.minimax.region, so MiniMax web search defaults to the global host unless that legacy field is manually set. In the normal CN onboarding path (applyMinimaxApiConfigCn in extensions/minimax/onboard.ts), only models.providers.minimax.baseUrl is set, and the new plugin schema here only persists webSearch.apiKey, not region; as a result, users who chose the CN provider can still have web_search sent to api.minimax.io and fail in CN-only/auth-scoped environments.

Useful? React with 👍 / 👎.

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: 2aac848fef

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

Comment thread extensions/minimax/openclaw.plugin.json Outdated
Comment on lines +66 to +67
"apiKey": {
"type": "string"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Accept SecretRef objects for MiniMax web search key

The new MiniMax plugin schema only allows webSearch.apiKey to be a string, but OpenClaw’s secret-ref flow stores credentials as objects (for example when secret-input-mode=ref is used). That means valid MiniMax web-search credential configs are rejected as invalid config at load/validation time, so users cannot persist MiniMax search credentials in SecretRef mode even though every other bundled web-search provider accepts "string" | "object" for this field.

Useful? React with 👍 / 👎.

Comment on lines +76 to +77
const minimaxProvider = providers?.minimax as Record<string, unknown> | undefined;
const baseUrl = typeof minimaxProvider?.baseUrl === "string" ? minimaxProvider.baseUrl : "";
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 Infer MiniMax region from OAuth provider base URL too

Region inference only reads models.providers.minimax.baseUrl, so it misses CN OAuth setups where the configured base URL lives under models.providers.minimax-portal. In that common CN OAuth path, resolveMiniMaxRegion falls back to global, causing web search calls to target api.minimax.io instead of the CN endpoint unless users manually set tools.web.search.minimax.region.

Useful? React with 👍 / 👎.

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: 78a1c02904

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

label: "MiniMax Search",
hint: "Structured results via MiniMax Coding Plan search API",
credentialLabel: "MiniMax API key",
envVars: ["MINIMAX_API_KEY", "MINIMAX_CODE_PLAN_KEY"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prefer MINIMAX_CODE_PLAN_KEY before MINIMAX_API_KEY

Credential fallback checks envVars in declaration order, so this provider currently picks MINIMAX_API_KEY first when both variables are set. For MiniMax coding-plan endpoints, that can make web_search fail with auth errors even though a valid MINIMAX_CODE_PLAN_KEY is present; elsewhere in the repo MiniMax auth already prefers code-plan first (src/infra/provider-usage.auth.ts). Reordering to prioritize MINIMAX_CODE_PLAN_KEY (and keeping resolution order consistent) avoids selecting the wrong credential in mixed-key environments.

Useful? React with 👍 / 👎.

@JithendraNara
Copy link
Copy Markdown
Author

Hey maintainers! 👋

Just wanted to add some context — I'm a MiniMax user running OpenClaw with MiniMax M2.7 as my primary model. I've been using the minimax-coding-plan-mcp MCP server for web search, but noticed that MiniMax is the only first-class model provider in OpenClaw that doesn't have a native web search integration. Brave, Gemini, Grok, Kimi, Perplexity — they all have bundled providers, but MiniMax users have to go through MCP.

Since MiniMax already has a simple search API (POST /v1/coding_plan/search) and the extension already exists with OAuth, API key auth, and media understanding, adding web search felt like the natural next step.

I know the contributing guide recommends starting with a discussion for new features — apologies for skipping that. Happy to address any further feedback!

Related: #47927, #11399

@JithendraNara JithendraNara force-pushed the feat/minimax-web-search-provider branch from c4242b8 to e273a00 Compare March 25, 2026 22:43
@JithendraNara JithendraNara changed the title feat: add MiniMax as bundled web search provider feat(tools): add MiniMax as bundled web search provider Mar 25, 2026
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: e273a003c0

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

Comment on lines +148 to +151
const relatedSearches = Array.isArray(data.related_searches)
? data.related_searches
.map((r) => r.query)
.filter((q): q is string => typeof q === "string" && q.length > 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wrap related search suggestions before returning

The provider marks the payload as externalContent.wrapped: true, but related_searches strings are copied through without wrapWebContent. If MiniMax returns attacker-controlled suggestion text, that unwrapped content is passed directly to the model despite the wrapped flag, weakening the prompt-injection guardrail used for other web-search text fields. Wrap each related-search string (or omit the field) before adding it to the tool result.

Useful? React with 👍 / 👎.

@JithendraNara JithendraNara force-pushed the feat/minimax-web-search-provider branch from e273a00 to 7993795 Compare March 25, 2026 22:54
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: 79937951a0

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

Comment on lines +65 to +68
"properties": {
"apiKey": {
"type": ["string", "object"]
}
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 Persist MiniMax region override in schema-backed config

resolveMiniMaxRegion now checks tools.web.search.minimax.region, but this plugin schema only allows plugins.entries.minimax.config.webSearch.apiKey and does not provide any persisted region field. In validated configs, object-valued tools.web.search.<provider> entries are normalized away unless they are in the legacy provider map, so minimax.region cannot reliably survive load/validation. That makes the explicit CN/global override path effectively unusable when endpoint inference from base URL is wrong or unavailable.

Useful? React with 👍 / 👎.

@JithendraNara JithendraNara force-pushed the feat/minimax-web-search-provider branch from 7993795 to dfb923f Compare March 25, 2026 23:06
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: dfb923fbda

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

Comment thread src/bundled-web-search-registry.ts Outdated
Comment on lines +52 to +56
{
get plugin() {
return minimaxPlugin;
},
credentialValue: "sk-test",
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 Add MiniMax web-search secret target to registry

Registering MiniMax as a bundled web-search provider here adds a new credential path (plugins.entries.minimax.config.webSearch.apiKey), but that path is not added to src/secrets/target-registry-data.ts; as a result, secret-registry consumers in src/secrets/target-registry-query.ts (for discovery/known-target checks used by openclaw secret plan/configure/audit flows) will not recognize or process MiniMax web-search SecretRefs. This leaves the new provider’s configured key unmanaged by the standard secret tooling.

Useful? React with 👍 / 👎.

@JithendraNara JithendraNara force-pushed the feat/minimax-web-search-provider branch from dfb923f to 4c92e15 Compare March 25, 2026 23:23
@JithendraNara JithendraNara requested a review from a team as a code owner March 25, 2026 23:23
@openclaw-barnacle openclaw-barnacle Bot added the docs Improvements or additions to documentation label Mar 25, 2026
@steipete
Copy link
Copy Markdown
Contributor

steipete commented Apr 4, 2026

Maintainer review: keep open, but I would not land this yet. A few blockers against current main:

  1. Region detection misses the env-driven CN path.

    • resolveMiniMaxRegion() only checks explicit searchConfig.minimax.region plus persisted models.providers.{minimax,minimax-portal}.baseUrl.
    • It does not check MINIMAX_API_HOST.
    • That matters now because current main already supports env-only CN routing for implicit MiniMax providers via MINIMAX_API_HOST; in that setup there may be no persisted MiniMax baseUrl in config, so this web-search provider would still hit the global search endpoint.
    • I would treat that as a correctness bug before merge.
  2. Auto-detect / credential fallback looks too broad for a Coding Plan-only API.

    • This provider advertises envVars: ["MINIMAX_CODE_PLAN_KEY", "MINIMAX_API_KEY"] and resolveMiniMaxApiKey() falls back to MINIMAX_API_KEY.
    • But MiniMax's Coding Plan MCP docs describe web_search as a Coding Plan tool and call for a Coding Plan API key: https://platform.minimaxi.com/docs/guides/coding-plan-mcp-guide
    • If plain MINIMAX_API_KEY is not valid for /v1/coding_plan/search, then installs with only a normal MiniMax API key will auto-select this provider and fail every search request.
    • Please either narrow auto-detect/credential fallback to the Coding Plan key, or add concrete evidence that a standard MiniMax API key is supported on this endpoint.
  3. Cache key should include the resolved endpoint / region.

    • Right now the cache key is built from provider + query + count, but not the resolved endpoint.
    • Global and CN requests for the same query would collide.

Non-blocking note:

  • The public Coding Plan MCP docs I found only document query for web_search, so I would not treat the lack of a forwarded count parameter as a blocker unless you have upstream API docs showing a server-side count field.

If you want to refresh this toward landing, I’d suggest:

  • add MINIMAX_API_HOST awareness to region resolution
  • tighten the credential / auto-detect contract around Coding Plan auth
  • include endpoint in the cache key
  • add tests for the env-host CN path and the cache-key separation

Add native MiniMax Search integration via their Coding Plan search API
(POST /v1/coding_plan/search). This brings MiniMax in line with Brave,
Kimi, Grok, Gemini, and other providers that already have bundled web
search support.

- Implement WebSearchProviderPlugin with caching, credential resolution,
  and trusted endpoint wrapping
- Support both global (api.minimax.io) and CN (api.minimaxi.com)
  endpoints, inferred from explicit region config, model provider base
  URL, or minimax-portal OAuth base URL
- Prefer MINIMAX_CODE_PLAN_KEY over MINIMAX_API_KEY in credential
  fallback, matching existing repo precedence
- Accept SecretRef objects for webSearch.apiKey (type: [string, object])
- Register in bundled registry, provider-id compat map, and fast-path
  plugin id list with full alignment test coverage
- Add unit tests for endpoint/region resolution and edge cases

Closes openclaw#47927
Related openclaw#11399

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steipete steipete force-pushed the feat/minimax-web-search-provider branch from 4c92e15 to cbdf56a Compare April 4, 2026 10:55
@steipete steipete merged commit d204be8 into openclaw:main Apr 4, 2026
9 checks passed
@steipete
Copy link
Copy Markdown
Contributor

steipete commented Apr 4, 2026

Landed via temp rebase onto main.

  • Gate: OPENCLAW_VITEST_MAX_WORKERS=1 pnpm test extensions/minimax/index.test.ts extensions/minimax/src/minimax-web-search-provider.test.ts src/plugins/bundled-web-search.test.ts src/plugins/contracts/bundled-web-search.minimax.contract.test.ts src/config/config.web-search-provider.test.ts src/secrets/provider-env-vars.test.ts src/secrets/runtime.coverage.test.ts; pnpm build; live MiniMax search probe with .profile MINIMAX_CODING_API_KEY (auto-detect + real search request both passed)
  • Note: pnpm check still fails on unrelated current-main issues in extensions/msteams/src/monitor-handler/message-handler.ts and src/gateway/server-methods/devices.ts; full pnpm test also surfaced multiple unrelated current-main failures outside the MiniMax/web-search surface
  • Land commit: cbdf56aaff08677c19be1ec773d530b274055625
  • Merge commit: d204be80af6000f606aef133852359e59c4d7fe5

Thanks @JithendraNara!

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

ℹ️ 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 on lines +57 to +58
readConfiguredSecretString(searchConfig?.apiKey, "tools.web.search.apiKey") ??
readProviderEnvValue([...MINIMAX_CODING_PLAN_ENV_VARS, "MINIMAX_API_KEY"])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prefer scoped MiniMax key over legacy top-level apiKey

resolveMiniMaxApiKey reads searchConfig.apiKey first, which is the shared legacy tools.web.search.apiKey slot, before checking MiniMax env vars. If a user previously configured another provider that populated this legacy field (for example Brave) and later switches to MiniMax while relying on MINIMAX_CODE_PLAN_KEY/MINIMAX_CODING_API_KEY, the stale shared key wins and MiniMax requests are sent with the wrong credential, causing auth failures until the old top-level key is manually removed.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: minimax size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Support MiniMax MCP (web_search & understand_image)

3 participants