Commit 5764aa1
committed
test(phase-c): flesh out subagent-hang regression tests
Test A: SSE stall triggers retry, not indefinite hang. Queues a hang
reply into the test LLM server; configures chunkTimeout=1000ms; asserts
SessionStatus transitions to { type: 'retry', attempt >= 1, message
~/SSE|timed out/i } within 8s. Gates against regression of Phase A
wrapSSE + retry classification.
Test B: subagent question in headless run does not deadlock. Queues a
root 'task' call and a subagent 'question' call. Mounts an in-test bus
subscriber that mirrors the RunEvents contract (reject descendant
questions/permissions). Asserts the root loop completes within 10s and
settles idle. Gates against regression of Phase B handler contract +
Question/Permission reject path.
Implementation notes surfaced by the subagent refiner:
- SSEStallError is classified transport-retryable by SessionRetry.retryable,
so session.error only fires after 5 retries (60s). Test observes the
retry status transition instead of session.error for fast regression.
- The 'general' subagent inherits question: 'deny' from agent defaults,
so Test B overrides it via config.agent.general.permission.question.
- Effect 4 beta: Fiber.poll removed; using fiber.pollUnsafe() on instance.
- RunEvents handler lives in the CLI layer and is not reusable; the test
mirrors its contract (reject on bus events) to avoid importing CLI
wiring into session tests.
Verified: bun typecheck pass; 2/2 tests pass in 20s.
Per plan docs/superpowers/plans/2026-04-18-subagent-hang-hardening.md:1246-1256.1 parent 9a41b2d commit 5764aa1
1 file changed
Lines changed: 407 additions & 29 deletions
0 commit comments