Skip to content

feat(gateway): add MiniMax compatibility - #815

Merged
tomdps merged 3 commits into
mainfrom
codex/migrate-pr-658-to-main
Jul 28, 2026
Merged

feat(gateway): add MiniMax compatibility#815
tomdps merged 3 commits into
mainfrom
codex/migrate-pr-658-to-main

Conversation

@tomdps

@tomdps tomdps commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Main-trunk migration

Replaces #658 after the trunk cutover. The contributor commit now starts from the new main; original authorship is preserved. The only migration resolution retained both the current reasoning-effort tests and the contributor’s new gateway tests.

Original PR body

Reason: add target provider/model to existing provider registry

Summary

Adds MiniMax model compatibility to the bundled gateway configuration.

Related Issues

None.

Changes Made

  • Register MiniMax-M3 and MiniMax-M2.7 in the gateway model catalog.
  • Support selectable compatibility protocols and token limits in gateway requests.
  • Document global and China endpoint configurations and cover request and configuration behavior with tests.

Testing

  • npm ci
  • npm run check:agent-cli-provider:ci
  • npm run check
  • npm test

Checklist

  • Tests pass (npm test)
  • Documentation updated (if needed)
  • Follows commit guidelines

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Greptile Summary

Adds MiniMax support to the bundled gateway provider.

  • Adds selectable OpenAI- and Anthropic-compatible request protocols with configurable token limits.
  • Preserves Anthropic response content and groups parallel tool results into a single follow-up user message.
  • Registers MiniMax-M3 and MiniMax-M2.7, documents regional endpoints, and adds configuration and request coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the previously reported parallel tool-result serialization issue is fixed by grouping consecutive results into one Anthropic user message and is covered by the gateway runner test.

Important Files Changed

Filename Overview
src/agent-cli-provider/gateway-client.ts Dispatches requests by protocol, translates Anthropic messages and tools, preserves response blocks, and groups parallel tool results correctly.
src/agent-cli-provider/gateway-runner.ts Propagates protocol and token-limit settings while retaining Anthropic assistant content across tool turns.
src/agent-cli-provider/gateway-tools.ts Normalizes and validates gateway protocol and positive token-limit configuration.
src/agent-cli-provider/adapters/gateway.ts Registers MiniMax models and forwards the new gateway configuration fields.
tests/agent-cli-provider/gateway-runner.test.js Covers OpenAI token limits and Anthropic endpoint, content-preservation, and parallel-tool-result behavior.
docs/providers.md Documents protocol selection, token requirements, and MiniMax regional endpoint configurations.

Sequence Diagram

sequenceDiagram
    participant Runner as Gateway Runner
    participant Client as Gateway Client
    participant API as Compatible Endpoint
    Runner->>Client: Request with protocol and messages
    alt OpenAI protocol
        Client->>API: POST /chat/completions
    else Anthropic protocol
        Client->>API: POST /v1/messages
        API-->>Client: Assistant content with parallel tool_use blocks
        Client-->>Runner: Tool calls and original content
        Runner->>Runner: Execute requested tools
        Runner->>Client: Consecutive tool-result messages
        Client->>Client: Group results into one user message
        Client->>API: Follow-up Messages API request
    end
    API-->>Runner: Final response
Loading

Reviews (3): Last reviewed commit: "fix(gateway): preserve compatible reques..." | Re-trigger Greptile

Comment thread src/agent-cli-provider/gateway-client.ts Outdated
@tomdps
tomdps force-pushed the codex/migrate-pr-658-to-main branch from 504118a to 08d8311 Compare July 28, 2026 21:22
@tomdps
tomdps added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit 926fd04 Jul 28, 2026
10 checks passed
@tomdps
tomdps deleted the codex/migrate-pr-658-to-main branch July 28, 2026 22:03
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 6.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants