fix(memory): discard stdout for qmd update/embed to prevent output cap failure (openclaw#28900) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test:macmini

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Glucksberg
2026-03-01 14:16:50 -04:00
committed by GitHub
parent 11d34700c0
commit 134296276a
3 changed files with 41 additions and 5 deletions

View File

@@ -1761,6 +1761,25 @@ describe("QmdMemoryManager", () => {
}
});
it("succeeds on qmd update even when stdout exceeds the output cap", async () => {
// Regression test for #24966: large indexes produce >200K chars of stdout
// during `qmd update`, which used to fail with "produced too much output".
const largeOutput = "x".repeat(300_000);
spawnMock.mockImplementation((_cmd: string, args: string[]) => {
if (args[0] === "update") {
const child = createMockChild({ autoClose: false });
emitAndClose(child, "stdout", largeOutput);
return child;
}
return createMockChild();
});
const { manager } = await createManager({ mode: "status" });
// sync triggers runQmdUpdateOnce -> runQmd(["update"], { discardOutput: true })
await expect(manager.sync({ reason: "manual" })).resolves.toBeUndefined();
await manager.close();
});
it("scopes by channel for agent-prefixed session keys", async () => {
cfg = {
...cfg,