Skip to content

Flaky under load: backgroundSubagents.test.ts 'reports a sub-agent paused for approval as awaiting-approval' (10 ms wait) #311

Description

@LinuxDevil

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions