fix(workflows): keep follow-up Working visible - #2057
Merged
Conversation
An attached workflow-stage chat sat idle while a workflow-authored idle follow-up was already running: nothing told the chat a delivery had been admitted until the public agent_start cleared the session's ordered extension event queue. Report accepted idle-delivery start and settlement on a workflow-internal channel and map it onto the chat's ordinary Working lifecycle. The channel replays active deliveries to late subscribers, so attaching or remounting mid-delivery paints immediately. A pre-turn compaction_end reasserts the lifecycle for a still-active delivery while preserving factual status text, and a terminal transition drops its pre-terminal leases so a leftover agent_start or turn_start cannot restart Working on a finished stage. Live-turn followUp/steer queueing, controlled pause, terminal-root rejection, post-mortem chat, and retry/fallback/compaction/error status precedence are unchanged. Assistant-model: Claude Opus 5
Start one correlated delivery lease before lazy session preparation while preserving the final SDK admission guard. Rearm stale lifecycle fencing after the last post-terminal delivery settles. Assistant-model: GPT-5.6 Sol
A pre-turn compaction_end clears the host Working lifecycle, so the stage chat reasserts one lifecycle and writes that same generation into every delivery lease still open. Two overlapping workflow-authored deliveries then aliased one token, and settling the first one called settleExternalPromptLifecycle() with the current generation, stopping Working and its animation while the second lease was still accepted and its public agent_start still pending. Settle a host generation only when no remaining active lease references that exact token. Distinct generations, including stale ones, still reach the host's own generation fence unchanged, and the terminal stale-start fence stays map-wide so it rearms only after the last lease settles. Assistant-model: Claude Opus 5
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
# Conflicts: # packages/coding-agent/CHANGELOG.md
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.
Summary
Keep the attached workflow-stage Working indicator visible for workflow-authored follow-up turns from admission through retained-session restore, prompt startup, pre-turn compaction, and agent handoff. Correlated delivery ownership also prevents late or overlapping lifecycle events from clearing or restarting the indicator at the wrong time.
Changes
[Unreleased]changelog entry.Validation
bun run test:unit: 4,386 passed, 2 skipped, 0 failedbun run test:integration: 288 passed, 1 skipped, 0 failedbun run typecheck: passedbun run lint: passedbun run check:file-length: passedbunx tsgo -p packages/coding-agent/tsconfig.build.json --noEmit: passedgit diff --check origin/main...HEAD: passedTmux evidence
This is the exact
tmux capture-paneoutput from a fresh deterministic terminal replay. It runs the real workflow delivery channel andStageChatViewlifecycle in a Bun test harness; it is not a live-provider/full Atomic CLI screenshot. The replay proves that Working remains visible while delivery B still owns the reconciled lifecycle, clears after the final settlement, and cannot be restarted by a stale terminal event.Fresh tmux replay
A second independent tmux replay produced the same state sequence:
Notes
No package versions or generated artifacts changed. Commits are conventional and carry
Assistant-modelattribution.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Greptile Summary
Implements a correlated delivery-activity lifecycle for workflow-authored follow-up turns.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
What T-Rex did
Important Files Changed
Sequence Diagram
Reviews (2): Last reviewed commit: "Merge origin/main into fix/workflow-foll..." | Re-trigger Greptile