Skip to content

🤖 fix: show workflow-only sidebar activity#3587

Merged
ThomasK33 merged 9 commits into
mainfrom
workflow-status-p4kp
Jun 17, 2026
Merged

🤖 fix: show workflow-only sidebar activity#3587
ThomasK33 merged 9 commits into
mainfrom
workflow-status-p4kp

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

Show top-level workflow-only activity in the workspace sidebar so pending, running, or backgrounded workflow runs light up the active status dot even when no sub-agent workspace is active.

Background

Workspaces running a workflow without spawned sub-agents could look idle in the sidebar. This made long-running maintenance workflows hard to notice unless their workspace was currently selected.

Implementation

  • Added activeWorkflowRunCount to workspace activity snapshots and frontend workspace/sidebar state.
  • Emits workflow run status changes from both ORPC-started workflows and AI workflow_run tool workflows into WorkspaceService, filtering nested workflow runs so only top-level workspace workflows count.
  • Caches active workflow run IDs per workspace, serializes initial cache bootstrap, and emits current cached counts after async metadata reads to avoid stale sidebar activity during overlapping workflow transitions.
  • Uses lightweight run-status snapshots reconciled with the workflow event journal so crash-recovered active/terminal statuses seed the sidebar correctly without hydrating full workflow definitions/steps.
  • Returns zero-count tombstones for cleared workflow-only activity so reconnecting sidebar subscriptions can clear stale active dots.
  • Renders a Workflow running sidebar sublabel when workflow activity is the only live status, while preserving explicit agent/todo status text when present.
  • Includes active workflow counts in project/workspace attention logic and adds Storybook coverage for the workflow-only row state.

Validation

  • bun test src/node/services/workflows/WorkflowRunStore.test.ts --test-name-pattern "status"
  • bun test src/node/services/workflows/WorkflowService.test.ts --test-name-pattern "starts a named workflow|moves foreground workflow runs"
  • bun test src/node/services/workspaceService.test.ts --test-name-pattern "workflow activity"
  • bun test src/browser/components/AgentListItem/AgentListItem.test.tsx
  • MUX_ESLINT_CONCURRENCY=1 make static-check
  • Ran the project simplify workflow and applied its cleanup commit.
  • Dogfooded the new AgentListItem/WorkflowOnlyActivity Storybook row and captured screenshot/video evidence in the agent session.
  • PR checks: required GitHub check rollup is passing; Codex approved the final commit.

Risks

Medium: the change touches workflow status propagation, workspace activity snapshots, crash-recovery status reads, and sidebar attention state. The active-run cache is event-driven and lazily bootstrapped; targeted tests cover cache reuse, parallel status events, overlapping metadata reads, journal/run-file status reconciliation, and cleared workflow-only tombstones.


Generated with mux • Model: openai:gpt-5.5 • Thinking: xhigh • Cost: $47.81

Cache top-level active workflow run IDs per workspace, use lightweight workflow run status snapshots for activity notifications, centralize workflow status classifiers, and deduplicate sidebar activity indicator markup.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8d53b4cda

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/workspaceService.ts Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Addressed the workflow activity preservation feedback by merging cached active workflow counts into subsequent workspace activity emissions and covering both metadata-update and direct emit paths with a targeted test.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78bbcc2c16

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/orpc/router.ts
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Addressed the tool-started workflow feedback by wiring AIService's workflow_run WorkflowService through the same workspace activity status handler as ORPC-started workflows. Also routed goal activity through emitWorkspaceActivity so cached workflow counts are preserved on that emission path too.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20829916c4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/workspaceService.ts
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Addressed the initial cache bootstrap race by installing a shared per-workspace Set before awaiting the lightweight disk scan, making concurrent status events await the same bootstrap and mutate the same cache. Added a targeted parallel status-event regression test.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8386b413a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/workspaceService.ts Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Addressed the overlapping metadata read race by updating the workflow cache first and deriving the activity count at emission time from the shared cache after the async snapshot read. Added a regression test where overlapping terminal events complete out of order.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 65bb30d8bb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/workflows/WorkflowRunStore.ts Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Addressed stale active run-file snapshots by reconciling active-looking lightweight status snapshots against the workflow event journal when no mutation lock is active. Added a regression test where run.json is stale active but events.jsonl contains the terminal status.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 501526ffa9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/workflows/WorkflowRunStore.ts Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Addressed stale inactive run-file snapshots by reconciling all unlocked lightweight status snapshots against the workflow event journal. Added a regression test where run.json remains interrupted while events.jsonl has a resumed running status.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 669b56c3dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/node/services/workspaceService.ts Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

Addressed the disconnected-subscription clearing case by returning a zero-count activity tombstone for workspaces that previously had workflow-only activity cached. Added a regression assertion that a cleared workflow-only workspace remains present in activity.list without activeWorkflowRunCount.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: de6de19208

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ThomasK33 ThomasK33 added this pull request to the merge queue Jun 17, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jun 17, 2026
@ThomasK33 ThomasK33 added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit a7f047b Jun 17, 2026
22 of 24 checks passed
@ThomasK33 ThomasK33 deleted the workflow-status-p4kp branch June 17, 2026 19:53
mux-bot Bot added a commit that referenced this pull request Jun 18, 2026
Replace the inline run.status === completed/failed/interrupted check in
interruptRunOnAbort with the isTerminalWorkflowRunStatus helper introduced
by #3587, which encodes the exact same terminal-status set. Behavior-preserving
dedup; the helper is the canonical predicate for this check across taskService
and task_await.
@mux-bot mux-bot Bot mentioned this pull request Jun 18, 2026
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