test(hooks): update multiple hook test suites

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-04-10 15:53:32 +09:00
parent 4180a0ba0a
commit 8a4eacfd24
14 changed files with 316 additions and 259 deletions
@@ -6,7 +6,7 @@ import { randomUUID } from "node:crypto"
import type { PluginInput } from "@opencode-ai/plugin"
import { createAtlasHook } from "./atlas-hook"
import { clearBoulderState, writeBoulderState } from "../../features/boulder-state"
import { _resetForTesting, registerAgentName, setSessionAgent } from "../../features/claude-code-session-state"
import { _resetForTesting, clearSessionAgent, registerAgentName, setSessionAgent } from "../../features/claude-code-session-state"
// Force process isolation in CI runner (globalThis.setTimeout override conflicts with other atlas tests)
mock.module("../../shared/opencode-storage-detection", () => ({
@@ -401,7 +401,8 @@ describe("atlas background task retry", () => {
// when
await hook.handler({ event: { type: "session.idle", properties: { sessionID: descendantSessionID } } })
expect(capturedTimers.size).toBe(1)
descendantAgent = "sisyphus-junior"
descendantAgent = "prometheus"
clearSessionAgent(descendantSessionID)
backgroundRunning = false
await firePendingTimers()