fix(memory-core): quiet request-scoped fallback

This commit is contained in:
Peter Steinberger
2026-04-27 10:45:49 +01:00
parent dfe58a1b8e
commit c9e6f371e4
4 changed files with 8 additions and 3 deletions

View File

@@ -719,7 +719,8 @@ describe("generateAndAppendDreamNarrative", () => {
const content = await fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8");
expect(content).toContain("API endpoints need authentication");
expect(logger.warn).toHaveBeenCalledWith(expect.stringContaining("request-scoped"));
expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("request-scoped"));
expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining("request-scoped"));
expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining(workspaceDir));
expect(logger.warn).not.toHaveBeenCalledWith(
expect.stringContaining("narrative session cleanup failed"),
@@ -749,6 +750,8 @@ describe("generateAndAppendDreamNarrative", () => {
const content = await fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8");
expect(content).toContain("A durable candidate surfaced.");
expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("request-scoped"));
expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining("request-scoped"));
expect(subagent.deleteSession).not.toHaveBeenCalled();
});

View File

@@ -171,7 +171,7 @@ async function startNarrativeRunOrFallback(params: {
nowMs: params.nowMs,
timezone: params.timezone,
});
params.logger.warn(
params.logger.info(
`memory-core: narrative generation used fallback for ${params.data.phase} phase because subagent runtime is request-scoped.`,
);
} catch (fallbackErr) {

View File

@@ -319,6 +319,8 @@ describe("memory-core dreaming phases", () => {
const dreams = await fs.readFile(path.join(workspaceDir, "DREAMS.md"), "utf-8");
expect(dreams).toContain("Move backups to S3 Glacier.");
expect(logger.error).not.toHaveBeenCalled();
expect(logger.info).toHaveBeenCalledWith(expect.stringContaining("request-scoped"));
expect(logger.warn).not.toHaveBeenCalledWith(expect.stringContaining("request-scoped"));
expect(logger.warn).not.toHaveBeenCalledWith(
expect.stringContaining("narrative session cleanup failed"),
);