openclaw - ✅(Solved) Fix Bug: minimax web_search does not use OAuth token (MINIMAX_OAUTH_TOKEN) [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#65768Fetched 2026-04-14 05:40:24
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2referenced ×2

Root Cause

In dist/minimax-web-search-provider.js, the resolveMiniMaxApiKey() function reads the API key from only two sources:

  1. tools.web.search.apiKey (config)
  2. Environment variables: MINIMAX_CODE_PLAN_KEY, MINIMAX_CODING_API_KEY, MINIMAX_API_KEY

The MINIMAX_OAUTH_TOKEN is NOT in this lookup chain, even though OAuth is the recommended auth method for minimax-portal provider.

Fix Action

Fix / Workaround

Current Workaround

PR fix notes

PR #65779: fix(minimax): include OAuth env vars in web_search provider lookup

Description (problem / solution / changelog)

Summary

The MiniMax web_search provider's `envVars` only listed `MINIMAX_CODE_PLAN_KEY` and `MINIMAX_CODING_API_KEY`, missing `MINIMAX_OAUTH_TOKEN` and `MINIMAX_API_KEY`. Users who authenticated via MiniMax OAuth (the recommended `minimax-portal` flow) had working chat completions but broken web_search.

Fixes #65768

Root cause

```ts // web-search-contract-api.ts:7 (before fix) const MINIMAX_CODING_PLAN_ENV_VARS = ["MINIMAX_CODE_PLAN_KEY", "MINIMAX_CODING_API_KEY"];

// provider-registration.ts:255 (chat provider — has both) envVars: ["MINIMAX_OAUTH_TOKEN", "MINIMAX_API_KEY"], ```

The web search provider was only configured for Coding Plan keys, not OAuth tokens. The chat provider already handles both.

Fix

Add `MINIMAX_OAUTH_TOKEN` and `MINIMAX_API_KEY` to the web search provider's `envVars` array.

Scope

  • Files: `extensions/minimax/web-search-contract-api.ts` (+6/-1)
  • oxlint clean
  • Zero competing PRs

Credit to @kikibrian for identifying the env var gap in #65768.

Changed files

  • extensions/minimax/web-search-contract-api.ts (modified, +10/-1)

PR #65785: fix(minimax): allow web_search to use MINIMAX_OAUTH_TOKEN

Description (problem / solution / changelog)

Summary

The MiniMax web_search provider's resolveMiniMaxApiKey() only looked up API keys from config and environment variables (MINIMAX_CODE_PLAN_KEY, MINIMAX_CODING_API_KEY, MINIMAX_API_KEY), but did not include MINIMAX_OAUTH_TOKEN. Users who authorized via the minimax-portal OAuth flow could not use web_search without also setting a separate API key.

This change adds MINIMAX_OAUTH_TOKEN to the lookup chain and updates the missing-credential error message and provider envVars to match.

Change Type

  • Bug fix

Related Issue

Fixes #65768

Testing

  • pnpm test extensions/minimax/src/minimax-web-search-provider.test.ts — 18/18 passed
  • pnpm tsgo — passed
  • pnpm lint — 0 warnings, 0 errors

Changed files

  • extensions/minimax/src/minimax-web-search-provider.test.ts (modified, +8/-0)
  • extensions/minimax/src/minimax-web-search-provider.ts (modified, +7/-3)
RAW_BUFFERClick to expand / collapse

Bug Description

When using MiniMax OAuth authorization (minimax-portal provider), the web_search tool cannot use the OAuth token and requires a separate API key.

Root Cause

In dist/minimax-web-search-provider.js, the resolveMiniMaxApiKey() function reads the API key from only two sources:

  1. tools.web.search.apiKey (config)
  2. Environment variables: MINIMAX_CODE_PLAN_KEY, MINIMAX_CODING_API_KEY, MINIMAX_API_KEY

The MINIMAX_OAUTH_TOKEN is NOT in this lookup chain, even though OAuth is the recommended auth method for minimax-portal provider.

Expected Behavior

After completing MiniMax OAuth authorization, both chat completions and web_search should work without requiring a separate API key.

Current Workaround

Manually set MINIMAX_CODE_PLAN_KEY environment variable or configure tools.web.search.apiKey in config.

Environment

  • OpenClaw: 2026.4.11
  • macOS
  • minimax plugin with oauth authorization

extent analysis

TL;DR

Update the resolveMiniMaxApiKey() function to include MINIMAX_OAUTH_TOKEN in its lookup chain to fix the OAuth token issue with the MiniMax authorization.

Guidance

  • Review the dist/minimax-web-search-provider.js file to understand the current implementation of the resolveMiniMaxApiKey() function.
  • Modify the resolveMiniMaxApiKey() function to include MINIMAX_OAUTH_TOKEN as a possible source for the API key.
  • Verify that the updated function correctly retrieves the OAuth token after completing the MiniMax OAuth authorization.
  • Test the web_search tool to ensure it can use the OAuth token without requiring a separate API key.

Example

// Example update to resolveMiniMaxApiKey() function
function resolveMiniMaxApiKey() {
  // ... existing code ...
  const oauthToken = process.env.MINIMAX_OAUTH_TOKEN;
  if (oauthToken) {
    return oauthToken;
  }
  // ... existing code ...
}

Notes

This fix assumes that the MINIMAX_OAUTH_TOKEN environment variable is set correctly after completing the MiniMax OAuth authorization. If this is not the case, additional changes may be required to set the environment variable.

Recommendation

Apply workaround: Update the resolveMiniMaxApiKey() function to include MINIMAX_OAUTH_TOKEN in its lookup chain, as this directly addresses the identified issue and allows the web_search tool to use the OAuth token without requiring a separate API key.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING