Skip to content

feat: add MiniMax as first-class LLM provider#958

Open
octo-patch wants to merge 1 commit intoChatGPTBox-dev:masterfrom
octo-patch:feature/add-minimax-provider
Open

feat: add MiniMax as first-class LLM provider#958
octo-patch wants to merge 1 commit intoChatGPTBox-dev:masterfrom
octo-patch:feature/add-minimax-provider

Conversation

@octo-patch
Copy link

@octo-patch octo-patch commented Mar 19, 2026

Summary

Add MiniMax AI as a built-in LLM provider, following the same OpenAI-compatible pattern used by DeepSeek and Moonshot.

Models added:

  • MiniMax-M2.7 — latest flagship model
  • MiniMax-M2.5 — high-performance model
  • MiniMax-M2.5-highspeed — fast model with 204K context window

Changes

  • src/services/apis/minimax-api.mjs — API handler reusing generateAnswersWithOpenAiApiCompat with MiniMax base URL
  • src/config/index.mjs — Model keys, model entries, ModelGroup registration, minimaxApiKey config, and isUsingMiniMaxApiModel predicate
  • src/background/index.mjs — Routing for MiniMax models in executeApi()
  • src/popup/sections/GeneralPart.jsx — MiniMax API key input in settings UI
  • README.md — Updated API support list to include MiniMax

Tests

  • 5 unit tests for the MiniMax API handler (request format, SSE aggregation, error handling, network errors, message.content fallback)
  • 2 config predicate tests (isUsingMiniMaxApiModel detection + exported keys)
  • 5 integration tests (model registration, ModelGroups, model values, no overlap with other groups)

All 327 tests pass (315 existing + 12 new).

Test plan

  • Verify MiniMax models appear in the API Mode dropdown
  • Enter a MiniMax API key and verify it persists
  • Send a message using MiniMax M2.7 and verify streaming response
  • Verify existing providers still work correctly

Open with Devin

Summary by CodeRabbit

  • New Features

    • Added MiniMax API support with three available models: M2.7, M2.5, and M2.5 Highspeed (with 204K context).
    • Added API credential configuration interface for MiniMax.
  • Documentation

    • Updated README to reflect MiniMax as a supported API provider.

Add MiniMax AI (https://www.minimax.io) as a built-in LLM provider with
three models: MiniMax-M2.7, MiniMax-M2.5, and MiniMax-M2.5-highspeed
(204K context). MiniMax offers an OpenAI-compatible API, so the
implementation reuses the existing OpenAI compat layer.

Changes:
- Add minimax-api.mjs API handler via OpenAI-compat wrapper
- Register model keys, model entries, and ModelGroup in config
- Add isUsingMiniMaxApiModel predicate and minimaxApiKey config
- Wire routing in background/index.mjs executeApi()
- Add MiniMax API key input in popup settings UI
- Update README to mention MiniMax
- Add 5 unit tests for API handler
- Add 2 config predicate tests
- Add 5 integration tests for model registration
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

This PR introduces MiniMax API support across the extension by adding three MiniMax model variants to the configuration registry, implementing API integration that delegates to an OpenAI-compatible endpoint, updating the background executor to dispatch MiniMax requests, extending the UI for API credential input, and providing comprehensive integration and unit tests to validate the new provider integration.

Changes

Cohort / File(s) Summary
Configuration & Model Registry
README.md, src/config/index.mjs
Added MiniMax to supported APIs list in documentation. Extended Models with three MiniMax variants (minimax_m27, minimax_m25, minimax_m25_highspeed), exported miniMaxApiModelKeys constant, added MiniMax (API) to ModelGroups, included minimaxApiKey in defaultConfig, and exported isUsingMiniMaxApiModel() predicate helper.
API Integration
src/services/apis/minimax-api.mjs
New module exporting generateAnswersWithMiniMaxApi() that sets MiniMax base URL and delegates to the existing OpenAI-compatible API handler.
Background Executor
src/background/index.mjs
Extended executeApi dispatcher with a new branch to detect MiniMax model selection and invoke the MiniMax API generator function.
UI Component
src/popup/sections/GeneralPart.jsx
Added conditional rendering of minimaxApiKey input field in the API Mode section when MiniMax model is selected.
Integration Tests
tests/integration/minimax-api.test.mjs
New test suite validating MiniMax model registry consistency, model group configuration, model identifier mapping, and non-overlap with other providers.
Unit Tests
tests/unit/config/config-predicates.test.mjs, tests/unit/services/apis/minimax-api.test.mjs
Added predicate tests for isUsingMiniMaxApiModel() and comprehensive API request/response tests covering SSE streaming, error handling, session mutation, and fallback content parsing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #943: Modifies src/config/index.mjs to add/export provider-specific model key arrays and predicate helpers, extending the same configuration infrastructure.
  • PR #929: Updates config predicate unit tests similarly with provider-specific predicate validation and integration checks.

Suggested labels

Review effort 3/5

Poem

🐰 A whisker's twitch, a hop of glee—
MiniMax joins the family tree,
Three model friends now stand in line,
API keys configured fine,
OpenAI's path they swiftly trace—
Another provider finds its place!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main objective of the changeset: adding MiniMax as a first-class LLM provider with comprehensive implementation across config, UI, API handler, routing, and tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces MiniMax AI as a new Large Language Model (LLM) provider, expanding the application's compatibility with various AI services. This integration allows users to leverage MiniMax's models, M2.7, M2.5, and M2.5-highspeed, through an OpenAI-compatible API, enhancing the range of available AI capabilities within the application.

Highlights

  • New LLM Provider: MiniMax AI has been integrated as a first-class Large Language Model (LLM) provider, expanding the range of available AI services.
  • Model Support: Three MiniMax models are now supported: MiniMax-M2.7, MiniMax-M2.5, and MiniMax-M2.5-highspeed (with a 204K context window).
  • API Integration: A dedicated API handler was created, reusing the OpenAI-compatible pattern, along with necessary configuration updates, background routing, and a new UI input for the MiniMax API key.
  • Documentation Update: The README.md file was updated to reflect the addition of MiniMax to the list of supported APIs.
  • Comprehensive Testing: New unit and integration tests were added to ensure the correct functionality of the MiniMax API handler, configuration predicates, model registration, and group uniqueness.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@qodo-code-review
Copy link
Contributor

Review Summary by Qodo

Add MiniMax as first-class LLM provider with three models

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add MiniMax AI as first-class LLM provider with three models
  - MiniMax-M2.7 (flagship), MiniMax-M2.5, MiniMax-M2.5-highspeed (204K context)
• Implement OpenAI-compatible API handler reusing existing abstraction layer
• Register MiniMax models in config with ModelGroup and predicate function
• Wire MiniMax routing in background service and add UI settings input
• Add 12 comprehensive tests (5 unit, 2 config, 5 integration)
Diagram
flowchart LR
  A["MiniMax API<br/>https://api.minimax.io/v1"] -->|"OpenAI-compat wrapper"| B["minimax-api.mjs<br/>Handler"]
  B --> C["Config Registration<br/>Models + ModelGroups"]
  C --> D["Background Router<br/>executeApi routing"]
  D --> E["UI Settings<br/>API key input"]
  F["12 Tests<br/>Unit + Integration"] -.->|"validates"| C
Loading

Grey Divider

File Changes

1. src/services/apis/minimax-api.mjs ✨ Enhancement +12/-0

MiniMax API handler via OpenAI compatibility

• New file implementing MiniMax API handler
• Reuses generateAnswersWithOpenAiApiCompat with MiniMax base URL
• Exports generateAnswersWithMiniMaxApi function for streaming responses

src/services/apis/minimax-api.mjs


2. src/config/index.mjs ⚙️ Configuration changes +23/-0

Register MiniMax models and configuration

• Add miniMaxApiModelKeys array with three model identifiers
• Register MiniMax in ModelGroups with description and model list
• Add three model entries in Models object with display names and descriptions
• Add minimaxApiKey to defaultConfig for API key storage
• Export isUsingMiniMaxApiModel predicate function for model detection

src/config/index.mjs


3. src/background/index.mjs ✨ Enhancement +5/-0

Wire MiniMax routing in background service

• Import isUsingMiniMaxApiModel predicate from config
• Import generateAnswersWithMiniMaxApi handler from minimax-api module
• Add conditional routing in executeApi() to handle MiniMax models
• Route MiniMax requests with API key from config

src/background/index.mjs


View more (5)
4. src/popup/sections/GeneralPart.jsx ✨ Enhancement +12/-0

Add MiniMax API key input to settings UI

• Import isUsingMiniMaxApiModel predicate function
• Add conditional password input field for MiniMax API key
• Update config on API key change with minimaxApiKey property
• Display placeholder text "MiniMax API Key" for user guidance

src/popup/sections/GeneralPart.jsx


5. tests/unit/services/apis/minimax-api.test.mjs 🧪 Tests +187/-0

Unit tests for MiniMax API handler

• Test correct MiniMax base URL and endpoint routing
• Verify SSE delta aggregation and message streaming
• Test error handling for non-ok HTTP responses
• Test message.content fallback for non-delta responses
• Test network error handling and propagation

tests/unit/services/apis/minimax-api.test.mjs


6. tests/unit/config/config-predicates.test.mjs 🧪 Tests +16/-4

Config predicate tests for MiniMax detection

• Import miniMaxApiModelKeys and isUsingMiniMaxApiModel exports
• Add test for isUsingMiniMaxApiModel detecting all three MiniMax models
• Add test verifying predicate rejects non-MiniMax models
• Add test validating all exported MiniMax keys are recognized

tests/unit/config/config-predicates.test.mjs


7. tests/integration/minimax-api.test.mjs 🧪 Tests +59/-0

Integration tests for MiniMax model registration

• Test all MiniMax model keys have corresponding Models entries
• Verify MiniMax ModelGroup is registered with correct metadata
• Validate model values match expected API model names
• Test predicate does not match other provider models
• Test MiniMax keys are unique and do not overlap with other groups

tests/integration/minimax-api.test.mjs


8. README.md 📝 Documentation +1/-1

Update README API support list

• Update API support list to include MiniMax and DeepSeek
• Maintain consistency with feature documentation

README.md


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Mar 19, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (2) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Action required

1. Missing MiniMax API Key locale 📘 Rule violation ⚙ Maintainability
Description
The settings UI introduces a new localized string key MiniMax API Key but no corresponding entry
exists in the English locale (and therefore cannot be propagated). This can cause missing/incorrect
UI text and violates the localization key propagation requirement.
Code

src/popup/sections/GeneralPart.jsx[R346-355]

+        {isUsingMiniMaxApiModel(config) && (
+          <input
+            type="password"
+            value={config.minimaxApiKey}
+            placeholder={t('MiniMax API Key')}
+            onChange={(e) => {
+              const apiKey = e.target.value
+              updateConfig({ minimaxApiKey: apiKey })
+            }}
+          />
Evidence
PR Compliance ID 9 requires new UI strings to be added to src/_locales/en/main.json first and
propagated. The PR adds placeholder={t('MiniMax API Key')} in the UI, but the English locale file
does not contain a MiniMax API Key entry.

AGENTS.md
src/popup/sections/GeneralPart.jsx[346-355]
src/_locales/en/main.json[84-90]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The UI adds a new i18n key `MiniMax API Key` but it is not present in the English locale file (and thus not propagated to other locales), violating localization requirements.

## Issue Context
`GeneralPart.jsx` uses `t(&#x27;MiniMax API Key&#x27;)` for the MiniMax API key input placeholder. Existing providers commonly reuse `t(&#x27;API Key&#x27;)`, which is already translated.

## Fix Focus Areas
- src/popup/sections/GeneralPart.jsx[346-355]
- src/_locales/en/main.json[84-90]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. API-like keys in tests 📘 Rule violation ⛨ Security
Description
The MiniMax API unit tests include committed API-key-like strings (e.g., sk-minimax-test,
sk-test, sk-bad). This violates the no-secrets policy and can trigger secret scanners or be
mistaken for real credentials.
Code

tests/unit/services/apis/minimax-api.test.mjs[R41-46]

+  await generateAnswersWithMiniMaxApi(port, 'Hello', session, 'sk-minimax-test')
+
+  assert.equal(capturedInput, 'https://api.minimax.io/v1/chat/completions')
+  assert.equal(capturedInit.method, 'POST')
+  assert.equal(capturedInit.headers.Authorization, 'Bearer sk-minimax-test')
+
Evidence
PR Compliance ID 4 forbids committing any API keys/tokens. The new test file contains multiple
hardcoded key-like strings that match common API key patterns and are used as Authorization bearer
tokens in requests.

AGENTS.md
tests/unit/services/apis/minimax-api.test.mjs[41-46]
tests/unit/services/apis/minimax-api.test.mjs[123-125]
tests/unit/services/apis/minimax-api.test.mjs[151-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Unit tests commit API-key-like strings (e.g., `sk-*`) directly in the repo, which violates the no-secrets policy and may be flagged by secret scanners.

## Issue Context
The tests only need a stable placeholder value to assert the `Authorization: Bearer ...` header, not a realistic key format.

## Fix Focus Areas
- tests/unit/services/apis/minimax-api.test.mjs[41-46]
- tests/unit/services/apis/minimax-api.test.mjs[79-80]
- tests/unit/services/apis/minimax-api.test.mjs[123-125]
- tests/unit/services/apis/minimax-api.test.mjs[151-152]
- tests/unit/services/apis/minimax-api.test.mjs[182-184]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds MiniMax as a new LLM provider, following the pattern of other OpenAI-compatible providers in the project. The changes are well-structured, including configuration, API handling, UI, and tests. I have a couple of suggestions to improve documentation clarity and user experience.

- 📓 Summarize any page with right-click menu. (<kbd>Alt</kbd>+<kbd>B</kbd>)
- 📖 Independent conversation page. (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>H</kbd>)
- 🔗 Multiple API support (Web API for Free and Plus users, GPT-3.5, GPT-4, Claude, New Bing, Moonshot, Self-Hosted, Azure etc.).
- 🔗 Multiple API support (Web API for Free and Plus users, GPT-3.5, GPT-4, Claude, New Bing, Moonshot, MiniMax, DeepSeek, Self-Hosted, Azure etc.).

Choose a reason for hiding this comment

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

medium

The list of supported APIs is getting long. To improve readability and make it easier for users to find a specific provider, consider sorting the list of API providers alphabetically.

Suggested change
- 🔗 Multiple API support (Web API for Free and Plus users, GPT-3.5, GPT-4, Claude, New Bing, Moonshot, MiniMax, DeepSeek, Self-Hosted, Azure etc.).
- 🔗 Multiple API support (Web API for Free and Plus users, Azure, Claude, DeepSeek, GPT-3.5, GPT-4, MiniMax, Moonshot, New Bing, Self-Hosted, etc.).

Comment on lines +346 to +356
{isUsingMiniMaxApiModel(config) && (
<input
type="password"
value={config.minimaxApiKey}
placeholder={t('MiniMax API Key')}
onChange={(e) => {
const apiKey = e.target.value
updateConfig({ minimaxApiKey: apiKey })
}}
/>
)}

Choose a reason for hiding this comment

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

medium

For a better user experience, consider adding a 'Get' button next to the API key input that links to the MiniMax API key page. This is consistent with how API keys for other providers like OpenAI and Moonshot are handled in the UI.

The URL for MiniMax API keys is: https://api.minimax.io/user-center/api-keys

        {isUsingMiniMaxApiModel(config) && (
          <span style="display: flex; gap: 5px;">
            <input
              style="width: 100%;"
              type="password"
              value={config.minimaxApiKey}
              placeholder={t('MiniMax API Key')}
              onChange={(e) => {
                const apiKey = e.target.value
                updateConfig({ minimaxApiKey: apiKey })
              }}
            />
            {config.minimaxApiKey.length === 0 ? (
              <a
                href="https://api.minimax.io/user-center/api-keys"
                target="_blank"
                rel="nofollow noopener noreferrer"
              >
                <button style="white-space: nowrap;" type="button">
                  {t('Get')}
                </button>
              </a>
            ) : null}
          </span>
        )}

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
tests/unit/services/apis/minimax-api.test.mjs (1)

17-21: Consider extracting shared storage defaults to reduce test duplication.

A small helper constant would make these tests easier to maintain.

♻️ Optional refactor sketch
+const defaultStorageConfig = {
+  maxConversationContextLength: 3,
+  maxResponseTokenLength: 128,
+  temperature: 0.5,
+}
+
 test('generateAnswersWithMiniMaxApi aggregates SSE deltas and posts messages', async (t) => {
   t.mock.method(console, 'debug', () => {})
-  setStorage({
-    maxConversationContextLength: 3,
-    maxResponseTokenLength: 128,
-    temperature: 0.5,
-  })
+  setStorage(defaultStorageConfig)

Also applies to: 59-63, 101-105, 132-136, 165-169

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/services/apis/minimax-api.test.mjs` around lines 17 - 21, Extract
the repeated storage settings into a single shared constant (e.g.,
DEFAULT_TEST_STORAGE) and import or reference it in these tests; replace the
inline setStorage({ maxConversationContextLength: 3, maxResponseTokenLength:
256, temperature: 0.7 }) calls with setStorage({ ...DEFAULT_TEST_STORAGE, /*
overrides if needed */ }) so setStorage in tests like minimax-api.test.mjs
reuses the shared defaults and individual tests can still override specific
fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@tests/unit/services/apis/minimax-api.test.mjs`:
- Around line 17-21: Extract the repeated storage settings into a single shared
constant (e.g., DEFAULT_TEST_STORAGE) and import or reference it in these tests;
replace the inline setStorage({ maxConversationContextLength: 3,
maxResponseTokenLength: 256, temperature: 0.7 }) calls with setStorage({
...DEFAULT_TEST_STORAGE, /* overrides if needed */ }) so setStorage in tests
like minimax-api.test.mjs reuses the shared defaults and individual tests can
still override specific fields.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 446ba33d-fd82-44f2-8881-518a4af0913d

📥 Commits

Reviewing files that changed from the base of the PR and between c236a4b and c2fa6ca.

📒 Files selected for processing (8)
  • README.md
  • src/background/index.mjs
  • src/config/index.mjs
  • src/popup/sections/GeneralPart.jsx
  • src/services/apis/minimax-api.mjs
  • tests/integration/minimax-api.test.mjs
  • tests/unit/config/config-predicates.test.mjs
  • tests/unit/services/apis/minimax-api.test.mjs

Comment on lines +346 to +355
{isUsingMiniMaxApiModel(config) && (
<input
type="password"
value={config.minimaxApiKey}
placeholder={t('MiniMax API Key')}
onChange={(e) => {
const apiKey = e.target.value
updateConfig({ minimaxApiKey: apiKey })
}}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Action required

1. Missing minimax api key locale 📘 Rule violation ⚙ Maintainability

The settings UI introduces a new localized string key MiniMax API Key but no corresponding entry
exists in the English locale (and therefore cannot be propagated). This can cause missing/incorrect
UI text and violates the localization key propagation requirement.
Agent Prompt
## Issue description
The UI adds a new i18n key `MiniMax API Key` but it is not present in the English locale file (and thus not propagated to other locales), violating localization requirements.

## Issue Context
`GeneralPart.jsx` uses `t('MiniMax API Key')` for the MiniMax API key input placeholder. Existing providers commonly reuse `t('API Key')`, which is already translated.

## Fix Focus Areas
- src/popup/sections/GeneralPart.jsx[346-355]
- src/_locales/en/main.json[84-90]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +41 to +46
await generateAnswersWithMiniMaxApi(port, 'Hello', session, 'sk-minimax-test')

assert.equal(capturedInput, 'https://api.minimax.io/v1/chat/completions')
assert.equal(capturedInit.method, 'POST')
assert.equal(capturedInit.headers.Authorization, 'Bearer sk-minimax-test')

Copy link
Contributor

Choose a reason for hiding this comment

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

Action required

2. Api-like keys in tests 📘 Rule violation ⛨ Security

The MiniMax API unit tests include committed API-key-like strings (e.g., sk-minimax-test,
sk-test, sk-bad). This violates the no-secrets policy and can trigger secret scanners or be
mistaken for real credentials.
Agent Prompt
## Issue description
Unit tests commit API-key-like strings (e.g., `sk-*`) directly in the repo, which violates the no-secrets policy and may be flagged by secret scanners.

## Issue Context
The tests only need a stable placeholder value to assert the `Authorization: Bearer ...` header, not a realistic key format.

## Fix Focus Areas
- tests/unit/services/apis/minimax-api.test.mjs[41-46]
- tests/unit/services/apis/minimax-api.test.mjs[79-80]
- tests/unit/services/apis/minimax-api.test.mjs[123-125]
- tests/unit/services/apis/minimax-api.test.mjs[151-152]
- tests/unit/services/apis/minimax-api.test.mjs[182-184]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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.

1 participant