fix(acp): a steered Antigravity turn keeps the answer to the earlier prompt visible #43150
Opencostaspanay(GitHub profile, opens in a new tab)wants to merge 2 commits into
main fromrefs/pull/43150/headopened View on GitHubcostaspanay(GitHub profile, opens in a new tab) linked this to fix #41320
tanstack-source added labelsbug
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- @@ -2204,0 +2265,21 @@2265+2266+ // agy answers the prompt it is on before it reads the steer, all in the one turn.2267+ it.effect("keeps the answer written after a steer arrived mid-work visible", () =>2268+ Effect.gen(function* () {2269+ const opened = yield* openSessionWithRunningCommand(2270+ {},2271+ undefined,2272+ { agentVersion: "1.5.11", holdsFirstPrompt: true },2273+ { skipInitialReply: true },2274+ );2275+ yield* opened.startTurn(1, false);2276+ const started = yield* opened.until(2277+ (event) =>2278+ event.type === "turn_item.updated" &&2279+ event.turnItem.nativeItemRef?.nativeId === opened.command.toolCallId,2280+ );2281+ yield* opened.send(thought("Checking the CPU first."));2282+ yield* steerOf(opened)(started);2283+ yield* opened.send(reply("Yes, we're good right now."));2284+ yield* opened.send(thought("Now the steer."));2285+ yield* opened.send(reply("Proving it out means four checks."));
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
Pushed4971322
- @@ -4107 +4116,21 @@410741164117+ const markAssistantSegmentFinal = Effect.fnUntraced(function* (4118+ context: ActiveAcpTurn,4119+ segment: ActiveTextSegment,4120+ ) {4121+ if (segment.finalAnswer === true) return;4122+ segment.finalAnswer = true;4123+ yield* textEmissionPermit.withPermit(4124+ writeTextSegment(context, "assistant", segment, true),4125+ );4126+ });4127+4128+ // A prompt steer can start new tools, so the prior answer must be preserved before4129+ // the finalization pass, which only sees replies after the last new tool call.4130+ const markAnswerBeforeSteer = Effect.fnUntraced(function* (context: ActiveAcpTurn) {4131+ const answered = context.lastClosedAssistant;4132+ const latestOrdinal = context.input.providerTurnOrdinal * 100 + context.itemOrdinals.size;4133+ if (4134+ context.assistant.current === null &&4135+ answered !== null &&4136+ context.itemOrdinals.get(answered.nativeItemId) === latestOrdinal
github-actions[bot](GitHub profile, opens in a new tab) removed labelsneeds-rebase
github-actions[bot](GitHub profile, opens in a new tab) added labelsneeds-rebase
Sign in to join this conversation.
Walkthrough
The ACP adapter now marks the applicable assistant reply with the
final_answerphase when prompt steering continues a turn. Tests cover replies completed at different points around a steer and turns without steering.Changes: Steered reply phase
packages/provider-acp/src/server/adapter.tsfinal_answerand emits the updated item.apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.tsEstimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
Suggested reviewers:
juliusmarminge,t3dotggMerge Risk:
Low · up to
49713This change fixes the common case where a steer hides the earlier answer. In the less common case where an informational notice arrives between the answer and the steer, the earlier answer can still be collapsed. This is a small gap with a simple fix and does not block merge.
Pre-merge checks:
3 · 
1
#41320covers two providers: Antigravity (ACP) and Pi. The title, steps, expected behavior, and root-cause section name both. The PR changes only packages/provider-acp/src/server…Full details: Title check
Explanation
The title names the main change: a steered Antigravity turn keeps the earlier prompt's answer visible, via the ACP adapter. It follows conventional commit form and matches the changeset (adapter.ts final_answer phase handling for steers, plus tests). It is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description follows the template well. Problem, Change, Scope, and Verification are all filled in. The Problem section gives the reproduction and expected behavior. The Change section explains the adapter update and the trade-off. Scope links
#41320and says it is a bug fix. Verification lists the focused tests, the observed results, and what was not checked. The agent attribution line is present. The description does not use the template's conventional-commit title comment, but that is only a title guideline, not a required section.Full details: Out of Scope Changes check
Explanation
The PR changes two files. packages/provider-acp/src/server/adapter.ts adds steer tracking in ActiveAcpTurn, re-emits or marks the pre-steer reply as final_answer, and adds a shared helper for turn finalization. apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts adds the steer phase tests and an optional skipInitialReply setting on an existing test helper. The default helper behavior is unchanged. All of these changes support the Antigravity steer objective of
#41320. The retained short progress note is a documented trade-off of the intended steer behavior, not an unrelated change. The assessment relies on the PR summary and description. No unrelated change was identified.Full details: Linked Issues check
Explanation
Directly linked issue
#41320covers two providers: Antigravity (ACP) and Pi. The title, steps, expected behavior, and root-cause section name both. The PR changes only packages/provider-acp/src/server/adapter.ts and its Antigravity test file. The PR description states that it fixes only the Antigravity part. The Antigravity change matches the steer-related requirement: a steer marks the latest closed non-empty reply, or the next closing reply, as phase "final_answer", and turns without a steer are unchanged. The new tests cover the mid-work, streaming, and closed-reply cases. The issue also states that packages/provider-pi/src/server/adapter.ts never sets phase "final_answer" on assistant_message items. No Pi change appears in the PR summary, so the Pi requirement stays unmet. This result does not depend on the unread adapter source.Resolution
Set phase "final_answer" for the pre-steer answer in Pi steered runs in packages/provider-pi/src/server/adapter.ts, using the existing message_end data where appropriate. Add automated tests for that Pi path. Alternatively, with maintainer agreement, narrow
#41320to the Antigravity case in the linked issue and track Pi in a separate issue, so the linked scope matches this PR.Finishing Touches
Generate unit tests (beta)