mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-27 21:08:00 +00:00
This commit is contained in:
@@ -427,7 +427,7 @@ describe('AIPanel', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('connects MiniMax with anthropic auth style', async () => {
|
||||
it('connects MiniMax via its OpenAI-compatible /v1 endpoint with bearer auth', async () => {
|
||||
vi.mocked(loadAISettings).mockResolvedValue({ ...baseSettings, cloudProviders: [] });
|
||||
|
||||
renderWithProviders(<AIPanel />);
|
||||
@@ -445,13 +445,16 @@ describe('AIPanel', () => {
|
||||
await waitFor(() => expect(vi.mocked(saveAISettings)).toHaveBeenCalled());
|
||||
|
||||
const [, nextSettings] = vi.mocked(saveAISettings).mock.calls[0];
|
||||
// MiniMax speaks OpenAI on `/v1` (chat/completions + models). The old
|
||||
// `/anthropic` base + anthropic auth pointed at its Messages API, which
|
||||
// OpenHuman doesn't speak — both paths 404'd (Sentry TAURI-RUST-8X3).
|
||||
expect(nextSettings.cloudProviders).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
slug: 'minimax',
|
||||
label: 'MiniMax',
|
||||
endpoint: 'https://api.minimax.io/anthropic',
|
||||
auth_style: 'anthropic',
|
||||
endpoint: 'https://api.minimax.io/v1',
|
||||
auth_style: 'bearer',
|
||||
}),
|
||||
])
|
||||
);
|
||||
|
||||
@@ -15,7 +15,7 @@ describe('builtinCloudProviders', () => {
|
||||
it.each([
|
||||
['groq', 'https://api.groq.com/openai/v1', 'bearer'],
|
||||
['deepseek', 'https://api.deepseek.com/v1', 'bearer'],
|
||||
['minimax', 'https://api.minimax.io/anthropic', 'anthropic'],
|
||||
['minimax', 'https://api.minimax.io/v1', 'bearer'],
|
||||
['sumopod', 'https://ai.sumopod.com/v1', 'bearer'],
|
||||
] as const)('maps %s to its endpoint and auth style', (slug, endpoint, authStyle) => {
|
||||
expect(defaultEndpointForBuiltinCloudProvider(slug)).toBe(endpoint);
|
||||
|
||||
@@ -158,8 +158,12 @@ export const BUILTIN_CLOUD_PROVIDERS: BuiltinCloudProvider[] = [
|
||||
{
|
||||
slug: 'minimax',
|
||||
label: 'MiniMax',
|
||||
endpoint: 'https://api.minimax.io/anthropic',
|
||||
authStyle: 'anthropic',
|
||||
// OpenAI-compatible surface (`/v1/chat/completions`, `/v1/models`). The
|
||||
// prior `/anthropic` base + anthropic auth hit MiniMax's Messages API,
|
||||
// which OpenHuman doesn't speak — both chat and model-listing 404'd
|
||||
// (Sentry TAURI-RUST-8X3). Keep in sync with the Rust catalog.
|
||||
endpoint: 'https://api.minimax.io/v1',
|
||||
authStyle: 'bearer',
|
||||
tone: TONE.rose,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -132,8 +132,16 @@ pub const BUILTIN_CLOUD_PROVIDERS: &[BuiltinCloudProvider] = &[
|
||||
BuiltinCloudProvider {
|
||||
slug: "minimax",
|
||||
label: "MiniMax",
|
||||
endpoint: "https://api.minimax.io/anthropic",
|
||||
auth_style: AuthStyle::Anthropic,
|
||||
// MiniMax exposes a full OpenAI-compatible surface at `/v1`
|
||||
// (`/v1/chat/completions`, `/v1/models`). The previous `/anthropic`
|
||||
// base + Anthropic auth pointed at MiniMax's Messages-protocol API,
|
||||
// which OpenHuman does not speak — it only builds OpenAI-style
|
||||
// `/chat/completions` and `/models` — so both chat and model-listing
|
||||
// 404'd (`/anthropic/chat/completions`, `/anthropic/models`). The
|
||||
// 404 on model-listing was Sentry TAURI-RUST-8X3. Use the `/v1`
|
||||
// OpenAI surface with Bearer auth so both paths resolve.
|
||||
endpoint: "https://api.minimax.io/v1",
|
||||
auth_style: AuthStyle::Bearer,
|
||||
},
|
||||
BuiltinCloudProvider {
|
||||
slug: "stepfun",
|
||||
@@ -507,8 +515,8 @@ mod tests {
|
||||
(
|
||||
"minimax",
|
||||
"MiniMax",
|
||||
"https://api.minimax.io/anthropic",
|
||||
AuthStyle::Anthropic,
|
||||
"https://api.minimax.io/v1",
|
||||
AuthStyle::Bearer,
|
||||
),
|
||||
(
|
||||
"sumopod",
|
||||
|
||||
@@ -669,8 +669,10 @@ fn config_schema_helpers_cover_provider_voice_agent_and_channel_defaults() {
|
||||
migrate_legacy_fields(&mut minimax_legacy);
|
||||
assert_eq!(minimax_legacy.slug, "minimax");
|
||||
assert_eq!(minimax_legacy.label, "MiniMax");
|
||||
assert_eq!(minimax_legacy.endpoint, "https://api.minimax.io/anthropic");
|
||||
assert_eq!(minimax_legacy.auth_style, AuthStyle::Anthropic);
|
||||
// MiniMax uses its OpenAI-compatible /v1 surface + Bearer (TAURI-RUST-8X3);
|
||||
// the legacy `type=minimax` migration fills from the corrected catalog.
|
||||
assert_eq!(minimax_legacy.endpoint, "https://api.minimax.io/v1");
|
||||
assert_eq!(minimax_legacy.auth_style, AuthStyle::Bearer);
|
||||
assert_eq!(AuthStyle::OpenhumanJwt.as_str(), "openhuman_jwt");
|
||||
assert_eq!(AuthStyle::Anthropic.as_str(), "anthropic");
|
||||
assert_eq!(AuthStyle::None.as_str(), "none");
|
||||
|
||||
Reference in New Issue
Block a user