Skip to content

test(regression): reuse SessionAutoReply in subagent-hang test (F12)#15

Closed
tesdal wants to merge 1 commit intophase-ab-basefrom
audit-f12-regression-reuse-autoreply
Closed

test(regression): reuse SessionAutoReply in subagent-hang test (F12)#15
tesdal wants to merge 1 commit intophase-ab-basefrom
audit-f12-regression-reuse-autoreply

Conversation

@tesdal
Copy link
Copy Markdown
Owner

@tesdal tesdal commented Apr 29, 2026

Summary

F12 of the audit-remediation effort. The subagent-hang regression test (Test B in subagent-hang-regression.test.ts) duplicated the SessionAutoReply contract inline via raw bus.subscribeCallback handlers. Replace the manual mirror with the real production path so the test exercises SessionAutoReply.make directly — drift in the production implementation now fails this regression directly.

Changes

  • Replace ~30 lines of manual subscription with Effect.acquireRelease(SessionAutoReply.make(...), handle.unsubscribe).
  • Drop unused imports (Bus, Permission, Question).
  • Replace local questionsRejected counter with handle.stats.autoRejectedQuestions. Strictly stronger when paired with the existing 'dismissed' tool-error assertion.
  • Update header comment to reference SessionAutoReply directly.

Verification

  • bun typecheck from packages/opencode/ — passes.
  • bun test test/session/subagent-hang-regression.test.ts — both tests pass (52s, 8 expect calls).

Diamond review

  • codex-5.3 (spec): APPROVE
  • Opus (quality): APPROVE

This PR is opened against phase-ab-base and is review-only — it will be closed without merging. The work merges into local/integration-v2 via --no-ff after Copilot review iterates clean.

Replace manual bus.subscribeCallback mirror with the real production
SessionAutoReply.make path. The previous test was a regression gate for
the *concept* (a subscriber that rejects descendants); now it gates the
*integration* between SessionAutoReply and SessionPrompt.loop, so any
drift in the production auto-reply implementation will fail this
regression directly.

- Drop manual mirror handlers (Question/Permission bus subscribers).
- Drop unused imports (Bus, Permission, Question).
- Acquire SessionAutoReply via Effect.acquireRelease so unsubscribe runs
  on success, failure, or timeout.
- Replace the local questionsRejected counter with the handle's own
  stats.autoRejectedQuestions — strictly stronger coverage when paired
  with the existing 'dismissed' tool-error assertion.

Diamond review: codex-5.3 spec APPROVE, Opus quality APPROVE.

Refs: F12 in docs/superpowers/plans/2026-04-23-audit-remediation.md
@tesdal tesdal requested a review from Copilot April 29, 2026 18:50
@github-actions
Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the subagent-hang-regression test to exercise the real SessionAutoReply production implementation instead of duplicating its Bus subscription behavior inline, strengthening the regression gate against drift in the auto-reply integration path.

Changes:

  • Replace manual bus.subscribeCallback mirroring with Effect.acquireRelease(SessionAutoReply.make(...), unsubscribe) in the subagent-hang regression test.
  • Remove now-unused imports and the local questionsRejected counter in favor of handle.stats.autoRejectedQuestions.
  • Refresh test comments to reference SessionAutoReply directly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tesdal
Copy link
Copy Markdown
Owner Author

tesdal commented Apr 29, 2026

Review-only PR. Copilot R1 clean (overview only, 0 inline comments). Merging into local/integration-v2 via --no-ff.

@tesdal tesdal closed this Apr 29, 2026
tesdal added a commit that referenced this pull request Apr 29, 2026
The subagent-hang regression test (Test B) was duplicating SessionAutoReply's
contract inline via raw bus.subscribeCallback handlers. Replace the manual
mirror with the real production path so the test exercises SessionAutoReply.make
directly. Drift in production auto-reply now fails this regression directly.

Diamond: codex-5.3 spec APPROVE, Opus quality APPROVE.
Copilot R1: clean (overview only, 0 inline comments).

PR (review-only): #15

Refs: F12 in docs/superpowers/plans/2026-04-23-audit-remediation.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants