diff --git a/src/plugin/tool-execute-after-metadata-recovery.test.ts b/src/plugin/tool-execute-after-metadata-recovery.test.ts index 8e9fdb618..b86015d91 100644 --- a/src/plugin/tool-execute-after-metadata-recovery.test.ts +++ b/src/plugin/tool-execute-after-metadata-recovery.test.ts @@ -47,6 +47,34 @@ describe("createToolExecuteAfterHandler metadata recovery", () => { } }) + it("#given call_omo_agent has no recoverable store entry #when tool.execute.after runs #then it fails open without warning spam", async () => { + // given + const logDir = mkdtempSync(join(tmpdir(), "omo-tool-after-")) + const logPath = join(logDir, "omo.log") + _setLoggerForTesting({ filePath: logPath }) + const handler = createToolExecuteAfterHandler({ + ctx: { directory: "/repo" } as never, + hooks: {} as never, + }) + const output = { title: "result", output: "agent output", metadata: {} } + + try { + // when + await handler( + { tool: "call_omo_agent", sessionID: "ses_parent", callID: "call_agent" }, + output, + ) + _flushForTesting() + + // then + expect(output).toEqual({ title: "result", output: "agent output", metadata: {} }) + expect(readLogIfPresent(logPath)).not.toContain("Unable to recover stored metadata") + } finally { + _resetLoggerForTesting() + rmSync(logDir, { force: true, recursive: true }) + } + }) + it("#given metadata-linked tool has stale metadata #when tool.execute.after runs #then it warns and still completes hooks", async () => { // given const logDir = mkdtempSync(join(tmpdir(), "omo-tool-after-")) diff --git a/src/plugin/tool-execute-after.ts b/src/plugin/tool-execute-after.ts index 2b033d1f8..75bd1c0ee 100644 --- a/src/plugin/tool-execute-after.ts +++ b/src/plugin/tool-execute-after.ts @@ -8,10 +8,7 @@ const VERIFICATION_ATTEMPT_PATTERN = /(.*?)<\/ulw_v const METADATA_LINKED_TOOLS = new Set([ "background_output", - "background_task", - "call_omo_agent", "edit", - "hashline_edit", "task", ])