Skip to content

fix(web,mobile): recovering a conversation no longer shows a handoff from a model to itself - #4

Closed
smirea wants to merge 6 commits into
mainfrom
fix/edit-resend-handoff
Closed

smirea wants to merge 6 commits into
mainfrom
fix/edit-resend-handoff

Conversation

@smirea

@smirea smirea commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Problem

Editing the last message and resending it on an ACP agent (Antigravity, Grok, Kiro, the dev replay agent) draws a timeline divider that reads "Context handoff · 4 Neon → 4 Neon": a handoff from a model to itself. Nothing was switched. The agent cannot rewind its own conversation, so T3 Code started a fresh session of the same conversation and sent it the kept history (docs/user/providers-antigravity.md). The same divider appears whenever a native resume fails.

The server already records what happened: the turn item is titled "Recovered context" and its source and target are the same provider conversation. Web and mobile ignore both and draw every handoff item as <from> → <to>. pingdotgg#28178 asked for the thread to show "that the provider conversation couldn't be resumed and a new one was started"; a model handing off to itself does not say that, and since pingdotgg#30188 it shows on every Edit from here on these agents.

Steps, on the dev replay agent:

  1. Open a thread that has one finished turn.
  2. Send a second message and let it finish.
  3. Use Edit from here on that message, choose Revert and keep changes, and send it again.

Change

isRecoveryHandoff in packages/client-runtime reports a handoff item whose source conversations are all its own target conversation. Only the resume fallback writes one. For such an item:

  • resolveHandoffEndpoints returns no source, so both clients drop the <from> → half and keep the target.
  • Web and mobile label the divider "Recovered context", the server's own title for the item, translated in every locale.

The check is the conversation's identity, not the model. A fork, a merge-back, or a provider switch between two conversations on one model is still a handoff and looks as it did.

Scope

Fixes #ISSUE

Routes to the row: Edit from here then resend, and a failed native resume, on web, desktop (same web client) and mobile. All go through the one shared check. Left alone: the pending-handoff footer, and handoffs between two conversations (provider switch, fork, merge-back, imported context).

pingdotgg#39437 targets the same divider. It decides by "same provider and model on both sides", which also relabels a fork and a merge-back between two conversations on one model as "Context restored" (captures below), and it adds no test.

Verification

Re-runnable on a Linux VM with no account (replay agent, headless Chromium):

  • packages/client-runtime/src/handoff.test.ts › "treats a provider conversation restarted in a fresh session of itself as a recovery": fails on main (isRecoveryHandoff is not a function), passes here. It also asserts that a same-model handoff between two conversations keeps its source.
  • vp run scenarios:prove with the scenario below, base main 563ba1af19, head afabd029e3: fails on base, passes on head. With only V2LifecycleRow.tsx reverted the scenario fails again.
Before (563ba1af19) After (afabd029e3) After, 390 px wide
Before: Context handoff from Multi turn to Multi turn After: Recovered context, Multi turn After at phone width
This branch pingdotgg#39437
New fork Fork on this branch: Context handoff Fork on #39437: Context restored
Merge-back Merge-back on this branch: Context handoff Merge-back on #39437: Context restored
  • vp run check:changed and vp run i18n:check pass.

Needs more than the VM:

  • Found on a real Antigravity thread (Gemini 4 Neon, macOS, nightly v0.1.12-nightly.20261120.4994): editing and resending the last message drew "Context handoff · 4 Neon → 4 Neon", and the server logged Recovering provider context in a fresh native session with reason native_session_lacks_kept_turns.
  • MOBILE
Scenario: edit and resend
import { expect } from "e2e";

import { test, WEB } from "./t3.ts";

test(
  "Editing and resending the last message on the same model shows no handoff between models",
  WEB,
  async ({ t3, app, screen, browser }) => {
    const project = await t3.project("demo");
    const thread = await t3.thread({ project, title: "Edit and resend", messages: ["Start"] });
    await t3.open(thread);

    const composer = screen.getByRole("textbox");
    await composer.fill("Second question");
    await browser.keyboard.press("Enter");

    // The seeded message came from the CLI, which the timeline attributes to an agent: only the
    // message sent here offers Edit from here.
    const editFromHere = screen.getByRole("button", "Edit from here");
    await expect(editFromHere).toHaveCount(1, { timeout: 60_000 });
    await expect(editFromHere).toBeEnabled({ timeout: 60_000 });
    await editFromHere.tap();
    await screen.getByRole("button", "Revert and keep changes").tap();
    await expect(composer).toContainText("Second question");
    await browser.keyboard.press("Enter");

    await expect(editFromHere).toHaveCount(1, { timeout: 60_000 });
    await expect(editFromHere).toBeEnabled({ timeout: 60_000 });
    await app.screenshot("after-resend");
    await expect(screen.getByText("Recovered context")).toBeVisible();
    await expect(screen.getByText("Context handoff")).toHaveCount(0);
  },
);
Scenario: fork and merge-back on one model
import { expect } from "e2e";

import { test, WEB } from "./t3.ts";

test(
  "A fork and its merge-back on one model still read as context handoffs",
  WEB,
  async ({ t3, app, screen }) => {
    const project = await t3.project("demo");
    const thread = await t3.thread({ project, title: "Earlier work", messages: ["first"] });
    await t3.open(thread);

    await expect(screen.getByText("first fixture turn complete", { exact: false })).toBeVisible();
    await screen.getByRole("button", "Fork from this response").first().tap();
    await expect(screen.getByRole("button", "Thread actions for Earlier work fork")).toBeVisible();

    const mergeBack = screen.getByRole("button", "Merge back to Earlier work");
    await expect(mergeBack).toBeVisible();
    const composer = screen.getByRole("textbox");
    await composer.fill("In the fork");
    await composer.press("Enter");
    const editFromHere = screen.getByRole("button", "Edit from here");
    await expect(editFromHere).toHaveCount(1, { timeout: 60_000 });
    await expect(editFromHere).toBeEnabled({ timeout: 60_000 });
    await app.screenshot("fork");
    await expect(screen.getByText("Context handoff")).toHaveCount(1);

    await mergeBack.tap();
    await t3.open(thread);
    await composer.fill("After the merge");
    await composer.press("Enter");
    await expect(editFromHere).toHaveCount(1, { timeout: 60_000 });
    await expect(editFromHere).toBeEnabled({ timeout: 60_000 });
    await app.screenshot("merge-back");
    await expect(screen.getByText("Context handoff")).toHaveCount(1);
  },
);

Claude Fable 5.2 in Claude Code (T3 Code).

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M labels Nov 20, 2026
@smirea
smirea force-pushed the fix/edit-resend-handoff branch from 69a0be4 to c2ef008 Compare November 20, 2026 15:43
…from a model to itself

Co-Authored-By: stefan <steven.mirea@gmail.com>
@smirea
smirea force-pushed the fix/edit-resend-handoff branch from c2ef008 to 7e3ae9c Compare November 20, 2026 15:56
@smirea

smirea commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Mobile capture for the PR body.

Mobile app on the fix: Recovered context, Multi turn

@github-actions github-actions Bot removed the size:M label Nov 20, 2026
@smirea

smirea commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Moved upstream: pingdotgg#39791

@smirea smirea closed this Nov 20, 2026
@smirea

smirea commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

Captures pinned to the audited commits (base 9cc4018, head 2125acc).

edit-before

edit-after

fork-base

fork-head

merge-base

merge-head

resume-before

resume-after

mobile-resume

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

Labels

size:XL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants