mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-08 06:54:24 +00:00
fix: recognize Bedrock as Anthropic-compatible in transcript policy
This commit is contained in:
@@ -53,6 +53,19 @@ describe("resolveTranscriptPolicy", () => {
|
||||
expect(policy.validateAnthropicTurns).toBe(true);
|
||||
});
|
||||
|
||||
it("enables Anthropic-compatible policies for Bedrock provider", () => {
|
||||
const policy = resolveTranscriptPolicy({
|
||||
provider: "amazon-bedrock",
|
||||
modelId: "us.anthropic.claude-opus-4-6-v1",
|
||||
modelApi: "bedrock-converse-stream",
|
||||
});
|
||||
expect(policy.repairToolUseResultPairing).toBe(true);
|
||||
expect(policy.validateAnthropicTurns).toBe(true);
|
||||
expect(policy.allowSyntheticToolResults).toBe(true);
|
||||
expect(policy.sanitizeToolCallIds).toBe(true);
|
||||
expect(policy.sanitizeMode).toBe("full");
|
||||
});
|
||||
|
||||
it("keeps OpenRouter on its existing turn-validation path", () => {
|
||||
const policy = resolveTranscriptPolicy({
|
||||
provider: "openrouter",
|
||||
|
||||
@@ -55,12 +55,12 @@ function isOpenAiProvider(provider?: string | null): boolean {
|
||||
}
|
||||
|
||||
function isAnthropicApi(modelApi?: string | null, provider?: string | null): boolean {
|
||||
if (modelApi === "anthropic-messages") {
|
||||
if (modelApi === "anthropic-messages" || modelApi === "bedrock-converse-stream") {
|
||||
return true;
|
||||
}
|
||||
const normalized = normalizeProviderId(provider ?? "");
|
||||
// MiniMax now uses openai-completions API, not anthropic-messages
|
||||
return normalized === "anthropic";
|
||||
return normalized === "anthropic" || normalized === "amazon-bedrock";
|
||||
}
|
||||
|
||||
function isMistralModel(params: { provider?: string | null; modelId?: string | null }): boolean {
|
||||
|
||||
Reference in New Issue
Block a user