You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reason: add target provider/model to existing provider registry
Summary
Add MiniMax provider aliases for global and CN OpenAI-compatible and Anthropic-compatible endpoints.
Register MiniMax-M3 and MiniMax-M2.7 with context windows, input modalities, protocol-specific thinking defaults, and complete standard, priority, and long-context pricing tiers.
Reuse the existing chat adapters with provider-specific request options and Anthropic base URL handling, and account for cache creation and service tiers.
Add focused coverage for provider registration, model metadata, endpoint formatting, and pricing tier boundaries.
➖ Increases coupling between OpenAI plugin and third-party vendor support
➖ Risk of vendor-specific configuration leaking into a generic plugin
➖ Harder to version/enable/disable vendors independently
Recommendation: The PR’s approach (a thin MiniMax plugin that reuses existing OpenAI-compatible providers) is a good tradeoff: minimal new code, clean separation, and consistent provider registration via a dedicated provider key. Consider the alias/multi-provider-key approaches only if many more OpenAI-compatible vendors are expected and plugin-per-vendor becomes operationally noisy.
ChatCompletionProvider.csAdd MiniMax chat provider wrapper over OpenAI-compatible chat+15/-0
Add MiniMax chat provider wrapper over OpenAI-compatible chat
• Implements a thin subclass of the OpenAI chat completion provider, overriding the Provider identifier to 'minimax' while delegating behavior to the base implementation.
BotSharp.slnAdd MiniMax plugin project to the solution+15/-0
Add MiniMax plugin project to the solution
• Registers the new BotSharp.Plugin.MiniMaxAI project in the solution and adds build configurations and solution-folder mapping so it participates in Debug/Release builds.
appsettings.jsonRegister MiniMax provider/model and enable plugin loading+25/-0
Register MiniMax provider/model and enable plugin loading
• Adds a 'minimax' provider entry with the MiniMax-M3 chat model, endpoint, and cost settings, and includes BotSharp.Plugin.MiniMaxAI in the plugin assembly list for runtime loading.
MiniMax providers require OpenAiSettings via DI, but MiniMaxAiPlugin.RegisterDI doesn’t
register/bind OpenAiSettings, so MiniMax fails to resolve if BotSharp.Plugin.OpenAI isn’t also
loaded as a plugin. Because PluginLoader only initializes plugins from explicitly listed
assemblies, a project reference to the OpenAI plugin does not guarantee OpenAiPlugin.RegisterDI
ran.
MiniMax registers only completion providers, but both providers require OpenAiSettings in their
constructors; OpenAiSettings is registered by OpenAiPlugin, and the plugin loader only
initializes DI registrations for assemblies listed in PluginLoader:Assemblies, so MiniMax has an
implicit dependency that can break at runtime if OpenAI plugin isn’t loaded as a plugin.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
MiniMax provider implementations inject `OpenAiSettings`, but the MiniMax plugin does not register/bind `OpenAiSettings` itself and does not declare a plugin dependency on `BotSharp.Plugin.OpenAI`. This makes the plugin fragile: if the host forgets to include/load the OpenAI plugin assembly as a plugin, MiniMax provider activation will fail at runtime.
## Issue Context
- `PluginLoader` only discovers and initializes `IBotSharpPlugin` types from `PluginLoader:Assemblies`.
- MiniMax inherits OpenAI providers and therefore depends on `OpenAiPlugin`’s DI registrations.
## Fix Focus Areas
- Add an explicit plugin dependency attribute on the MiniMax plugin class.
- Ensure `OpenAiSettings` is registered when missing (use `TryAdd` to avoid overriding the OpenAI plugin’s registration when it is present).
### Suggested changes
1) Add `[PluginDependency("BotSharp.Plugin.OpenAI")]` to `MiniMaxAiPlugin`.
2) In `MiniMaxAiPlugin.RegisterDI`, add a `services.TryAddScoped(...)` registration for `OpenAiSettings` that binds the `OpenAi` section (mirroring `OpenAiPlugin`), so MiniMax can still run when OpenAI plugin isn’t initialized.
## Fix Focus Areas (by file/lines)
- src/Plugins/BotSharp.Plugin.MiniMaxAI/MiniMaxAiPlugin.cs[6-17]
- src/Plugins/BotSharp.Plugin.MiniMaxAI/Providers/Chat/ChatCompletionProvider.cs[3-13]
- src/Plugins/BotSharp.Plugin.MiniMaxAI/Providers/Text/TextCompletionProvider.cs[3-10]
- src/Plugins/BotSharp.Plugin.OpenAI/OpenAiPlugin.cs[23-33]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
2. Global response API coupling✓ Resolved🐞 Bug⚙ Maintainability
Description
MiniMax inherits BotSharp.Plugin.OpenAI’s ChatCompletionProvider, so it is forced to follow the
global OpenAiSettings.UseResponseApi behavior with no per-provider override. With WebStarter
setting OpenAi:UseResponseApi to true, MiniMax is locked into the Responses codepath, making it
impossible to run OpenAI in Responses mode while keeping MiniMax on legacy chat-completions mode.
+public class ChatCompletionProvider : global::BotSharp.Plugin.OpenAI.Providers.Chat.ChatCompletionProvider+{+ public override string Provider => "minimax";+
Evidence
MiniMax’s chat provider subclasses the OpenAI chat provider, which branches on
OpenAiSettings.UseResponseApi; WebStarter sets that flag to true, so MiniMax inherits the
Responses-vs-chat-completions decision without a way to configure it per provider.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`OpenAiSettings.UseResponseApi` is a single global toggle, but MiniMax reuses the OpenAI chat provider and therefore inherits that toggle. This couples MiniMax’s protocol selection to the OpenAI provider’s setting and prevents independent configuration.
## Issue Context
- MiniMax chat provider only overrides `Provider`, so it inherits all OpenAI request-shaping logic.
- The OpenAI chat provider branches to the Responses API when `UseResponseApi` is true.
- WebStarter sets `OpenAi:UseResponseApi` to true.
## Fix Focus Areas
- Make the `UseResponseApi` check provider-aware (e.g., only enable Responses API when `Provider == "openai"`), or add a per-provider/per-model override (e.g., list of providers allowed to use Responses API).
### Suggested minimal fix
Update OpenAI ChatCompletionProvider to use Responses API only for the actual OpenAI provider:
- Change `if (_settings.UseResponseApi)` to `if (_settings.UseResponseApi && Provider == "openai")`
This keeps OpenAI on Responses API while allowing OpenAI-compatible third-party providers (like MiniMax) to stay on legacy chat-completions.
## Fix Focus Areas (by file/lines)
- src/Plugins/BotSharp.Plugin.OpenAI/Providers/Chat/ChatCompletionProvider.cs[34-70]
- src/WebStarter/appsettings.json[44-46]
- src/Plugins/BotSharp.Plugin.MiniMaxAI/Providers/Chat/ChatCompletionProvider.cs[3-6]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reason: add target provider/model to existing provider registry
Summary
Checks
dotnet build src/Plugins/BotSharp.Plugin.MiniMaxAI/BotSharp.Plugin.MiniMaxAI.csproj --configuration Release --nologodotnet test tests/BotSharp.LLM.Tests/BotSharp.LLM.Tests.csproj --configuration Release --filter FullyQualifiedName~MiniMaxProviderTests --nologo/v1/chat/completionsfor OpenAI-compatible base URLs and/anthropic/v1/messagesfor Anthropic-compatible base URLs.git diff --check