Skip to content

[Bug]: Antigravity Stop-hook continuation folds the answer written before it (parity with #27747) #45219

Done

Description

@royalaid

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web timeline folding, Antigravity provider (ACP adapter)

Steps to reproduce

  1. Configure an Antigravity Stop hook that continues the turn once, e.g. a command hook that returns {"decision": "continue", "reason": "Before ending, check X."} on the first Stop of a turn and {} afterwards.
  2. In T3 Code, start an Antigravity thread and ask for something with a long written answer (for example "rewrite this prompt").
  3. The agent writes the answer and tries to end the turn. The hook continues it, and the agent replies with a short note such as "The updated prompt is ready directly above; nothing is running."
  4. Let the run settle.

Expected behavior

The answer written before the hook stays visible in the main conversation, as it does for Claude since #27747 (the pre-hook reply is republished as a final answer and a "Stop hook asked Claude to continue" notice is shown), and as it already does for Codex and OpenCode, whose replies carry phase: "final_answer".

Actual behavior

Only the short post-hook note stays visible. The real answer is folded under "Worked for ..." and the note points the reader "above", where nothing is visible until they expand the fold.

In one affected run, the turn items held three assistant_message items (a 377-word answer, a rewritten version of it, then a 29-word note) with no tool call between them and no item recording the hook continuation. The timeline kept only the note. In a sample of recent Antigravity threads, 4 of the 5 runs that ended with the answer folded had a Stop-hook continuation right before the last message.

Where it is decided:

  • apps/web/src/components/chat/MessagesTimeline.logic.ts: deriveTerminalAssistantMessageIds keeps one assistant message per run, and retainedAssistantReplyEntryIds keeps only messages whose phase === "final_answer".
  • The Antigravity adapter (AntigravityAdapterV2.ts on the ACP adapter) never sets phase, so nothing marks the pre-hook reply.

A possible fix, by parity with #27747: in agy a reply with no tool call is the agent ending its turn, so a second assistant message in the same turn with no tool call between the two means a hook continued it. The adapter could mark the earlier message final_answer in that case, and show a notice like Claude's if agy exposes the hook's reason.

Impact

Major degradation or frequent failure

Version or commit

0.1.14-nightly.20261128.5385

Environment

Linux x64, T3 Code server with web UI, Antigravity provider (agy ACP), default Antigravity model

Logs or stack traces

No response

Screenshots, recordings, or supporting files

No response

Workaround

Expand "Worked for ..." on every settled Antigravity run, or have the Stop hook tell the agent to repeat its whole answer in the message after the continuation.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions