Skip to content

fix: scope background-workflow liveness to the current session#226

Merged
SDSLeon merged 1 commit into
masterfrom
lightcode/daring-summit-1da86047
Jun 22, 2026
Merged

fix: scope background-workflow liveness to the current session#226
SDSLeon merged 1 commit into
masterfrom
lightcode/daring-summit-1da86047

Conversation

@SDSLeon

@SDSLeon SDSLeon commented Jun 22, 2026

Copy link
Copy Markdown
Owner
  • Fix background workflows being shown as "live" when a thread is reopened in a later app session: a detached workflow's process only survives while the session that launched it is alive, so replayed rows now render with final manifest stats instead of a working spinner.
  • Add a non-persisted observedLive flag on runtime chat items, set only for items that arrive via the live event stream and absent on DB-hydrated rows, so the chat row and active sub-agent tile can tell session-owned workflows apart from replayed ones.
  • Replace status-only isLiveWorkflowRunStatus with isWorkflowRunLive, which also rejects stale running manifests left pinned on disk by a crashed runtime, using the run's most recent activity timestamp against a shared WORKFLOW_STALE_PROGRESS_MS threshold.
  • Adopt the new liveness check across the per-item dock poller, the per-thread live-workflow tracker, and the chat UI so all surfaces agree on what counts as in-flight.
  • Add unit tests covering observedLive flagging, stale-manifest expiry, and isWorkflowRunLive behavior.

Prevent replayed workflow rows from showing a live spinner when their
detached runtime process is gone (prior session or after a restart).

- Add observedLive flag on runtime items, set only for live-streamed
  item.started events and never persisted/hydrated from the DB
- Replace isLiveWorkflowRunStatus with isWorkflowRunLive, which also
  rejects stale `running` manifests left by a crashed runtime
- Gate chat row and tile spinners on session-owned liveness
- Tie manifest poller backstop to WORKFLOW_STALE_PROGRESS_MS
- Add tests for isWorkflowRunLive and observedLive flagging
@vercel

vercel Bot commented Jun 22, 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)
lightcode-landing Skipped Skipped Jun 22, 2026 3:55am

@SDSLeon SDSLeon merged commit 38c0b8d into master Jun 22, 2026
6 checks passed
@SDSLeon SDSLeon deleted the lightcode/daring-summit-1da86047 branch June 22, 2026 04:00
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