Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): t3 run from a T3 terminal no longer trips on the service's launcher context #14263

Mergedplaycations(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/14263/headmerged by juliusmarminge View on GitHub

The background service passes T3_SERVICE_LAUNCHER_CONTEXT to the server it launches, and every terminal and agent shell that server spawns inherits it. Running npx t3 serve (or any t3 that resolves launcher startup) from one of those shells then fails before starting:

ServiceLauncherClientError: The service launcher started a different t3 version.
ServiceLauncherClientError: The service launcher supplied invalid startup context.   # older t3 reading a newer context

Even with a matching version it would fail with ipc-unavailable.

The launcher always spawns its child with an ipc stdio slot, and Node does not hand that channel to grandchildren. So resolveStartup now reads the context only when the IPC channel is connected; otherwise the context was inherited and the process runs unmanaged. That makes the ipc-unavailable case unreachable, so it is removed. This covers terminals, provider tool calls, and any nested t3 without chasing every place that builds a child env.

Test: a process holding a foreign-version context without IPC now starts unmanaged (fails before the fix with the exact error above).

Claude Opus 5.5 via Claude Code

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Disconnected processes are no longer treated as managed based solely on inherited launcher context. Update requests from these processes now report that the client is unmanaged rather than failing with an IPC-unavailable error.
    • Connected processes continue to use valid launcher context, and invalid context still results in an error.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at d45a887

      Macroscope's review found this PR approvable — This is a narrowly scoped server bug fix that prevents inherited launcher context from being mistaken for an active IPC-managed process, while preserving connected-child behavior. A focused regression test covers the new path, with no product-default or static-analysis configuration changes.

      Notes:

      • Diff unchanged. Approvability was decided on eligibility alone.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: 02d57478-9c4a-469a-a908-522590c3c142

      📥 Commits

      Reviewing files that changed from the base of the PR and between d2c9281b8112dc3b2991642c4bdb985e4b08b9bb and d45a887be59265c0b4261812397524a9f3ee4cbb.

      📒 Files selected for processing (2)
      • apps/server/src/cloud/serviceLauncherClient.test.ts
      • apps/server/src/cloud/serviceLauncherClient.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

      Walkthrough

      Startup now ignores inherited launcher context when the host is disconnected. The client reports that host as unmanaged. Connected hosts continue to decode context and reject invalid values.

      Changes

      Launcher startup handling

      Layer / File(s)Summary
      Resolve startup context and verify disconnected behavior
      apps/server/src/cloud/serviceLauncherClient.ts, apps/server/src/cloud/serviceLauncherClient.test.ts
      resolveStartup reads launcher context only when the host is connected, and managed depends on whether context was decoded. The ipc-unavailable error operation and message were removed. The test checks that a disconnected host with inherited context is unmanaged and sends no messages.

      Priority: ⬇️ Low

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

      Change: Bug fix

      Merge Risk: ⚪ Minimal · up to d45a8

      The change makes disconnected processes unmanaged as intended, with no concrete in-repository breakage identified. No merge-blocking risk remains.

      Security Architecture Review

      Security architecture risk: 🔵 Low · up to d45a8

      The change prevents a terminal-launched process from treating inherited launcher settings as its own. No new security attack path was established. A narrow startup race could still affect how a genuine service child handles a pending update if it loses its launcher connection.

      Retained concerns

      • Low · reliability · inferred: If a genuine launcher child loses IPC before resolving startup, it now drops its launcher and pending-trial identity rather than failing the disconnected-context startup path. Whether that permits an uncoordinated server to continue is unresolved.
      Security review details

      Security Blast Radius

      • inferred — The changed decision governs this server process's launcher-management and update IPC authority. The inspected change does not establish new tenant, data-store, credential, or network authority; possible exposure from an orphaned service child remains unknown.

      Trust Boundaries and Controls

      • observed — The client requires a connected, IPC-capable host before considering environment context for managed status. Connected hosts retain context and version validation. The source inspected does not independently authenticate a connected peer, but this PR does not change that connected-host path.

      Resilience and Maintainability Implications

      • observed — Disconnected inherited-context update requests fail before sending IPC. For an exchange already in progress, disconnect, send failure, and timeout do not produce an accepted update or committed trial result.

      Hardening Proposals

      • proposed — Define and exercise the recovery behavior for a genuine launcher child whose IPC disconnects before startup classification, especially when its context contains a pending trial update.
      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title clearly identifies the server bug fix for nested T3 runs from a T3 terminal and matches the main change.
      Description check✅ PassedThe description clearly explains what changed, why the change is needed, and how it was tested. It does not use the template headings or checklist, but it provides the required information and the UI …
      Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR

      Comment `@coderabbitai help` to get the list of available commands.
    4. juliusmarminge added labelsmacroscope-review

    5. juliusmarminge merged this1b5c2d1

    6. juliusmarminge closed this

Sign in to join this conversation.