Skip to content

fix(assistant): eliminate update-bulletin wake-resolver race + clean up orphans#26427

Merged
siddseethepalli merged 1 commit into
mainfrom
run-plan/updates-bg-job/fix-r2-1
Apr 18, 2026
Merged

fix(assistant): eliminate update-bulletin wake-resolver race + clean up orphans#26427
siddseethepalli merged 1 commit into
mainfrom
run-plan/updates-bg-job/fix-r2-1

Conversation

@siddseethepalli

@siddseethepalli siddseethepalli commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Primary race fix: runUpdateBulletinJobIfNeeded() is now dispatched AFTER DaemonServer.start() resolves, which is where registerDefaultWakeResolver() runs. The previous dispatch site ran concurrently with server startup, so the wake fired before the resolver was in place and silently returned {invoked: false}. The dispatch remains fire-and-forget (void import(...).then(...).catch(...)), preserving the 'daemon must never block startup' invariant.
  • Belt-and-suspenders cleanup: even with the race fix, wakeAgentForOpportunity() can return {invoked: false} for other reasons (conversation-not-found, future regressions). The job now detects this and deletes the orphan background conversation it just bootstrapped, so we don't leak DB rows and LLM title-generation calls.
  • Added a regression test that asserts both branches (race-case cleanup + normal-case no cleanup).

Part of plan: updates-md-background-job.md (round 2 post-review fix)


Open in Devin Review

@siddseethepalli siddseethepalli merged commit a338e76 into main Apr 18, 2026
@siddseethepalli siddseethepalli deleted the run-plan/updates-bg-job/fix-r2-1 branch April 18, 2026 21:22

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment thread assistant/src/prompts/update-bulletin-job.ts
Comment thread assistant/src/prompts/update-bulletin-job.ts
Comment thread assistant/src/prompts/update-bulletin-job.ts
@siddseethepalli

Copy link
Copy Markdown
Contributor Author

Addressed in #26473

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