Skip to content

[Bug]: Antigravity mid-turn steer resets prompt outcome startIndex and skips transient 404 auto-recovery #46272

Done

Description

@imetn

Before submitting

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

Area

apps/server

Steps to reproduce

  1. Start an Antigravity turn on a valid model (e.g. gemini-4-neon) and let the model answer and run at least one tool call (so CORTEX_STEP_TYPE_PLANNER_RESPONSE, step_type = 15, has already been written to the native session SQLite log).
  2. While the turn is still running, send a mid-turn steer message (steerWithPrompt in packages/provider-acp/src/server/adapter.ts).
  3. Have the very first model request after the steer hit a transient Google edge NOT_FOUND (code 404): Requested entity was not found. error before any new step_type = 15 planner response is recorded after the steer.

Expected behavior

Per #39869, since the model has already answered in this turn, the transient 404 NOT_FOUND should be classified as transientNotFound = true (retryable: true, resumeWith: "continue") and automatically resumed once.

Actual behavior

steerWithPrompt calls flavor.watchPromptOutcome(context.nativeThreadId) again (packages/provider-acp/src/server/adapter.ts:11288-11291), which snapshots a new startIndex at the end of the pre-steer steps. When AntigravityTurnOutcome runs lastStepAfter(startIndex) (apps/server/src/provider/acp/AntigravityTurnOutcome.ts:133-136), it only checks SELECT 1 FROM steps WHERE idx > ? AND step_type = 15 LIMIT 1. Because the first post-steer request failed before producing a new planner response, reachedModel evaluates to false, misclassifying the transient edge 404 as an unknown/unentitled model (retryable: false) and failing the turn immediately without sending "continue".

Observed in a live native Antigravity session log:

  • Earlier steps in the same turn already contained multiple step_type = 15 planner responses and tool executions up to idx = 1700.
  • A mid-turn steer appended the user input step at idx = 1701, advancing startIndex to 1700.
  • The first model call after the steer failed with NOT_FOUND (code 404): Requested entity was not found. at idx = 1703.
  • Because no step_type = 15 existed with idx > 1700, transientNotFound was false and automatic recovery was skipped.

(Note: a similar miss can also occur on the first model call of a follow-up turn in an existing session on the same unchanged model, though preserving the turn/session model-reachability baseline across mid-turn steers is the direct regression of #39869's reachedModel assumption.)

Impact

Major degradation or frequent failure

Version or commit

main @ d191449

Environment

macOS, Node.js, Antigravity ACP provider (gemini-4-neon)

Logs or stack traces

Native Antigravity trajectory (sanitized):
  ... prior planner responses (step_type=15) & tool calls in the same turn ...
  idx=1700  tool execution
  idx=1701  mid-turn steer user input (steerWithPrompt reset startIndex to 1700)
  idx=1703  ERROR_STEP_TYPE (17): NOT_FOUND (code 404): Requested entity was not found.

AntigravityTurnOutcome.lastStepAfter(1700):
  reachedModel = false (no step_type=15 with idx > 1700)
  -> transientNotFound = false -> retryable = false -> Provider error (no auto-resume)

Workaround

Manually send a follow-up continue message to resume the failed turn.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions