Repository navigation
Done
Description
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
- Open an existing thread backed by an ACP provider (observed with Antigravity ACP
1.5.20, though this affects any ACP provider usingAcpAdapterV2). - Put the thread in a state where the server still treats it as loaded (so the next user message enters
AcpAdapterV2.startTurninstead ofresumeThread), while the underlying ACP runtime needs to reactivate the native session viaactivateSession(session/load/session/resume)—for example, after an ACP runtime restart/teardown. - Cause
activateSession(session/load) to fail at the transport layer (AcpTransportError) rather than returning a JSON-RPC error (AcpRequestError).- In real usage, this happened on a long-running iOS thread whose native history contained 16–26.7 MiB
xcodebuildstep outputs; duringsession/load,antigravityAuthSupport.splitStdoutLinesrejected the oversized line withAcpTransportError(covered separately by fix(antigravity): stream large stdout protocol lines instead of failing at 16 MiB #42150). Any ACP child-process crash or transport disconnect duringactivateSessionhits the same path.
- In real usage, this happened on a long-running iOS thread whose native history contained 16–26.7 MiB
- Send a follow-up message (Turn N), then send another message right after it fails (Turn N+1).
Expected behavior
Because activateSession (session/load / session/resume) failed before any session/prompt was sent, ProviderTurnStartService should treat the failure identically to a failed resumeThread and immediately invoke recoverLostNativeSession to start a fresh native session with context handoff on Turn N—instead of surfacing a ProviderAdapterTurnStartError to the user.
Actual behavior
- Turn N (
startTurnpath): Fails immediately and surfacesProvider errorto the user without triggering automatic recovery.packages/provider-acp/src/server/adapter.ts(startTurn, around line 10828 onmain @ 32158b76a3) wraps theactivateSession(...)failure inProviderAdapterTurnStartErrorwhosecauseisAcpTransportError(which does not carry a JSON-RPCmethod: "session/load"field).apps/server/src/orchestration-v2/ProviderTurnStartService.ts(lines 288–290 onmain @ 32158b76a3) definesnativeSessionLoadFailedas:const nativeSessionLoadFailed = (error: unknown): boolean => (isAcpRequestError(error) && NATIVE_SESSION_LOAD_METHODS.has(error.method)) || (Predicate.hasProperty(error, "cause") && nativeSessionLoadFailed(error.cause));
- Because
error.causeisAcpTransportErrorrather thanAcpRequestError,nativeSessionLoadFailed(error)returnsfalseandrecoverLostNativeSession(lines 2618–2639) is skipped.
- Turn N+1 (
resumeThreadpath): The very next user message entersAcpAdapterV2.resumeThread, hits the exact sameAcpTransportErrorduringsession/load, and does automatically triggerRecovering provider context in a fresh native session, succeeding cleanly.
Impact
Minor bug or occasional failure
Version or commit
main @ 32158b7
Environment
macOS 26.6.2 (Apple Silicon), T3 Code Desktop/Server, Antigravity CLI 1.5.20 (ACP, Gemini 4 Neon)
Logs or stack traces
# Turn N (11:07:42Z – 11:07:49Z): startTurn path -> fails without auto-recovery
[11:07:49Z] antigravityAuthSupport.splitStdoutLines (Failure)
AcpTransportError: ACP transport operation failed: Antigravity sent a protocol line that is too large.
[11:07:48Z] session/load (Failure)
~effect/rpc/RpcClientError: RpcClientDefect: ACP protocol terminated.
[11:07:42Z] AcpAdapterV2.startTurn (Failure, durationMs=6629.27)
ProviderAdapterTurnStartError: Failed to start run run:thread:<thread-id>:ordinal:118 on antigravity provider thread <provider-thread-id>.
[11:07:49Z] RunExecutionService.startRootRun (ERROR)
"orchestration V2 provider turn start failed"
{
"runId": "run:thread:<thread-id>:ordinal:118",
"cause": {
"_tag": "Fail",
"error": {
"_tag": "ProviderAdapterTurnStartError",
"driver": "antigravity",
"threadId": "<thread-id>",
"providerThreadId": "<provider-thread-id>",
"runId": "run:thread:<thread-id>:ordinal:118",
"cause": {
"_tag": "AcpTransportError",
"detail": "Antigravity sent a protocol line that is too large."
}
}
}
}
# Turn N+1 (11:09:42Z – 11:09:46Z): resumeThread path -> exact same error, auto-recovers
[11:09:46Z] antigravityAuthSupport.splitStdoutLines (Failure)
AcpTransportError: ACP transport operation failed: Antigravity sent a protocol line that is too large.
[11:09:45Z] session/load (Failure)
~effect/rpc/RpcClientError: RpcClientDefect: ACP protocol terminated.
[11:09:42Z] AcpAdapterV2.resumeThread (Failure, durationMs=3348.06)
ProviderAdapterResumeThreadError: Failed to resume antigravity provider thread <provider-thread-id>.
[cause]: AcpTransportError: ACP transport operation failed: Antigravity sent a protocol line that is too large.
[11:09:42Z] orchestrationV2.providerTurnStart.start (WARN)
"Recovering provider context in a fresh native session"
{
"driver": "antigravity",
"providerThreadId": "<provider-thread-id>",
"runId": "run:thread:<thread-id>:ordinal:119"
}Workaround
Sending another message on the same thread forces the next turn onto the resumeThread path, which catches the transport failure and triggers fresh-session recovery.
Metadata
Metadata
Assignees
Labels
No labels
Activity