Skip to content
Source
Sign inSign up
pingdotgg/t3code

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

Closedchomamateusz(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/8952/headopened View on GitHub

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):

https://github.com/user-attachments/assets/ee743ee9-1143-4fe1-bb38-962c17dcbeca

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

https://github.com/user-attachments/assets/07688001-d524-4d31-aef8-141b63a80a6d

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](https://cursor.com/bugbot) for commit fb995132acae7afa8312d00cf5c67a21f3f382ca. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

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.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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 31c1c5996f88e3acf1566adc11c9b51ac7561554 and fb995132acae7afa8312d00cf5c67a21f3f382ca.

      📒 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 nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring 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 nameStatusExplanation
      Title check✅ PassedThe title clearly and concisely describes the main fix: workflow phases no longer disappear from the Agents panel.
      Description check✅ PassedThe 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✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck 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.

    3. @@ -646,3 +647,14 @@
      646647 },
      647648 ]
      648649 : []),
      650+ ...(hasPhases
      651+ ? [
      652+ {
      653+ // Phases only arrive on some progress ticks. Give them their own
      654+ // row so a later tick without phases can't overwrite it and make
      655+ // the panel flicker.
      656+ id: EventId.make(`task-phases:${event.threadId}:${event.payload.taskId}`),
      657+ createdAt: event.createdAt,
      658+ tone: "info" as const,
      659+ kind: "task.progress" as const,
      660+ summary: "Workflow phases updated",
      macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      🟡 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.
      chomamateusz(GitHub profile, opens in a new tab)commented

      I don't think this can happen — foldSubagentActivities only reads payload.summary (https://github.com/pingdotgg/t3code/blob/9b2d04317c68233782e0630464ac86d77d0686f3/packages/client-runtime/src/state/subagentRuntime.ts#L522), 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 (https://github.com/pingdotgg/t3code/blob/9b2d04317c68233782e0630464ac86d77d0686f3/apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.ts#L632), which doesn't surface as displayed activity either.

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

    4. 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](https://app.macroscope.com/pingdotgg/settings#Repos). You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. 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.

    6. juliusmarminge closed this

Sign in to join this conversation.