mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 11:10:45 +00:00
test: pin provider thinking replay boundaries
This commit is contained in:
@@ -16,6 +16,7 @@ vi.mock("../plugins/provider-runtime.js", async () => {
|
||||
"amazon-bedrock",
|
||||
"anthropic",
|
||||
"google",
|
||||
"github-copilot",
|
||||
"kilocode",
|
||||
"kimi",
|
||||
"kimi-code",
|
||||
@@ -109,6 +110,12 @@ vi.mock("../plugins/provider-runtime.js", async () => {
|
||||
validateAnthropicTurns: false,
|
||||
allowSyntheticToolResults: true,
|
||||
};
|
||||
case "github-copilot":
|
||||
return modelId.includes("claude")
|
||||
? {
|
||||
dropThinkingBlocks: true,
|
||||
}
|
||||
: {};
|
||||
case "mistral":
|
||||
return {
|
||||
sanitizeToolCallIds: true,
|
||||
@@ -443,6 +450,34 @@ describe("resolveTranscriptPolicy", () => {
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("does not allow immutable provider-owned thinking replay for github-copilot claude models", () => {
|
||||
const policy = resolveTranscriptPolicy({
|
||||
provider: "github-copilot",
|
||||
modelId: "claude-sonnet-4",
|
||||
modelApi: "anthropic-messages",
|
||||
});
|
||||
expect(
|
||||
shouldAllowProviderOwnedThinkingReplay({
|
||||
modelApi: "anthropic-messages",
|
||||
policy,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("does not allow immutable provider-owned thinking replay for openrouter models on openai replay", () => {
|
||||
const policy = resolveTranscriptPolicy({
|
||||
provider: "openrouter",
|
||||
modelId: "anthropic/claude-sonnet-4-6",
|
||||
modelApi: "openai-completions",
|
||||
});
|
||||
expect(
|
||||
shouldAllowProviderOwnedThinkingReplay({
|
||||
modelApi: "openai-completions",
|
||||
policy,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("does not allow immutable provider-owned thinking replay for strict openai-compatible replay", () => {
|
||||
const policy = resolveTranscriptPolicy({
|
||||
provider: "vllm",
|
||||
|
||||
Reference in New Issue
Block a user