fix(provider): show exit details when ACP session startup crashes#28419

merged1
main
issue-watch/28401
opened11d agobySshivam
View on GitHubTwo-way sync enabledPR last imported 10d ago

Problem

An ACP process crash during session startup showed a generic error and an internal session identifier, even when the server knew the termination signal.

Closes https://github.com/pingdotgg/t3code/issues/28401

Change

The existing error formatter now shows the session-open stage and structured signal or exit code, with guidance to check the server logs. It keeps stderr and nested provider output out of the message.

Scope and approval

This changes shared ACP failure diagnostics. It does not fix the upstream runtime crash or change saved authentication state. No provider execution, UI, or wire-contract changes.

Verification

Evidence

Recorded on physical corex Linux in the v0.1.6 Electron desktop shell, using server sources from the commits below and an isolated T3 home. The desktop renderer was captured directly through its own debug endpoint, so other agents' foreground windows are excluded. These recordings replace the earlier stand-in-process evidence.

Both runs use Google's unmodified managed Antigravity ACP runtime 1.4.1, resolved by the real installer as source: managed. Its archive SHA-256 is 2e37012ceb2a5c7fc7309b6e6596234fb637ee3c62a5199f65d4cbe777871384. A temporary launch hook records the spawned PID, waits for the ACP initialize write, checks /proc/<pid>/exe is the managed agy_acp_server.par, and sends that process SIGILL after 400 ms. It does not replace the runtime or inject an error into the formatter.

Before, main 575579d68ac4bae09f8426a345d4a3eac1e90c67: the initial failure remains visible in history, then the recording shows a follow-up retry ending with the same generic error and internal session identifier.

https://github.com/user-attachments/assets/47d6f032-866d-4823-ab84-28f0605d3ad7

After, head 3f3e50b35526ae98692567d0c23ba23cc64cc1d6: a new startup attempt and another follow-up retry both show the session-open stage, SIGILL, and server-log guidance. Earlier failed turns remain in the history with their original generic messages.

https://github.com/user-attachments/assets/0dfc9990-6b14-44ad-9f3d-4fad81a54b53

Runtime transcript
text
1Installer validation: phase=succeeded, version=1.4.1
2resolve: source=managed, executable=.../versions/2e37012.../agy_acp_server.par
3
4Baseline retry, run ordinal 2:
500:21:59.715Z initialize-written pid=4123712
600:22:00.116Z /proc/4123712/exe=.../agy_acp_server.par; SIGILL delivered=true
700:22:00.130Z exit pid=4123712 code=null signal=SIGILL
8Result: Failed to open antigravity provider session provider-session:...
9
10Head startup, run ordinal 3:
1100:23:49.778Z initialize-written pid=4134634
1200:23:50.178Z /proc/4134634/exe=.../agy_acp_server.par; SIGILL delivered=true
1300:23:50.191Z exit pid=4134634 code=null signal=SIGILL
14
15Head retry, run ordinal 4:
1600:24:06.737Z initialize-written pid=4135647
1700:24:07.137Z /proc/4135647/exe=.../agy_acp_server.par; SIGILL delivered=true
1800:24:07.151Z exit pid=4135647 code=null signal=SIGILL
19Both head results:
20The provider session could not be opened: the provider process exited after signal SIGILL. Check the server logs for the provider's output, then retry the turn.

The retry messages were sent through t3 thread send <thread> <message> --base-dir <isolated-home> --wait --json. The server also makes its normal automatic startup attempts, each terminated during initialization. The CLI exits nonzero because the deliberately crashed provider fails; the desktop displays the same persisted error.

Validation for head 3f3e50b35526ae98692567d0c23ba23cc64cc1d6:

  • The regression failed on main, then passed with the fix: vp test run packages/provider-core/src/server/failure.test.ts, 12 tests passed.
  • Related provider and orchestration suites: 284 tests passed across 7 files.
  • vp run check:changed passed format, lint, both knip checks, typechecks for 25 packages, and 13 tests across 2 files.
  • An independent GPT-6.1-Sol code review found no findings. A fresh evidence review verified these managed-runtime recordings and resolved R1 with no new findings.
  • Required CI checks pass on this head: https://github.com/pingdotgg/t3code/pull/28419/checks

