diff --git a/src/tools/call-omo-agent/sync-executor.test.ts b/src/tools/call-omo-agent/sync-executor.test.ts index 18f1147f2..aab485706 100644 --- a/src/tools/call-omo-agent/sync-executor.test.ts +++ b/src/tools/call-omo-agent/sync-executor.test.ts @@ -395,6 +395,26 @@ describe("executeSync", () => { expect(spawnReservation.commit).toHaveBeenCalledTimes(1) expect(spawnReservation.rollback).toHaveBeenCalledTimes(0) }) + + test("strips legacy ZWSP-prefixed agent names from persisted sync prompt body (GH-3259)", async () => { + //#given - persisted sync invocation from v3.14.0-v3.16.0 with ZWSP prefix on subagent_type + const executeSync = await importExecuteSync() + const deps = createDependencies() + const toolContext = createToolContext() + const recorder = createPromptAsyncRecorder() + const args = { + subagent_type: "\u200B\u200BHephaestus - Deep Agent", + description: "legacy zwsp", + prompt: "find something", + run_in_background: false, + } + + //#when + await executeSync(args, toolContext, createContext(recorder.promptAsync) as never, deps) + + //#then + expect(recorder.getCapturedInput()?.body.agent).toBe("Hephaestus - Deep Agent") + }) }) export {}