fix(tool-execute-after): narrow metadata warning tools

Remove non-store tool names from the metadata recovery warning gate so call_omo_agent and dead aliases fail open without warning spam. Keep warnings for tools backed by the recovery store: background_output, edit, and task.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-05-25 17:17:11 +09:00
parent 4a68db029d
commit f57532cbdb
2 changed files with 28 additions and 3 deletions
@@ -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-"))
-3
View File
@@ -8,10 +8,7 @@ const VERIFICATION_ATTEMPT_PATTERN = /<ulw_verification_attempt_id>(.*?)<\/ulw_v
const METADATA_LINKED_TOOLS = new Set([
"background_output",
"background_task",
"call_omo_agent",
"edit",
"hashline_edit",
"task",
])