Unverified: the reporter's CPU-topology-specific cause of SIGILL, a successful authenticated Antigravity turn, mobile rendering, and clicking the desktop retry controls. These recordings verify the actual managed-runtime startup crash and follow-up-message retry, not the cause or repair of that crash. Exit-code and unsafe-status variants are covered by focused tests.

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

Checks

25 successful · 13 skipped
All checks passed
3f3e50b

Added 1 commit

  • fix(provider-core): name the signal or exit code when a provider process dies during startup3f3e50b

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

Verification for head 3f3e50b35526ae98692567d0c23ba23cc64cc1d6, base 575579d68ac4bae09f8426a345d4a3eac1e90c67, on physical corex Linux:

  • Regression first: vp test run packages/provider-core/src/server/failure.test.ts failed before the fix with expected undefined to equal 'The provider session could not be ope…'. With the fix, all 12 tests pass. Cases cover SIGILL, exit code 134, absent status, an unsafe signal string, and exclusion of stderr and nested provider details.
  • Related suites passed, 284 tests in 7 files: provider-core failure, ProviderSessionManager, RunExecutionService, ProviderTurnStartService, AcpRegistryAdapterV2, AcpAdapterV2, and provider-cursor adapter.
  • vp run check:changed passed format, lint, both knip checks, typechecks for 25 affected packages, and 13 tests in 2 files.
  • Runtime reproduction used a shell executable that writes test-only stderr and raises SIGILL. It ran through the real Antigravity ACP adapter, session manager, orchestration, persistence, and client rendering. Main persisted the session identifier error; this head persists the session-open summary and SIGILL. The stderr test token is absent from the user-facing message.
  • Before/after recordings in the PR body use the v0.1.6 Linux desktop shell, with its extracted bundled server entry calling the worktree's server source. Before uses main's formatter; after uses this head's source. Both runs use the same isolated test state. Also verified before/after in the current web dev client through T3's Browser panel. No paid model turn ran.
  • Independent GPT-6.1-Sol review found no blocker, should, or nit findings. The device-route check requires focused tests for this shared error formatter, with no additional devices.

Unverified: Google's actual CPU-topology-dependent runtime crash, mobile rendering, and exit-code wording in a running client. The runtime crash and Settings authentication state are unchanged. The message identifies session opening, without distinguishing ACP initialize from session/new. Other ACP providers share this formatter; Codex and Claude do not raise this ACP error.

Synced from GitHub

Approvability

Verdict: Approved at 3f3e50b

