Skip to content

fix(workers): prevent signal generation progress from clobbering terminal result#3943

Draft
cursor[bot] wants to merge 1 commit into
developmentfrom
cursor/critical-bug-management-00dd
Draft

fix(workers): prevent signal generation progress from clobbering terminal result#3943
cursor[bot] wants to merge 1 commit into
developmentfrom
cursor/critical-bug-management-00dd

Conversation

@cursor

@cursor cursor Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes a race in agentic signal generation where fire-and-forget Redis progress writes from onStep could complete after the worker wrote the terminal done/error result. The UI polls Redis and would stay stuck on pending even though generation succeeded.

Serializes progress writes and awaits them before returning the terminal result to the caller.

Related issue (if applicable)

N/A — found by automated critical-bug scan.

How was this tested?

  • Added unit tests for createSignalGenerationProgressWriter covering late in-flight writes and post-finalize step suppression
  • pnpm --filter @app/workers test src/workers/signal-generation-progress.test.ts

Checklist

  • Lint, type-checking, and tests pass locally
  • PR title follows Conventional Commits
  • I have signed the CLA
Open in Web View Automation 

…inal result

Late fire-and-forget Redis writes from onStep could complete after the
worker wrote the done/error result, leaving the UI stuck polling pending.
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
design-system Skipped Skipped Jul 9, 2026 8:19am

Request Review

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

Labels

None yet

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

1 participant