fix: jobs stuck in initializing state when failing before execution_start#8689
fix: jobs stuck in initializing state when failing before execution_start#8689christian-byrne wants to merge 1 commit intomainfrom
Conversation
🎭 Playwright Tests:
|
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 02/06/2026, 05:28:32 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
📝 WalkthroughWalkthroughA new reconciliation mechanism detects and removes orphaned initializing prompts that no longer correspond to active jobs. The executionStore exposes a Changes
Sequence DiagramsequenceDiagram
participant QueueStore
participant ExecutionStore
participant PromptState
QueueStore->>QueueStore: Extract Running/Pending jobs<br/>into activeJobIds set
QueueStore->>ExecutionStore: reconcileInitializingPrompts(activeJobIds)
ExecutionStore->>ExecutionStore: Filter initializingPromptIds<br/>against activeJobIds
ExecutionStore->>ExecutionStore: Identify orphaned prompts
ExecutionStore->>PromptState: clearInitializationByPromptIds(orphaned)
PromptState->>PromptState: Remove orphaned prompt data
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 22.5 kB (baseline 22.5 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 840 kB (baseline 840 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 69 kB (baseline 69 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed Panels & Settings — 410 kB (baseline 410 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 12 added / 12 removed User & Accounts — 16 kB (baseline 16 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed Editors & Dialogs — 3.47 kB (baseline 3.47 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 37.8 kB (baseline 37.8 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed Data & Services — 2.1 MB (baseline 2.1 MB) • 🔴 +407 BStores, services, APIs, and repositories
Status: 11 added / 11 removed Utilities & Hooks — 234 kB (baseline 234 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 12 added / 12 removed Vendor & Third-Party — 9.37 MB (baseline 9.37 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.1 MB (baseline 7.1 MB) • ⚪ 0 BBundles that do not match a named category
Status: 49 added / 49 removed |
benceruleanlu
left a comment
There was a problem hiding this comment.
have a slight worry that doesn't seem hard to do
| ...queue.Running.map((j) => j.id), | ||
| ...queue.Pending.map((j) => j.id) | ||
| ]) | ||
| executionStore.reconcileInitializingPrompts(activeJobIds) |
There was a problem hiding this comment.
Potential regression on transient queue fetch failures: api.getQueue() returns empty Running/Pending on error fallback, so this reconciliation can clear all initializingPromptIds even while jobs are still active. Consider gating reconciliation to only run when queue fetch is known-good (e.g. return { ok: boolean } from fetch/getQueue and skip reconcile when ok === false).
There was a problem hiding this comment.
Great point, will fix, thanks for pointing it out.
Summary
Fix jobs getting permanently stuck in "initializing" state when they fail before the
execution_startWebSocket event fires.Changes
reconcileInitializingPrompts(activeJobIds)toexecutionStorethat removes orphaned initializing prompt IDs not present in the active jobs set. Called fromqueueStore.update()after fetching Running/Pending jobs, ensuring stale initializing states are cleaned up on every queue poll.Review Focus
clearInitializationByPromptIdsto avoid duplicating Set-diffing logic.queueStore.update()which is already a periodic poll — no additional network calls.┆Issue is synchronized with this Notion page by Unito