Macroscope's review found this PR approvable — ACP startup failures now show a validated exit code or signal with troubleshooting guidance. The change is limited to error presentation and does not expose raw provider output or alter execution behavior.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

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.5 KiB21.5 KiB0 B (0.0%)24.4 KiB✅
CodexLive turn messages110 (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.3 KiB1.3 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: 575579d · PR result: 3f3e50b · 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.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 575579d68ac4bae09f8426a345d4a3eac1e90c67 and 3f3e50b35526ae98692567d0c23ba23cc64cc1d6.

External image Files selected for processing: 2
  • packages/provider-core/src/server/failure.test.ts
  • packages/provider-core/src/server/failure.ts

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

Walkthrough

The provider failure formatter now handles ACP process exits. It reports a validated signal or exit code when available, directs users to server logs, and omits stderr and nested causes. Tests cover both failure-message helpers and safe, missing, and unsafe status values.

Changes: Provider exit diagnostics

Layer / File(s)Summary
Format and verify process-exit messages
packages/provider-core/src/server/failure.ts, packages/provider-core/src/server/failure.test.ts
The formatter adds a curated message for AcpProcessExitedError. It reports a valid signal or safe-integer exit code when available. Tests verify that the message omits unsafe or absent status, stderr, nested causes, and private identifiers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • pingdotgg/t3code#28345 — Reports the same Antigravity ACP startup signal, and this change surfaces the signal in the startup error.

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: t3dotgg

Merge Risk: External image Minimal · up to 3f3e5

No merge-blocking risk is established; normal checks should run before merge.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main change: showing exit details when an ACP session startup crashes.
Linked Issues checkPassedThe changes satisfy the coding requirements in #28401. curatedCauseMessages recognizes AcpProcessExitedError and reports the provider session-open category, a validated signal or safe-integer exit…
Out of Scope Changes checkPassedThe pull request changes only provider failure formatting and its focused tests. The changes support the diagnostics requested by #28401. They do not change the upstream runtime, CPU state, authentica…
Description checkPassedThe pull request description is complete and follows the required structure. It explains the problem, change, scope, linked issue, verification steps, observed results, limitations, and implementation…
Full details: Linked Issues check

Explanation

The changes satisfy the coding requirements in #28401. curatedCauseMessages recognizes AcpProcessExitedError and reports the provider session-open category, a validated signal or safe-integer exit code, and server-log guidance. processExitStatus excludes stderr and nested cause text. The focused tests cover signal, exit-code, missing-status, unsafe-signal, nested-output, and direct-error cases. The resulting runtime failure message distinguishes startup failure from the saved authentication state without changing that state.

Full details: Out of Scope Changes check

Explanation

The pull request changes only provider failure formatting and its focused tests. The changes support the diagnostics requested by #28401. They do not change the upstream runtime, CPU state, authentication state, or unrelated provider behavior.

Full details: Description check

Explanation

The pull request description is complete and follows the required structure. It explains the problem, change, scope, linked issue, verification steps, observed results, limitations, and implementation tools. The scope section does not include an explicit maintainer approval comment, but the focused bug fix and linked issue provide sufficient context.

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

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified head 3f3e50b35526ae98692567d0c23ba23cc64cc1d6 against github/main at 575579d68ac4bae09f8426a345d4a3eac1e90c67 on this linux vm. ran vp i in both checkouts and vp run dev in the background, one server at a time. drove the web client with the repo's playwright and /usr/bin/google-chrome. created the project, provider configuration, threads, and turns through the ui. no mocks or demo data.

configured the genuine codex-acp 0.16.0 linux executable as a local ACP provider with the unsupported launch argument --invalid-startup-option. it really exited with code 2 during session startup on both revisions. main displayed an internal session id. this head displays the session-open stage, code 2, server-log guidance, and retry guidance, without exposing cli stderr in the turn message.

main: startup failure exposes an internal session id

pr: the same startup failure shows exit code 2 and guidance

retry produced the same useful error. both failures survived page reload. the recording shows submitting the follow-up and the second failure.

retry through the running web client

nearby behavior passed: switched the local ACP configuration to codex-acp 2.5.0 without the invalid argument, then completed a real gpt-6.1-sol turn in the same failed thread. a native codex gpt-6.1-sol turn also completed on this head and ran pwd successfully. the native path also completed a baseline turn on main.

the failed ACP thread recovers and completes a real codex turn

short runtime transcript:

text
1main server: AcpProcessExitedError: ACP process exited with code 2
2pr server: AcpProcessExitedError: ACP process exited with code 2
3stderr: error: unexpected argument '--invalid-startup-option' found
4pr native codex tool: /bin/bash -lc pwd
5/home/user/t3code
6pr native codex reply: native codex verified.
7pr ACP codex reply: recovered codex ready.

blacksmith checks passed: the focused failure suite (12 tests) and vp run check:changed (format, lint, both knip checks, typechecks for 25 packages, 13 tests across 2 files). no source changes were needed.

Not verified

this vm did not reproduce the reporter's CPU-topology-specific Antigravity SIGILL crash. the real-app scenario exercised the exit-code branch; signal and absent-status variants were covered by the existing focused tests, not a real crashing Antigravity process. native desktop shells, ios/android clients, macos/windows, and remote/tunnel connections were not exercised.