mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 15:52:52 +03:00
fix(claude): preserve signed thinking turns during obfuscation (#8629)
Validated in local merge-train T6 (ungrouped batch 1)
This commit is contained in:
@@ -145,6 +145,25 @@ test("obfuscate_words with empty list is a no-op", () => {
|
||||
assert.equal((body.system[0] as { text: string }).text, "opencode");
|
||||
});
|
||||
|
||||
test("obfuscate_words preserves a message turn with signed thinking", () => {
|
||||
const body = {
|
||||
messages: [
|
||||
{
|
||||
role: "assistant",
|
||||
content: [
|
||||
{ type: "thinking", thinking: "private", signature: "signed-by-anthropic" },
|
||||
{ type: "text", text: "opencode remains unchanged" },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
applyTransformPipeline(body, [{ kind: "obfuscate_words", words: ["opencode"] }]);
|
||||
assert.equal(
|
||||
(body.messages[0].content[1] as { text: string }).text,
|
||||
"opencode remains unchanged"
|
||||
);
|
||||
});
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────────
|
||||
// Pipeline ordering: drop paragraph then obfuscate what survives
|
||||
// ────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user