Seen while verifying M9 (#232, PR #310): src/subagents/backgroundSubagents.test.ts > "reports a sub-agent paused for approval as awaiting-approval, with its approvalId (without agent_await, M4)" failed twice in full-suite runs on a loaded machine (other agents running suites), with agent_status reporting the task as running instead of awaiting-approval. It passed 3/3 when run alone. The test's statusOncePaused turn waits a fixed setTimeout(10) after the approval is asked for, assuming the child's pause settles within 10 ms. The lead sends without a listener, so the M9 change (listener runs stream model calls) is not on its path.
Suggested fix: wait for the child's pause deterministically (e.g. poll the background task's status, or resolve a promise from the approval store's save) instead of a fixed 10 ms.
Seen while verifying M9 (#232, PR #310):
src/subagents/backgroundSubagents.test.ts> "reports a sub-agent paused for approval as awaiting-approval, with its approvalId (without agent_await, M4)" failed twice in full-suite runs on a loaded machine (other agents running suites), withagent_statusreporting the task asrunninginstead ofawaiting-approval. It passed 3/3 when run alone. The test'sstatusOncePausedturn waits a fixedsetTimeout(10)after the approval is asked for, assuming the child's pause settles within 10 ms. The lead sends without a listener, so the M9 change (listener runs stream model calls) is not on its path.Suggested fix: wait for the child's pause deterministically (e.g. poll the background task's status, or resolve a promise from the approval store's save) instead of a fixed 10 ms.