Repository navigation
fix(server): server-run workflows list every phase up front with each agent's model and time - #18
Merged
Merged
Conversation
… agent's model and time A t3_workflow_run row only showed a phase once an agent in it launched, and its agents carried no provider, model, effort or timestamps, so Lineage and the mobile Agents sheet showed "Not reported" and no run time. The row now lists every stage from the spec when the run is recorded (a repeat's stages labelled round 1), each agent queued. A later round's stages join when the round starts, before the stages after the repeat. Each agent carries the provider, model and effort delegate_task resolves for its target, plus queuedAt, startedAt, completedAt and durationMs. Clients treat a phase of only queued agents as not started and use a member's own provider before it launches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and old rows fail cleanly Review of #18 found four gaps. Times were stamped when the runner noticed a change, so a child that ended during a restart showed the restart time. A member kept its planned model after its child ran another one. A planned agent a run never reached showed as failed with a completion time. Rows from the earlier layout would be expanded with the new one. Each launched member now reads its provider, model, effort, start and end from its child's run records when it starts and when it settles. Clients mark a planned member the run ended before as not started: no completion time, not settled. The row's workflowRun carries version 2; a running row without it fails with a reason and cancels its children instead of resuming, and status reports that reason. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd drops a planned effort Review round 2 of #18 found two gaps. A child whose run started after it was delegated kept its request time as its start when the run ended by timeout or stop, because nothing read its runs again before the final row. And a member kept the planned effort when its child ran a model that has none. Before the run's terminal row, every launched child's runs are read once more. Once a child's facts exist, the member shows the child's whole target, so a missing effort stays missing. The parent-wake test helper now waits for the offer, which follows the row's commit, instead of reading it once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Size: M (320 hand-written non-test lines added, 96 removed; 529 test lines). 3 commits: the change, plus review rounds 1 and 2.
Problem
Etan watched a live
t3_workflow_runand said: "the UI does not work like the Claude Code native Workflows UI ... workflow starts, it only shows the first phase, and then when the first phase finishes, only then the second one shows." He also said the agents "show as not reported for the type of agent it is", and that no agent or phase showed a run time.The cause: the row's
workflow.agentsheld only launched agents, and Lineage hides phases that have no members. Agents carried nomodel, soresolveSubagentMetadataprinted "Not reported". They had no timestamps, so neither member rows nor phase headers had anything to time.Change
workflowPhases(spec, state)lists every stage. A repeat's stages appear once per round reached, with round 1 listed up front and titledrevise · round 1.toRowemits every agent of every phase in phase order, and agents the run hasn't launched arequeued.workflowRun(cursor, round, exits), so restore recomputes it.snapshotOfmapsphaseIndexback to a stage and round.queuedAthasn't launched yet.checkTargetreturns theModelSelectionthat delegate_task resolves, with the parent's defaults filled in.providerInstanceId,modelandeffortfrom the child's own run (run.modelSelection). That applies even when the parent's model changed in between.reasoningEffort ?? effort, the same wayProviderEventIngestorreads it.startedAtis the child's first run'sstartedAt. Until that run starts, itsrequestedAtstands in, so a live row can tick.completedAtis the last run'scompletedAt, anddurationMsis the difference.queuedAt, which is its own persisted launch decision.notStarted. It has no completion time, it isn't counted insettledCount, and its phase stayspending.queued.workflowRun.version = 2is written on every row update.error: "This run was recorded by an older T3 build, so it cannot be resumed.". That wakes the parent once.t3_workflow_statusreports the same reason.OrchestrationV2WorkflowAgent.providerInstanceIdandOrchestrationV2WorkflowRunState.version.pending.RuntimeSubagentcarries the member'sproviderInstanceId. Web Lineage and the mobile Agents sheet use it before a child task exists.Provider decision: the change is provider-agnostic. Each member's provider, model and effort come from delegate_task's resolver, and then from the child's own run. Claude-native workflow ingestion (
claudeWorkflowProgress.ts) is untouched.Tests that failed first
Round 0:
['draft','revise','review','ship']and no model, effort or provider fields.subagentRuntime.test.ts, "leaves a phase of only queued members not started, and keeps each member's provider". The phase came out asrunning.threadAgentsPresentation.test.ts, "opens where a stopped run stopped, not a planned phase it never reached". It returned"2"instead of"1".Round 1, for the review's 4 MUST_FIX findings:
completedAtas the observation time, 10 s later than the child's 1 s run.startedAt.codex/gpt-5.4for a child that ranclaudeAgent/claude-sonnet-5-5at effort low.subagentRuntime.test.ts, "planned members a run never launched: stay not started, unsettled and untimed when the coordinator is failed/cancelled". The phase came outdonewith 1 settled. The mobile rail-tone assertion gotstoppedinstead ofqueued.Round 2, for the review's 2 MUST_FIX findings:
+0) instead of its run start (+500). Fix: every launched child's runs are read again just before the run's terminal row is written.effort: "low"on a child that ran Claude Sonnet with no effort. Fix: once a child's facts exist, the member shows the child's whole target and none of the plan.The parent-wake helper in
WorkflowRuns.test.tsnow waits on aSubscriptionReffor the offer, which follows the row's commit, instead of reading it once. The old single read only passed because of scheduling order.All tests drive time with
TestClockand wait on persisted row and child events, with no sleeps.Measured bytes (largest workflow row update on the wire, deduped, results excluded)
Test:
keeps every workflow row update within 2 KB on the wire across a 20-agent stage and 3 rounds. It now runs at a real epoch (TestClock.setTime(1_793_404_800_000)), so every timestamp costs its full 13 digits.The record event carries the full plan, so it isn't budgeted, the same as before: the record already carries the spec once. Each later update is a delta. The tool list and agent instructions are unchanged, and
AgentContextBudget.test.tspasses.Gate
bash gate.sh fork/wf/integrationat82651a9492:WorkflowRuns.test.ts15/15, client-runtime 15/15;gate: green against fork/wf/integration.Also run:
workflowRun.test.ts,claudeWorkflowProgress.test.ts,orchestrationV2DedupedBodies.test.ts,OrchestratorMcpService.test.tsandAgentContextBudget.test.ts, 73/73 green.Not done: no live client capture yet. That belongs to the lead's integrated pass on the dev env.
Implementer: Claude Opus 5.5. Review rounds: 2.
007a48e5c8.82651a9492. Wire bytes are unchanged at 1,793 / 1,580 B.🤖 Generated with Claude Opus 5.5 in T3 Code Nightly