Skip to content

Fix race condition in ScopeWaiter consent flow#91

Merged
priyanshujain merged 1 commit intomasterfrom
fix-scope-waiter-race
Mar 18, 2026
Merged

Fix race condition in ScopeWaiter consent flow#91
priyanshujain merged 1 commit intomasterfrom
fix-scope-waiter-race

Conversation

@priyanshujain
Copy link
Copy Markdown
Collaborator

Summary

  • Fixed a race condition in ScopeWaiter where Signal could fire before Wait registered the pending state, causing the consent flow to hang
  • Split Wait into Register + Await so the state is registered before the auth link is sent via NotifyLink
  • This was causing flaky TestGWSExecute_MissingScopeSignaled failures in CI

Test plan

  • TestGWSExecute_MissingScopeSignaled passes 10/10 with -count=10
  • All TestScopeWaiter_* tests pass
  • Full agent/tools test suite passes
  • go build ./... passes

Signal could fire before Wait registered the pending state, causing
the test (and production consent flow) to hang. Split Wait into
Register + Await so the state is registered before the auth link
is sent.
@priyanshujain priyanshujain merged commit 913eef9 into master Mar 18, 2026
8 checks passed
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