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:
@@ -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 () => {
|
it("#given metadata-linked tool has stale metadata #when tool.execute.after runs #then it warns and still completes hooks", async () => {
|
||||||
// given
|
// given
|
||||||
const logDir = mkdtempSync(join(tmpdir(), "omo-tool-after-"))
|
const logDir = mkdtempSync(join(tmpdir(), "omo-tool-after-"))
|
||||||
|
|||||||
@@ -8,10 +8,7 @@ const VERIFICATION_ATTEMPT_PATTERN = /<ulw_verification_attempt_id>(.*?)<\/ulw_v
|
|||||||
|
|
||||||
const METADATA_LINKED_TOOLS = new Set([
|
const METADATA_LINKED_TOOLS = new Set([
|
||||||
"background_output",
|
"background_output",
|
||||||
"background_task",
|
|
||||||
"call_omo_agent",
|
|
||||||
"edit",
|
"edit",
|
||||||
"hashline_edit",
|
|
||||||
"task",
|
"task",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user