Skip to content

fix(server): workflow phases no longer vanish from the Agents panel - #8952

Closed
chomamateusz wants to merge 2 commits into
pingdotgg:mainfrom
chomamateusz:fix/workflow-phase-visibility
Closed

chomamateusz wants to merge 2 commits into
pingdotgg:mainfrom
chomamateusz:fix/workflow-phase-visibility

Conversation

@chomamateusz

@chomamateusz chomamateusz commented Aug 31, 2026

Copy link
Copy Markdown

What Changed

Workflow phases now live in their own activity row with a stable id (task-phases:${threadId}:${taskId}) instead of riding on the coordinator's task-progress: row. The row is written only when an event actually carries phases, so nothing can overwrite it with an empty list. It is marked usageSnapshot, which keeps the client fold from reading it as a status change.

Why

Pending phase chips flicker out and back in the Agents panel during a run. task.progress upserts the coordinator under one stable task-progress: id, so a later tick without phases overwrites the row that had them; the fold then keeps only phases with live members and drops the pending ones until the next tick. A dedicated task-phases: row can't be blanked by a phaseless tick.

Different from #8720 / #8749, which fix the between-phases agent count in client-runtime — this is the phase list dropped at server ingestion during a phase.

UI Changes

Before — the pending Sequential chip and its greyed-out section blink in and out during the run (sped up ~5x; the appearances are held slightly longer so they're visible):

t3-phases-before.mp4

After — the pending phase stays visible for the whole run:

t3-phases-after.mp4

Stills from the same before run, seconds apart — the greyed-out Sequential section is there, then gone. After the fix it stays put:

t3-phases-before-visible t3-phases-before-missing t3-phases-after-stable

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Model: Claude Fable 5
Harness: Claude Code in T3 Code


Note

Low Risk
Scoped change to task.progress activity projection and tests; no auth, persistence schema, or client code changes in this diff.

Overview
Workflow phase chips in the Agents panel stop flickering because server ingestion no longer stores phases on the same upserted task-progress: activity that plain progress ticks overwrite.

When a task.progress event includes a non-empty phases array, ingestion now also emits a separate activity with id task-phases:{threadId}:{taskId}, mirroring the existing split between task-progress: and task-usage:. That row is only created on ticks that carry phases, is marked usageSnapshot: true so the client fold does not treat it as a status change, and includes phase metadata via the same linkage fields as other task activities. Phaseless ticks still update task-progress: only, so they cannot blank the last known phase list.

A regression test asserts phases survive on the dedicated row and that a plain progress tick does not emit or replace task-phases:.

Reviewed by Cursor Bugbot for commit fb99513. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Emit dedicated task-phases activity in runtimeEventToActivities for task.progress events

  • In ProviderRuntimeIngestion.ts, the task.progress branch now detects event.payload.phases via hasPhases and emits an additional activity with id task-phases:<threadId>:<taskId>, tone info, kind task.progress, and usageSnapshot: true.
  • The new activity preserves phases and identity linkage in a snapshot that a later plain progress tick cannot blank, fixing workflow phases vanishing from the Agents panel.
  • Adds a regression test in ProviderRuntimeIngestion.activity.test.ts verifying the phases activity survives a subsequent plain tick.
  • Behavioral Change: runtimeEventToActivities now produces an extra activity for any task.progress event with a non-empty phases array; downstream consumers of the task-phases:<threadId>:<taskId> id format should be checked.
📊 Macroscope summarized d383942. 1 file reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

Summary by CodeRabbit

  • New Features

    • Workflow phase updates now appear as a dedicated activity snapshot.
    • Phase details remain visible when subsequent progress updates are received.
  • Bug Fixes

    • Prevented progress-only updates from overwriting previously displayed workflow phase information.

Workflow phase chips (pending later phases) flickered out and back in the
Agents panel during a run. The coordinator's phase list only rides on
material workflow_progress ticks; a plain progress tick (token/tool update,
no phases) upserting the shared task-progress activity id blanked the phase
list until the next material tick.

Emit phases under their own stable task-phases id so a phaseless tick can
never overwrite them. The row is metadata-only (usageSnapshot) so the client
fold does not read it as a status transition.
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 31, 2026
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 02d6227a-5d4a-49bc-9060-86d4b4ad6be0

📥 Commits

Reviewing files that changed from the base of the PR and between 31c1c59 and fb99513.

📒 Files selected for processing (2)
  • apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.activity.test.ts
  • apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The runtime ingestion logic now emits a dedicated activity snapshot when task.progress includes workflow phases. Tests verify the stable activity ID, preserved phase payload, usageSnapshot flag, and exclusion for plain progress events.

Changes

Runtime ingestion

Layer / File(s) Summary
Phase snapshot activity and coverage
apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts, apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.activity.test.ts
The task.progress handler detects non-empty phases arrays and emits a stable task-phases:${threadId}:${taskId} activity with the phase payload and usageSnapshot: true. Tests verify phased and plain progress events.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to fb995

The PR separates workflow phase snapshots from ordinary progress updates so pending phases remain visible in the Agents panel; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: t3dotgg, juliusmarminge, maria-rcks

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main fix: workflow phases no longer disappear from the Agents panel.
Description check ✅ Passed The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the root cause and implementation, provides before-and-after media for the UI change, and marks…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the root cause and implementation, provides before-and-after media for the UI change, and marks the checklist items complete.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

Warning

⚠️ This pull request shows signs of AI-generated slop (ai_padded_prose). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

createdAt: event.createdAt,
tone: "info" as const,
kind: "task.progress" as const,
summary: "Workflow phases updated",

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.

🟡 Medium Layers/ProviderRuntimeIngestion.ts:660

The phase snapshot overwrites the coordinator's real current activity with "Workflow phases updated" because it is emitted as a task.progress row with a non-empty summary, and the client fold processes that summary even when usageSnapshot is set. Use an empty summary for this phase-only row so it updates phases without replacing the displayed activity.

🤖 Copy this AI Prompt to have your agent fix this:
In file @apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts around line 660:

The phase snapshot overwrites the coordinator's real current activity with `"Workflow phases updated"` because it is emitted as a `task.progress` row with a non-empty summary, and the client fold processes that summary even when `usageSnapshot` is set. Use an empty summary for this phase-only row so it updates phases without replacing the displayed activity.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I don't think this can happen — foldSubagentActivities only reads payload.summary (

const summary = asString(payload.summary);
), and this row's payload doesn't carry a summary key; the string only exists on the activity row itself. It mirrors the existing task-usage: row (
id: EventId.make(`task-usage:${event.threadId}:${event.payload.taskId}`),
), which doesn't surface as displayed activity either.

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.

Sorry, I'm unable to act on this request because you do not have permissions within this repository.

@macroscopeapp

macroscopeapp Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — This is a narrow server-side bug fix that preserves workflow phases in a stable activity snapshot and adds targeted coverage, without schema, security, deployment, or default changes. An unresolved Medium finding does identify that the snapshot summary can overwrite the coordinator’s displayed activity text, which remains a merge blocker under the repository’s configured threshold.

Not approved because:

  • 1 blocking correctness issue found at or above your repo's Minimum Blocking Severity

Adjust the Minimum Blocking Severity for this repo — including turning it Off — in Settings. You can add or adjust custom eligibility rules. Learn more.

@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for the PR. We're not taking changes to the orchestration and provider layers right now: that part of the server is being rewritten for V2, and merging into the current code would either conflict with or be thrown away by that work.

Closing for now. If this is still an issue once V2 lands, please reopen (or open a fresh PR against the new code) and we'll take a proper look.

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants