t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Editing and resending a message shows a context handoff from a model to itself

Open smirea opened this issue 1 week ago • 1 comments

Before submitting

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

Area

apps/web

Steps to reproduce

With the dev replay agent (Replay (dev)), in the web client:

  1. Open a thread that has one finished turn.
  2. Send a second message, for example "Second question", and let the turn finish.
  3. On that message choose Edit from here, then Revert and keep changes. The message returns to the composer.
  4. Send it again without changing the model.

Any ACP agent does the same (Antigravity, Grok, Kiro), since none of them can truncate its own conversation. It was first seen on Antigravity with Gemini 4 Neon.

Expected behavior

The timeline says what happened: the provider conversation was restarted in a fresh session and given the kept history. The server already names it that way, since the turn item it writes is titled "Recovered context". No model or provider changed, so the row should not name a source and a target.

#28178 asked for this row so that the thread "shows that the provider conversation couldn't be resumed and a new one was started". docs/user/providers-antigravity.md describes the same event for Edit from here: "the next turn starts a fresh Antigravity session and T3 Code sends it the kept conversation".

Actual behavior

A divider appears above the resent message that reads Context handoff · Multi turn → Multi turn (on Antigravity: Context handoff · 4 Neon → 4 Neon): a handoff from a model to itself.

Root cause: the resume fallback in ProviderTurnStartService writes a handoff turn item whose source and target are the same provider conversation (fromProviderThreadIds is [toProviderThreadId], title "Recovered context"). resolveHandoffEndpoints in packages/client-runtime/src/handoff.ts and the web and mobile rows treat every handoff item alike and draw <from> → <to> under the fixed label "Context handoff", so a recovery reads as a switch that never happened. Since #30188 this path runs on every Edit from here on an ACP agent, not only when a resume fails.

Impact

Cosmetic issue

Version or commit

Nightly v0.1.12-nightly.20261120.4994, and main at 31e31c608d.

Environment

Reproduced with the dev replay agent in the web client (headless Chromium, 1280×800). First seen in the macOS desktop app on an Antigravity thread, Gemini 4 Neon.

Logs or stack traces

Server log for the resent turn on the Antigravity thread:

Recovering provider context in a fresh native session
  driver: antigravity
  reason: native_session_lacks_kept_turns
  errorTag: ProviderAdapterTurnStartError

Screenshots, recordings, or supporting files

After step 4, on main:

Context handoff from Multi turn to Multi turn above the resent message

Workaround

None needed to keep working: the conversation continues with the kept history. The row cannot be hidden or corrected.

smirea avatar Nov 20 '26 15:11 smirea

Still reproducible on 0.1.14-nightly.20261129.5438 (Linux Desktop, Antigravity gemini-4-hydrogen-medium).

One additional note beyond the cosmetic <model> → <model> label: because nativeSessionLacksKeptTurns forces a session/new + resume-fallback-handoff on ACP providers (providerCanRollbackConversation = false), the impact isn't purely cosmetic—the fresh session loses native context and replays a filtered history via historicalMessage() (packages/provider-core/src/server/handoffBudget.ts), which drops all reasoning and dynamic_tool items (as well as any items omitted under the 16k-token / 64k-byte handoff budget).

In our case (15 prior runs), stopping and using Edit from here on the latest message triggered checkpoint.rollback → session/new, and the resulting handoff replayed 36 items (13 user_message, 11 assistant_message, 11 command_execution, 1 file_change) while dropping all reasoning / dynamic_tool items and omitting 4 older/oversized items.


Triaged with Gemini 4 Hydrogen (Medium) via Antigravity.

vibhor1102 avatar Nov 30 '26 09:11 vibhor1102