mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-22 22:52:03 +00:00
test(gateway): strip MiniMax live scaffolding
This commit is contained in:
@@ -285,10 +285,17 @@ function shouldStripAssistantScaffoldingForLiveModel(modelKey?: string): boolean
|
||||
return true;
|
||||
}
|
||||
const [provider, ...rest] = modelKey.split("/");
|
||||
const modelId = rest.join("/");
|
||||
if (provider === "minimax" || provider === "minimax-portal") {
|
||||
// MiniMax transcript persistence can mirror our <final> wrapper style even
|
||||
// though user-visible surfaces already strip it. Keep the live reader
|
||||
// aligned with the runtime-facing sanitizers for the whole provider family.
|
||||
return true;
|
||||
}
|
||||
if (provider !== "google" || rest.length === 0) {
|
||||
return false;
|
||||
}
|
||||
const normalizedKey = `${provider}/${normalizeGoogleModelId(rest.join("/"))}`;
|
||||
const normalizedKey = `${provider}/${normalizeGoogleModelId(modelId)}`;
|
||||
return GATEWAY_LIVE_STRIP_SCAFFOLDING_MODEL_KEYS.has(normalizedKey);
|
||||
}
|
||||
|
||||
@@ -332,6 +339,24 @@ describe("maybeStripAssistantScaffoldingForLiveModel", () => {
|
||||
),
|
||||
).toBe("<think>hidden</think>Visible");
|
||||
});
|
||||
|
||||
it("strips scaffolding for MiniMax transcript wrappers", () => {
|
||||
expect(
|
||||
maybeStripAssistantScaffoldingForLiveModel(
|
||||
"<final>Visible</final>",
|
||||
"minimax/MiniMax-M2.5-highspeed",
|
||||
),
|
||||
).toBe("Visible");
|
||||
expect(
|
||||
maybeStripAssistantScaffoldingForLiveModel(
|
||||
"<final>Visible</final>",
|
||||
"minimax-portal/MiniMax-M2.7-highspeed",
|
||||
),
|
||||
).toBe("Visible");
|
||||
expect(
|
||||
maybeStripAssistantScaffoldingForLiveModel("<final>Visible</final>", "minimax/MiniMax-M2.7"),
|
||||
).toBe("Visible");
|
||||
});
|
||||
});
|
||||
|
||||
function isGoogleModelNotFoundText(text: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user