Skip to content

fix(acp): support native mid-turn steering in Antigravity CLI and Devin - #1438

Open
Adam-Dalloul wants to merge 1 commit into
spacering-net:mainfrom
Adam-Dalloul:feat/native-steering-antigravity-devin
Open

Adam-Dalloul wants to merge 1 commit into
spacering-net:mainfrom
Adam-Dalloul:feat/native-steering-antigravity-devin

Conversation

@Adam-Dalloul

Copy link
Copy Markdown
Contributor

Support native mid-turn steering for Antigravity CLI (agy acp >= 1.5.0) and Devin (cognition.ai/midTurnPrompts), continuing and rebasing #1287 onto v0.52.0 (main) and resolving the open review item from #1287.

Background

Google added concurrent mid-turn prompt support to agy acp in 1.5.0 (bundled in v0.52.0 at 1.5.25), and Devin advertises cognition.ai/midTurnPrompts. Neither uses the _session/steering extension; both accept another standard ACP session/prompt while a turn is running.

#1287 (by @moncha3, with review polish commit ba49dd87c by @xintaofei) implemented this approach cleanly, had one remaining open blocker (provisional custom-transcript steers for custom agy acp registrations), and accumulated merge conflicts after v0.52.0 changes to connection.rs, session_state.rs, parsers/antigravity.rs, and the new personal_agent / work_task guidance callers.

What this PR includes

  1. Rebase of fix(acp): support native steering in Devin and Antigravity CLI #1287 onto main (v0.52.0), preserving all behavior from a6abfb911..ba49dd87c:

    • Replace SessionState.native_steering_available: bool with native_steering: Option<NativeSteering> (SessionSteering vs MidTurnPrompt(Devin | AntigravityCli)), keeping native_steering_available: bool on the serialized snapshot.
    • Add src-tauri/src/acp/mid_turn_prompts.rs to coordinate concurrent session/prompt RPCs, wait for Devin's cognition.ai/clientMessageId echo, optimistically emit FeedbackStatus::Sent for Antigravity CLI and settle on FeedbackConsumed / FeedbackFailed, retry Antigravity follow-ups refused while a prior cancel unwinds, and drain in-flight mid-turn receipts after Stop.
    • Keep v0.52.0's Kimi Code busy-turn resend, CancelTurn / StopWork handling, expect_turns_completed stale-steer guard, PromptReceipt settlement, and Antigravity background wake / parent_task parsing alongside fix(acp): support native steering in Devin and Antigravity CLI #1287's user_input.media inline-image reload.
    • Update FeedbackNotesDisplay, useSessionFeedback, AcpConnectionsProvider, and ConversationTabView for sent / failed note settlement and retry with original attachment blocks.
  2. Resolution of the fix(acp): support native steering in Devin and Antigravity CLI #1287 review blocker (custom agy acp transcript settlement):

    • Add EntryKind::SteerRejected and optional TranscriptEntry.steer_id ("sid", omitted on ordinary prompts and confirmed steers) in src-tauri/src/acp_transcript.rs.
    • For MidTurnAdapter::AntigravityCli, Submission::publish records custom-agent steers provisionally via record_provisional_steer (no-op for built-in AgentType::Antigravity and any agent with its own store) so accepted steers stay in their exact chronological position ahead of the reply frames they trigger.
    • On RPC error in either MidTurnPrompts::settle or MidTurnPrompts::drain_cancelled, record_steer_rejected appends a boundary tombstone ({"id": "<steer_id>"}). parse_transcript drops both the tombstone and its matching provisional prompt on read (with zero extra allocations when no tombstone is present), so a rejected steer never leaves a phantom user turn or splits the reloaded reply.
    • Also return early on Receipt::Submitted errors even when note_id is absent so a rejected concurrent prompt cannot overwrite last_response.
  3. Safe alignment with v0.52.0 automated guidance callers (personal_agent and work_task):

    • Add NativeSteering::confirms_on_send(self) -> bool (true for SessionSteering and MidTurnAdapter::Devin, false for MidTurnAdapter::AntigravityCli).
    • personal_agent/engine.rs, personal_agent/guide.rs, and work_task/engine/guide.rs require synchronous confirmation before marking a message delivered and have no deferred FeedbackFailed retry strip, so they gate on confirms_on_send() (letting Claude Code, Codex, and Devin steer natively while keeping Antigravity CLI on the existing next-turn path instead of misclassifying FeedbackStatus::Sent or double-sending). Interactive conversation steering uses native_steering.is_some() and works natively for Antigravity CLI and Devin.

Verification

  • Frontend: pnpm eslint on all touched files (0 warnings/errors), pnpm prettier --check (clean), pnpm browser:agent:check (up to date), scoped tsc --noEmit across all 7 modified frontend files (0 errors), and pnpm vitest run (311/311 passed across feedback-notes-display.test.tsx, use-session-feedback.test.ts, and acp-connections-context.test.tsx).
  • Rust: cargo clippy --no-default-features --features server-bin --bin codeg-server --lib -- -D warnings (0 warnings) and 321/321 targeted unit tests passing across acp_transcript, acp::mid_turn_prompts, acp::feedback, acp::manager, acp::connection, parsers::antigravity, parsers::acp_native, personal_agent, and work_task (including new tests rejected_provisional_steer_is_dropped_while_accepted_steer_stays_in_order, custom_antigravity_retracts_rejected_steer_from_transcript_and_keeps_accepted_one, and confirms_on_send_distinguishes_early_receipt_from_deferred_settlement).

Credits: built directly on #1287 by @moncha3 and @xintaofei's review commit ba49dd87c.

Rebase spacering-net#1287 onto v0.52.0 (main), resolve custom-agent provisional steer retraction in acp_transcript, and gate automated personal-agent and work-task callers on immediate steer confirmation.

Co-authored-by: moncha3 <83458082+moncha3@users.noreply.github.com>
Co-authored-by: xintaofei <xintaofei@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant