Skip to content

Conversation

@newhook
Copy link
Owner

@newhook newhook commented Feb 1, 2026

Summary

  • Fix race condition where fast CI runs complete before the first PR feedback poll
  • Add SpawnWorkflowWatchers exported function to spawn watchers for in-progress/queued workflows
  • Call this function immediately in co complete --pr after setting the PR URL

Previously, workflow watchers were only spawned during PR feedback polling. For fast CI runs (< 1 minute), the CI would complete before the first poll, so gh run watch was never used.

Test plan

  • Added unit tests for SpawnWorkflowWatchers function
  • All existing tests pass
  • Manual test: Create a PR and verify watchers are spawned immediately

🤖 Generated with Claude Code

Previously, workflow watchers were only spawned during PR feedback polling,
which meant fast CI runs could complete before the first poll. This created
a race condition where gh run watch was never used for quick CI pipelines.

Now, when a PR URL is provided to `co complete --pr`, we immediately fetch
the PR's workflow runs and spawn watchers for any that are in_progress or
queued. This ensures immediate notification when CI completes.

Changes:
- Add exported SpawnWorkflowWatchers function in control package
- Call SpawnWorkflowWatchers from cmd/complete.go after setting PR URL
- Add tests for the new function

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@newhook newhook merged commit 8ba0b12 into main Feb 2, 2026
3 checks passed
@newhook newhook deleted the fix/spawn-watchers-on-pr-create branch February 2, 2026 14:22
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.

2 participants