Skip to content

fix: defer QA latch updates until message is accepted#7459

Merged
Jasonnnz merged 1 commit into
feature/qa-video-automationfrom
swarm/fb-7424
Feb 24, 2026
Merged

fix: defer QA latch updates until message is accepted#7459
Jasonnnz merged 1 commit into
feature/qa-video-automationfrom
swarm/fb-7424

Conversation

@Jasonnnz
Copy link
Copy Markdown
Contributor

@Jasonnnz Jasonnnz commented Feb 24, 2026

Summary

  • Moves QA intent/opt-out detection in handleUserMessage to after the secret-ingress and queue-rejection checks
  • Previously, the latch was mutated before those guards, so a message blocked by checkIngressForSecrets or rejected by enqueueMessage would still flip the QA latch
  • Adds two contract tests documenting the invariant that rejected/blocked messages must not mutate the latch

Test plan

  • bun test src/__tests__/qa-latch-user-message.test.ts — 8 tests pass (6 existing + 2 new contract tests)
  • bunx tsc --noEmit — no new type errors (pre-existing errors in unrelated files only)

Addresses feedback from #7424.

🤖 Generated with Claude Code


Open with Devin

Move QA intent/opt-out detection in handleUserMessage to after the
secret-ingress and queue-rejection checks. Previously, the latch was
mutated before those guards, so a message blocked by checkIngressForSecrets
or rejected by enqueueMessage would still flip the QA latch — causing
incorrect qaMode/requiresRecording state for subsequent escalations.

Also adds two contract tests documenting the invariant that rejected and
blocked messages must not mutate the latch.

Addresses review feedback from #7424.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Jasonnnz Jasonnnz merged commit 44f307d into feature/qa-video-automation Feb 24, 2026
@Jasonnnz Jasonnnz deleted the swarm/fb-7424 branch February 24, 2026 02:36
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant