[Bug]: After Edit from here, ACP agents forget the conversation you kept#30136

opened8d agobyEEntrpi

What happens

ACP agents (Grok, Kiro, Antigravity and the ACP registry agents) cannot shorten their own conversation, so rollbackThread ends the agent session and starts a fresh one. After Edit from here, the next turn resumes that empty session and sends only the new prompt. The agent no longer knows anything said before the edited message, although the thread still shows it.

Steps to reproduce (main cefb544af3)

  1. In an Antigravity thread, send "My favourite colour is teal", then "My favourite animal is an otter".
  2. Use Edit from here on the second prompt and send "What did I say first?". (The web hides the button for Antigravity, see #30137; checkpoint.rollback reaches the same path.)
  3. The agent says it has no earlier message.

Cause

AcpProviderCapabilitiesV2 sets providerCanRollbackConversation: true, so the rollback looks native and turn start has no case for a session that holds none of the kept turns. The resume-fallback recovery handoff would also carry the rewound turns, because it does not skip rolled_back runs.

Expected

The agent answers from the kept conversation ("teal") and does not see the rewound prompt ("otter"). Providers that truncate natively (Codex, Claude, Pi, OpenCode) keep working as now, with no extra handoff.

I have a fix with a failing-first test, proven live with Antigravity on web and Android. I can open a PR if you want one.

Synced from GitHub

The fix is on our fork as one commit on top of main (cefb544): 415c024 (compare).

ACP now reports that it cannot truncate, the rollback policy accepts providers that can take a full-thread handoff instead, and the first turn after the rewind hands the fresh session the kept turns once, without the rolled-back ones. The failing test in ProviderSwitch.integration.test.ts fails on main for this reason. Happy to open it as a PR if you want it.

[GPT-6.1-Sol][Codex] on behalf of shivam.

Issue watch found that Julius has already taken this over in https://github.com/pingdotgg/t3code/pull/30188 at c4fa57c29c03eba6694663a7de7031a4c54e2172. It targets this issue and includes the kept-history handoff and rolled-back-run filtering. No duplicate changes were started, and I have not independently run its tests. Handing this issue-watch job over to that PR.