Skip to content

fix(server): register Linux providers spawned through the ProcessLauncher - #42692

Open
juliusmarminge wants to merge 3 commits into
mainfrom
factory/pr-42690
Open

juliusmarminge wants to merge 3 commits into
mainfrom
factory/pr-42690

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

On Linux the server refused to register agent CLIs started through its process-launcher helper, because it only trusted processes whose parent was the server itself, so those providers failed to start with "Cannot identify spawned provider". ProviderProcesses.register now also accepts a provider whose parent is the active ProcessLauncher, after checking that the launcher is itself a direct child of the server.

Fixes #41929

Supersedes #42690. The change is @bedair81's; their commits are kept.

Reproduction on main

On Linux with the process launcher active, connect to T3 Code and configure an authenticated Cursor provider in Settings → Providers. Create a thread, select Cursor and an available model, then send 'Reply with the single word: ok'. Main fails during worker registration; this change should allow the turn to start and respond. These steps were derived from the reports and source, not executed.

Evidence

On Linux with ProcessLauncher active, pair the fresh app, add authenticated Cursor in Settings → Providers, select Cursor / Grok 4.7, and send Reply with the single word: ok. Both sides use fresh isolated databases, light theme, and a 1280×800 browser viewport.

Before After
Before: Cursor worker registration fails After: Cursor replies ok
a05a8518f9 25f18631b8
Before recording After recording

Base fails with Cursor Agent SDK worker.register failed, caused by Cannot identify spawned provider. Head successfully starts a new worker and responds ok.

Browser driver · Base runtime trace · Head runtime trace

Tests

  • vp test run src/process/providerProcesses.test.ts (apps/server): 2 passed
  • Same test with main's providerProcesses.ts swapped in: the new case fails with Cannot identify spawned provider (the reported bug)
  • vp test run src/process/agentScope.test.ts (apps/server): 17 passed
  • vp run check:changed: format, lint, knip, graphql, typecheck and tests all pass
  • PR CI on 25f1863: all 38 checks passed

Not in this change

  • No test pins the launcher-parent check (a launcher that is not the server's child); the author's stubbed-service test for it passes on main too, so it was dropped under the testing doc's fewest-tests rule.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

bedair81 and others added 3 commits November 25, 2026 08:04
…case

Keep the case that fails on main (a launcher-hosted provider is rejected)
plus a rejection of a non-child, and fold the launcher-ownership check
into one expression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: a05a851 · PR result: 25f1863 · 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.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Provider registration now accepts providers parented by the server or by a launcher process verified as a server child. A Linux integration test checks registration, cleanup, and rejection of an unidentifiable provider.

Changes: Provider process registration

Layer / File(s) Summary
Validate provider parent ownership
apps/server/src/process/providerProcesses.ts, apps/server/src/process/providerProcesses.test.ts
Registration accepts direct server children and children of the server’s confirmed launcher process. The Linux integration test checks PID recording, removal through forget, and rejection of the current process.

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

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • pingdotgg/t3code#41936: Addresses the same provider registration failure by accepting launcher-owned providers.
  • pingdotgg/t3code#42690: Changes the same parent-process validation to accept providers parented by the active launcher.

Suggested labels: bugfix

Suggested reviewers: macroscopeapp

Merge Risk: Minimal · up to 25f18

This change lets provider registration succeed on Linux when agent CLIs are launched through the process launcher, which fixes the reported "Cannot identify spawned provider" failure. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: it fixes server-side registration of Linux providers spawned through the ProcessLauncher. It matches the main change in the summary and objectives. It uses conventional com…
Linked Issues check Passed [#41929] The reported failure comes from ProviderProcesses.register rejecting a Cursor worker whose parent is the process launcher, not the server. At head, `apps/server/src/process/providerProcesse…
Out of Scope Changes check Passed Whole-PR diff against the merge base a05a8518 touches apps/server/src/process/providerProcesses.ts (launcher import, runSync helper, isOwnedParent check) and providerProcesses.test.ts (a Lin…
Description check Passed The description covers the required sections. Problem: on Linux, the server rejected agent CLIs started through ProcessLauncher, which only trusted direct server children, so providers failed with "Ca…
Full details: Title check

Explanation

The title names the change: it fixes server-side registration of Linux providers spawned through the ProcessLauncher. It matches the main change in the summary and objectives. It uses conventional commit format and is specific.

Full details: Linked Issues check

Explanation

[#41929] The reported failure comes from ProviderProcesses.register rejecting a Cursor worker whose parent is the process launcher, not the server. At head, apps/server/src/process/providerProcesses.ts adds isOwnedParent(ppid). It accepts ppid === process.pid, or ppid equal to ProcessLauncher.currentPid when the launcher's own parent is process.pid. The launcher PID comes from ProcessLauncher.ts (current?.worker.pid), so the check uses the live helper. This matches the issue's first proposed fix: accept the launcher PID as a valid parent after confirming ownership. The unmatched cases still throw Cannot identify spawned provider. The issue does not require automated tests. Test coverage for the launcher-parent rejection path is absent. The PR description states this, and it does not change the coding requirement result. The PR does not implement the issue's alternative (native spawner), which is optional.

Full details: Out of Scope Changes check

Explanation

Whole-PR diff against the merge base a05a8518 touches apps/server/src/process/providerProcesses.ts (launcher import, runSync helper, isOwnedParent check) and providerProcesses.test.ts (a Linux-only test for the launcher-parent path). Both changes support the registration fix for #41929. The PR description's evidence capture and attribution notes are not code changes. No unrelated code change was found.

Full details: Description check

Explanation

The description covers the required sections. Problem: on Linux, the server rejected agent CLIs started through ProcessLauncher, which only trusted direct server children, so providers failed with "Cannot identify spawned provider". Change: ProviderProcesses.register also accepts a provider whose parent is the active ProcessLauncher, after checking the launcher is a direct child of the server. Scope: it links issue #41929 and the supersedes #42690 context. Verification: it lists focused test commands with results, a before/after comparison with screenshots, recordings and traces, and a note on what was not covered. It also names the models and tools used, as the template requests. The reproduction steps are marked as derived, not executed. The main gap is that no test covers the launcher-parent check itself, which the description discloses. The description is complete enough to pass.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a05a851 and 25f1863.

Files selected for processing: 2

  • apps/server/src/process/providerProcesses.test.ts
  • apps/server/src/process/providerProcesses.ts

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

This branch has not been deployed

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Cursor turns fail on Linux with "worker.register failed" (Cannot identify spawned provider) since process launcher

2 participants