Skip to content

fix(acp,web): keep finished replies and question cards visible across steers and background wakes - #146

Merged
mfituri merged 5 commits into
mainfrom
t3/fix-question-cards-hidden-on-new-message
Nov 25, 2026
Merged

mfituri merged 5 commits into
mainfrom
t3/fix-question-cards-hidden-on-new-message

Conversation

@mfituri

@mfituri mfituri commented Nov 22, 2026 •

Copy link
Copy Markdown

Problem

When a run produces multiple assistant messages—because a user steers mid-run, an Inbox or agent-to-agent update arrives as a steer, or a background command/timer/subagent wakes an open Antigravity/ACP run—the timeline only treated the run's last assistant message (or messages tagged phase: "final_answer") as non-collapsible. Once the run settled (or in Zen mode), earlier finished assistant responses—including messages holding unanswered question cards—collapsed into a "Worked for …" / "Continued for …" fold row while the user was still reading or answering them.

Fix

  • ACP adapter (packages/provider-acp/src/server/adapter.ts): Track promptSequence on open text segments and close completed assistant replies with phase: "final_answer" at the three reply-completion boundaries where a run can keep going (usage_update under replyEndsWithUsageUpdate after prompt settlement or steer supersession, a superseded followPrompt returning end_turn for its own segment, and deferredBackgroundWork || pendingReply when the prompt settles as completed). Mid-turn tool narration (closed by emitTool before any usage_update or prompt settle) stays untagged and continues to fold.
  • Web timeline (apps/web/src/components/chat/retainedAssistantReplies.logic.ts, MessagesTimeline.logic.ts, questionBlock.logic.ts): Route fork retention through addForkRetainedAssistantReplyEntryIds in retainedAssistantReplyEntryIds, keeping finished question-card messages (messageHasQuestionCards) and the last completed unphased assistant_message directly before a native steer visible across settled turn folds, superseded-attempt folds, and Zen mode while still folding mid-turn narration between tool calls.
  • Tests & fork docs: Added focused tests in apps/server/src/orchestration-v2/Adapters/AcpReplyPhase.test.ts, apps/web/src/components/chat/retainedAssistantReplies.logic.test.ts, and apps/web/src/components/chat/questionBlock.logic.test.ts, and documented both minimal seams in fork/README.md.

Tracks: COD-191

Verification

  • vp test run apps/server/src/orchestration-v2/Adapters/AcpReplyPhase.test.ts apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts (38/38 passed)
  • vp test run apps/web/src/components/chat/retainedAssistantReplies.logic.test.ts apps/web/src/components/chat/questionBlock.logic.test.ts apps/web/src/components/chat/MessagesTimeline.logic.test.ts (163/163 passed)
  • vp test run apps/web/src/components/chat/MessagesTimeline.browser.test.tsx (78/78 passed)
  • vp run check:changed (format, lint, knip, graphql, 43-package typecheck, tests, React Compiler all green)

Done with Gemini 4 Neon in the Antigravity harness.

@cursor

cursor Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches ACP reply finalization and timeline fold rules, which affect what users see during multi-reply runs, but changes are scoped with focused tests and no auth/data-layer impact.

Overview
Fixes timeline folding so finished assistant replies and question-card messages stay visible when a run keeps going after steers, inbox updates, or background ACP wakes.

The ACP adapter now tracks prompt sequence on text segments and closes completed assistant streams with phase: "final_answer" at the three boundaries where the run can continue (usage update after settlement/supersession, superseded prompt end_turn, and deferred background work)—while mid-turn tool narration remains untagged and foldable.

On the web client, addForkRetainedAssistantReplyEntryIds extends fold retention for finished messages with question cards (messageHasQuestionCards) and the last completed unphased reply immediately before a native steer, in both normal and Zen timeline modes. Server and UI behavior are covered by new tests; fork README documents the seams.

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

@mfituri mfituri changed the title fix(web): keep question card messages visible when later messages arrive in a run fix(acp,web): keep finished replies and question cards visible across steers and background wakes Nov 24, 2026
…-hidden-on-new-message

# Conflicts:
#	fork/README.md

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e82ca73. Configure here.

@mfituri
mfituri merged commit 91ac3d4 into main Nov 25, 2026
28 checks passed
@mfituri
mfituri deleted the t3/fix-question-cards-hidden-on-new-message branch November 25, 2026 01:03
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