fix(tmux-subagent): avoid transcript fetches during idle stability checks

This commit is contained in:
YeonGyu-Kim
2026-04-04 18:48:03 +09:00
parent 4c3f6c1a52
commit 51d2f8b3e9
11 changed files with 257 additions and 36 deletions
+38
View File
@@ -447,6 +447,44 @@ afterEach(() => {
})
describe("createEventHandler - event forwarding", () => {
it("forwards message activity events to tmux session manager", async () => {
//#given
const forwardedEvents: EventInput[] = []
const eventHandler = createEventHandler({
ctx: asEventHandlerContext({}),
pluginConfig: asPluginConfig({}),
firstMessageVariantGate: {
markSessionCreated: () => {},
clear: () => {},
},
managers: createEventHandlerManagers({
skillMcpManager: {
disconnectSession: async () => {},
},
tmuxSessionManager: {
onEvent: (event: EventInput["event"]) => {
forwardedEvents.push({ event })
},
onSessionCreated: async () => {},
onSessionDeleted: async () => {},
},
}),
hooks: createEventHandlerHooks({}),
})
//#when
await eventHandler(asEventHandlerInput({
event: {
type: "message.part.delta",
properties: { sessionID: "ses_tmux_activity", field: "text", delta: "x" },
},
}))
//#then
expect(forwardedEvents.length).toBe(1)
expect(forwardedEvents[0]?.event.type).toBe("message.part.delta")
})
it("forwards session.deleted to write-existing-file-guard hook", async () => {
//#given
const forwardedEvents: EventInput[] = []