mirror of https://github.com/openclaw/openclaw.git
test: tighten assistant scaffolding coverage
This commit is contained in:
parent
3a59d40109
commit
2f82ade66f
|
|
@ -42,8 +42,40 @@ describe("stripAssistantInternalScaffolding", () => {
|
|||
expect(stripAssistantInternalScaffolding(input)).toBe(input);
|
||||
});
|
||||
|
||||
it("keeps relevant-memories tags inside inline code", () => {
|
||||
const input = "Use `<relevant-memories>example</relevant-memories>` literally.";
|
||||
expect(stripAssistantInternalScaffolding(input)).toBe(input);
|
||||
});
|
||||
|
||||
it("hides unfinished relevant-memories blocks", () => {
|
||||
const input = ["Hello", "<relevant-memories>", "internal-only"].join("\n");
|
||||
expect(stripAssistantInternalScaffolding(input)).toBe("Hello\n");
|
||||
});
|
||||
|
||||
it("trims leading whitespace after stripping scaffolding", () => {
|
||||
const input = [
|
||||
"<thinking>",
|
||||
"secret",
|
||||
"</thinking>",
|
||||
" ",
|
||||
"<relevant-memories>",
|
||||
"internal note",
|
||||
"</relevant-memories>",
|
||||
" Visible",
|
||||
].join("\n");
|
||||
expect(stripAssistantInternalScaffolding(input)).toBe("Visible");
|
||||
});
|
||||
|
||||
it("preserves unfinished reasoning text while still stripping memory blocks", () => {
|
||||
const input = [
|
||||
"Before",
|
||||
"<thinking>",
|
||||
"secret",
|
||||
"<relevant-memories>",
|
||||
"internal note",
|
||||
"</relevant-memories>",
|
||||
"After",
|
||||
].join("\n");
|
||||
expect(stripAssistantInternalScaffolding(input)).toBe("Before\n\nsecret\n\nAfter");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue