Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): time out silent Antigravity prompts #30377

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/30377/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

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

Problem

Refs https://github.com/pingdotgg/t3code/issues/30271. An Antigravity ACP process can leave session/prompt pending after its last output, keeping the thread working indefinitely while the process remains alive.

Change

Antigravity opts into a 15-minute prompt inactivity deadline in the shared ACP adapter. Prompt output and answered agent requests reset the deadline. Open requests, tools and subagents pause it. Metadata and updates for unrelated sessions do not extend it.

Expiry fails the turn through the existing terminal path and tears down the stalled process. The next message starts a replacement runtime. Each runtime owns its unanswered-request records so an abandoned approval cannot disable the replacement's deadline. Other ACP providers keep their current behavior.

Scope and approval

This is a focused reliability fix for an indefinitely pending prompt, confined to the adapter and its existing failure/restart path. The 15-minute Antigravity default is proposed here and needs human review. The issue establishes the failure; it does not establish an approved timeout value.

An agent stuck with a tool or subagent still marked active can continue waiting indefinitely. The separately reported process-exit/run-running split did not reproduce on current main, so this PR does not claim to fix it.

Verification

Tested head 6810ff45e51a37cb412b83b8fa11304cd9fba6ba, based on 0b5600b1c3df49f705ba245df5aa50c59dc91490.

  • Two watchdog cases fail before the implementation. The review regressions also fail before their repairs. Four focused ACP suites passed 165 tests after the repairs at pre-rebase commit 47e5edcb265ab27d215d4b35bb3e8b562e3028ba. The reviewed adapter and test blobs are identical at the final head.
  • TestClock and the actual mock-agent subprocess cover matching output resetting the deadline, unrelated output and metadata not resetting it, tools and approvals holding it, and an abandoned approval followed by process exit and a silent replacement.
  • vp run check:changed passed on the final head on Boat job j_24vfq372yeo5ilf7tmxp, exit 0: format, lint, knip, generated GraphQL, typecheck of 14 affected packages, and 107 tests in three files. No worker patch was produced.
  • Full 15-minute wall-clock run in web and official Linux desktop: the pending turn failed, the silent process exited, and a message submitted from desktop completed on a new process. Both clients showed the error and recovery.

The runtime fixture uses the real Antigravity adapter with a synthetic ACP peer. No paid provider or account login was used. Web uses the development client. Linux desktop uses the official 0.1.6 x86_64 client, release commit 2359643cffa6ba9ee84d6f2694b935de54a8013e, connected to the patched server on corex through loopback, with isolated application data and a private X11 display.

Not shown: the proprietary Antigravity hang itself, the reporter's original persisted event sequence, Wayland compositor behavior, or mobile UI. The server change uses the existing failed-turn protocol and makes no client or contract changes.

Before-fix test output

On main 15707a84b03e27bb257d60e027812ebf94bbda25, with the regression tests and mock-agent helper only:

vp test run apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts -t "inactivity timeout|silent past the inactivity|agent process exits"
ProviderAdapterProtocolError: reason: previous_turn_active
Test Files  1 failed (1)
Tests  2 failed | 2 passed | 88 skipped (92)

The two failures are the silent-prompt deadline and post-tool deadline. Approval safety and process-exit handling already passed on main. The final-head changed-file check passed all 92 adapter cases.

Final-head runtime and changed-file check transcript
Head: 6810ff45e51a37cb412b83b8fa11304cd9fba6ba
Environment: corex, isolated dev state, actual Antigravity adapter / synthetic ACP peer
2026-11-03T20:45:07.191Z session/prompt dispatched, PID 1219879
2026-11-03T20:45:07.691Z last meaningful update, then peer silent and alive
2026-11-03T21:00:07.695Z provider turn failed with inactivity error
2026-11-03T21:00:08.188Z orchestration run failed; PID 1219879 gone
2026-11-03T21:01:27.851Z recovery message submitted from Linux desktop
2026-11-03T21:01:45.130Z replacement PID 1281743 initialized
2026-11-03T21:01:45.173Z replacement session/prompt dispatched
2026-11-03T21:01:45.310Z recovery completed
Thread: completed, activeRunId null, runCount 2
Output: Recovery prompt completed successfully.

Boat j_24vfq372yeo5ilf7tmxp, exit 0, final head:
check:changed summary
  pass format
  pass lint
  pass knip 1/2
  pass knip 2/2
  pass graphql (apps/server)
  pass typecheck (14 packages)
  pass test (3 files): 107 passed

The runtime proof remains at the exact head above. Verification against later main changes is recorded below.

Linux desktop just before expiry, still Working after 14m54s:

Linux desktop before the inactivity deadline

Linux desktop crossing the deadline. This is a continuous 35-second excerpt from the full 15-minute run:

https://github.com/user-attachments/assets/0597226a-450d-487e-9b03-aa191031e171

Recovery entered in Linux desktop and observed in the web client, a later continuous 35-second excerpt from the same run:

https://github.com/user-attachments/assets/ee63ad2f-de84-4ec8-8c96-c428a369107b

Linux desktop after the recovery message completed:

Linux desktop successful recovery

Packaged Linux desktop baseline

The evidence review requested a matching desktop run on unpatched main. This run uses main a10490937dbd8a9e441b0518a77a60117f3ecf5a, with no source changes, and the same official Linux desktop 0.1.6 client and synthetic silent ACP prompt scenario as the patched run above. The peer sends one agent_message_chunk containing "Synthetic ACP fixture started. The agent will now stop sending updates.", remains alive, and never answers session/prompt. No tool, subagent or approval is open. No paid provider or account login was used.

The video captures the successful prompt submission through Working beyond 16 minutes. The still shows Working for 16m29s. Before cleanup, the server still reported status: running, one run, a non-null activeRunId, and zero pending requests; the synthetic agent process was still alive.

Unpatched server: a10490937dbd8a9e441b0518a77a60117f3ecf5a
Packaged client: Linux desktop 0.1.6, release 2359643cffa6ba9ee84d6f2694b935de54a8013e
Environment: corex, isolated worktree state and private X11 desktop
2026-11-03T21:36:38.095Z session/prompt sent to PID 1373342
2026-11-03T21:36:38.596Z single text update, then no further output
2026-11-03T21:52:54.024Z thread still running; activeRunId present; process alive
2026-11-03T21:53:07Z desktop still Working for 16m29s
Fixture SHA-256: 40bd18ceb546d614a505cb1a51aec72a9d4316f4111fbf3652aba65345d9b737

The PR head remains 6810ff45e51a37cb412b83b8fa11304cd9fba6ba; the after recordings and tests above cover that head. This adds the previously missing desktop baseline. The proprietary Antigravity hang, reporter's persisted event sequence, mobile and Wayland remain unverified.

Continuous recording of the prompt submission and the Working state beyond 15 minutes. The visible elapsed timer advances in real time; the video is captured at 2 frames per second:

https://github.com/user-attachments/assets/78d727b7-1502-4009-8cfc-2687ee4c8b1b

Linux desktop beyond 15 minutes of silence:

Unpatched main Linux desktop still Working beyond 15 minutes

Verification after main moved

The published head is still 6810ff45e51a37cb412b83b8fa11304cd9fba6ba. Main advanced from the last checked base a10490937dbd8a9e441b0518a77a60117f3ecf5a to 8b44f42b14c8e273156474a924ccf29680dd7857. The merge is conflict-free. Verification uses unpublished merge commit e94c366c34126fb090cf0c242628796cd22bc107, with those exact head and new-base parents and tree 436fc5c2e9f440dd2651a2a85e1072d7babdaabc. Its difference from new main is the same four-file watchdog patch, with 430 insertions and 5 deletions.

A fresh independent GPT-6.1 Sol review found no findings in the changed ACP runtime scope, approval handling, MCP output, EOF protocol handling, Antigravity outcome parsing, or the affected failure and recovery projection/client paths. The replacement event consumer now uses its replacement scope; the watchdog's runtime-owned request records and callback-generation checks remain intact. Upstream client layout changes do not change the failure event or the ordinary message recovery path. The review supports retaining the exact-head client recordings above once the combined-tree checks pass. Those recordings are observations of their named builds, not recordings of this merge.

Boat job j_pt4dz47cagpjeve2gu3q finished with exit 0 on 2026-11-04 at 07:25:57 UTC. No worker patch was produced. The job ran vp i, vp run check:changed "$FLEET_SOURCE_BASE", and vp test run packages/effect-acp/src/protocol.test.ts apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts on the exact combined commit above. $FLEET_SOURCE_BASE was the pinned new-main commit.

Combined-tree check and test output
Head: 6810ff45e51a37cb412b83b8fa11304cd9fba6ba
Base: 8b44f42b14c8e273156474a924ccf29680dd7857
Tested merge: e94c366c34126fb090cf0c242628796cd22bc107
Tested tree: 436fc5c2e9f440dd2651a2a85e1072d7babdaabc
Environment: Boat Linux large, t3code template, 8 CPUs
Boat job: j_pt4dz47cagpjeve2gu3q, succeeded, exit 0, no patch

check:changed summary
  pass format
  pass lint
  pass knip 1/2
  pass knip 2/2
  pass graphql (apps/server)
  pass typecheck (14 packages)
  pass test (3 files)
  Tests 109 passed

AcpAdapterV2.test.ts: 94 passed, including
  fails a prompt its agent leaves silent past the inactivity timeout
  holds the inactivity timeout while a tool runs and restarts it when the tool ends
  holds the inactivity timeout while the agent waits on an approval
  fails a running prompt once when its agent process exits
  replaces the ACP session and clears conversation state on rollback
  quarantines callbacks from a failed rollback replacement before retrying
  answers Always allow with allow-once when the agent offers no allow-always option
AntigravityAdapterV2.test.ts: 14 passed
AgentContextBudget.test.ts: 1 passed

Focused upstream-boundary suites
  packages/effect-acp/src/protocol.test.ts: 23 passed
  apps/server/src/provider/acp/AntigravityTurnOutcome.test.ts: 2 passed
  Test Files 2 passed
  Tests 25 passed

The initial archive-check attempts did not pass: one lacked installed dependencies, and the next lacked a remote main reference. The final run explicitly installs dependencies and supplies Boat's pinned source base to check:changed.

The same unverified limits listed above remain. This was an interaction review and focused verification of the merge, not an audit of every unrelated change on main.

