mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 08:22:47 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user