Implemented by Claude Opus 5.5 in Claude Code. Investigated, tested and independently reviewed in two rounds by GPT-6.1 Sol in Codex.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Approvability

      Verdict: Needs Human Approval

      Macroscope's review found this PR requires human approval — Antigravity prompts now time out after 15 minutes without qualifying activity, with pauses for open requests, tools, and subagents. Human review is needed to confirm this new default and its turn-failure behavior.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded21.6 KiB21.6 KiB0 B (0.0%)24.4 KiB✅
      CodexLive turn messages220 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: a104909 · PR result: 6810ff4 · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →
      Walkthrough

      The ACP adapter now supports a configurable prompt inactivity timeout. It tracks eligible session updates and outstanding work, pauses the timeout while requests, tools, approvals, or subagents remain active, and retires an idle runtime after the deadline. Antigravity configures 15 minutes; tests cover timeout behavior and runtime replacement.

      Changes: ACP prompt inactivity handling

      Layer / File(s)Summary
      Track prompt progress and runtime requests
      packages/provider-acp/src/server/adapter.ts
      The adapter adds timeout and incoming-request settings. It tracks eligible session updates and maintains outstanding request IDs for each runtime generation.
      Enforce the inactivity timeout
      packages/provider-acp/src/server/adapter.ts
      The watchdog pauses while requests, tools, or subagents remain active. When an idle turn reaches its deadline, the adapter retires the runtime, cancels pending requests, and finalizes the turn with a provider error. Turn finalization interrupts the watchdog.
      Configure and test the timeout
      apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts, apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts, apps/server/scripts/acp-mock-agent.ts
      Antigravity sets a 15-minute timeout. Tests cover progress filtering, running tools, pending approvals, process exit, and replacement runtimes. The mock agent can emit session updates.

      Estimated code review effort: 3 (Moderate) | ~25 minutes

      Change: Bug fix

      Sequence Diagram(s)

      sequenceDiagram
        participant ACP runtime
        participant AcpAdapterV2
        participant Inactivity watchdog
        participant Turn
        AcpAdapterV2->>Inactivity watchdog: Start after prompt dispatch
        ACP runtime->>AcpAdapterV2: Send session update
        AcpAdapterV2->>Inactivity watchdog: Record eligible progress
        Inactivity watchdog->>AcpAdapterV2: Signal elapsed deadline with no active work
        AcpAdapterV2->>ACP runtime: Quarantine transport and close runtime scope
        AcpAdapterV2->>Turn: Finalize with provider error

      Possibly related issues

      • pingdotgg/t3code#30271 — Adds an inactivity failure path for the reported case where Antigravity stops sending updates and the prompt remains active.
      • pingdotgg/t3code#28172 — Adds a timeout for silent Antigravity prompts, though it does not address the reported stream and reasoning behavior.
      • pingdotgg/t3code#28898 — Changes timeout handling for prompts with background work, but does not restore background wakeups.
      • pingdotgg/t3code#30082 — Changes timeout pause rules for active background or subagent work, but does not restore parent-turn wakeups.
      • pingdotgg/t3code#19689 — Adds runtime teardown and replacement after inactivity, but does not address the reported interrupt and run-state behavior.
      • pingdotgg/t3code#28415 — Changes timeout behavior around active background work, but does not expose tasks or deliver wakeups.

      Suggested labels: bugfix

      Suggested reviewers: juliusmarminge

      Merge Risk: Low · up to 6810f

      Legitimate work that produces no updates could be stopped after 15 minutes. Confirm that this timeout trade-off is acceptable before merging.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title "fix(acp): time out silent Antigravity prompts" matches the main change. The PR adds a 15-minute prompt inactivity deadline for Antigravity in the shared ACP adapter. On expiry, the turn fai…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Description checkPassedThe description is complete and follows the required structure. It explains the problem, change, scope, proposed timeout, limitations, focused verification, test results, runtime evidence, and impleme…
      Full details: Title check

      Explanation

      The title "fix(acp): time out silent Antigravity prompts" matches the main change. The PR adds a 15-minute prompt inactivity deadline for Antigravity in the shared ACP adapter. On expiry, the turn fails and the stalled process is torn down. The title is concise, follows the conventional commit format from the template, and names the scope (acp) and the provider.

      Full details: Description check

      Explanation

      The description is complete and follows the required structure. It explains the problem, change, scope, proposed timeout, limitations, focused verification, test results, runtime evidence, and implementation details. The linked issue and focused-fix rationale provide scope context, while the description clearly identifies the 15-minute timeout as requiring human review.

      Finishing Touches
      Generate docstrings
      • Commit to this branch
      • Create a new PR
      Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
    5. Additional comments: 1
      packages/provider-acp/src/server/adapter.ts: 1

      7793-7808: Trivial · Stability & Availability · Heavy lift

      **Unverified finding** Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

      Consider a recoverable path before the elapsed-time teardown.

      When the deadline passes with no open tool, request or subagent, this code does four things:

      • It marks the turn failed.
      • It advances the runtime generation.
      • It sets runtimeRestartRequired.
      • It closes runtimeScope, which kills the agent process.

      Elapsed time alone cannot tell a silent hang from valid work. An agent can reason for more than 15 minutes without a tool_call. It can also wait on an upstream call that emits no update. The process is killed and in-flight work is lost.

      The user can send a message to resume, so the damage is recoverable. This is still a destructive status change based only on elapsed time.

      Prefer one of these alternatives:

      • Report an explicit "stalled, status unknown" state. Give the user a one-click action to stop the agent or keep waiting.
      • Use a liveness signal from the agent. For example, check that the process is alive and active, or use an ACP keepalive. Tear down only when that signal also fails.

      If the team keeps the current behavior, note in the code that this teardown is a deliberate trade-off. The PR description already says the 15-minute value needs human review.

      Based on learnings: "Flag TypeScript/JavaScript background/monitoring processes marking async tasks failed, cancelled, or abandoned solely from elapsed time or perceived staleness".

      Source: Learnings

      Review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between a10490937dbd8a9e441b0518a77a60117f3ecf5a and 6810ff45e51a37cb412b83b8fa11304cd9fba6ba.

      Files selected for processing: 4
      • apps/server/scripts/acp-mock-agent.ts
      • apps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.ts
      • apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.ts
      • packages/provider-acp/src/server/adapter.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

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

      Checked CodeRabbit's elapsed-time teardown concern against the adapter and the runtime fixture. This is an intentional timeout policy, with a real risk of stopping legitimate silent generation. The PR proposes the 15-minute default for human review and already records that tradeoff.

      Process existence alone would not distinguish the reported hang: the synthetic peer stayed alive throughout the full deadline. This patch has no reliable agent keepalive to consult. It pauses for unanswered requests, tools and subagents, then uses the existing failure and replacement path when generation alone stays silent. The recorded next message completed on a replacement process.

      Keeping the current scope. A new stalled state and client decision flow would be a different design requiring contract and client changes. No code change for this advisory finding; the timeout tradeoff remains explicit for the merge review.

    7. juliusmarminge added labelsbugfix

    8. juliusmarminge added labelspr:needs-julius

Sign in to join this conversation.