Skip to content

fix(ssh): report remote package installation failures accurately - #10088

Merged
juliusmarminge merged 1 commit into
mainfrom
fix/audit-ssh-install-diagnostic
Sep 5, 2026
Merged

fix(ssh): report remote package installation failures accurately#10088
juliusmarminge merged 1 commit into
mainfrom
fix/audit-ssh-install-diagnostic

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Sep 5, 2026

Copy link
Copy Markdown
Member

Related #10084.

When a remote package installation failed with ETARGET, the SSH runner discarded its exit status and claimed that installation succeeded but needed a C compiler. A failed installer that printed an executable path could even proceed to launch it.

Check the installer's exit status before accepting its stdout. Keep npm's original stderr and report installation failure without guessing its cause. The existing zero-exit/no-executable compiler advice remains intact, as do package versions, installer arguments, retries, timeouts, Node overrides and direct CLI execution.

Verification

  • Before the fix, six actual shell-process controls failed and ten passed. Afterward, all sixteen pass. The complete focused runner, tunnel and command run passes all 36 tests; an independent orchestrator run also passed all 36.
  • Both npx and npm exec paths cover ETARGET, another nonzero error, failure with a valid path on stdout, zero-exit/no-executable, successful install, an existing CLI and a Node script override. Existing PID, graceful shutdown and restart controls pass.
  • SSH package typechecking, targeted formatting and lint pass.

The tests execute the production-generated script through real /bin/sh, using owned synthetic installer executables and no registry access. They reproduce the diagnostic boundary, not the original package-publication timing, remote Node22/npm11 environment, SSH desktop dialog or successful reconnect. No version fallback or publication change is included. Screenshots do not apply to this shell-only fix. All current-head executed CI, Macroscope correctness, Effect Service Conventions and approvability checks pass. No unresolved review threads remain. Cursor review is paused at the team spending limit; CodeRabbit automatic reviews are disabled. Final merge review is pending.

Prepared by GPT 6 Astra via Codex in T3 Code.

Note

Fix require_installed_t3_cli to report package-manager failures in SSH runner

  • The require_installed_t3_cli shell helper in tunnel.ts now checks the installer command's exit status. When the package-manager command fails, it prints an installation failure message with the package spec and exits with status 1 instead of silently proceeding.
  • When the installer succeeds but emits no executable path, the existing native-dependency/toolchain diagnostic is unchanged.
  • Adds a live parameterized test suite in runnerProcess.test.ts covering npx and npm across seven scenarios (resolution failure, network failure, empty output, success, failed install with stdout path, existing CLI, node-script override).
  • Risk: the helper now exits immediately on installer failure rather than falling through to the missing-executable diagnostic, so any remote environment where the package manager exits non-zero for non-installation reasons will surface a different error message.

Macroscope summarized 4e1843e.

@cursor

cursor Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Sep 5, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 4e1843e

Macroscope's review found this PR approvable — This is a focused SSH error-handling fix that preserves npm diagnostics and reports remote package-installation failures instead of misclassifying them as missing executables. The production logic is small, existing successful paths remain unchanged, and the relevant failure modes are covered by regression tests.

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

@github-actions

github-actions Bot commented Sep 5, 2026

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 13.6 KiB 13.5 KiB −35 B (−0.3%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB +3 B (+0.0%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.5 KiB −38 B (−0.6%) 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 57.0 KiB −88 B (−0.2%) 66.4 KiB
Codex Live turn messages 10 8 −2 (−20.0%) 21
Claude Total thread wire 13.5 KiB 13.5 KiB −3 B (−0.0%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB +3 B (+0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 6.5 KiB −6 B (−0.1%) 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 57.8 KiB 0 B (0.0%) 66.4 KiB
Claude Live turn messages 8 8 0 (0.0%) 21

Baseline: 2271a27 · PR result: 4e1843e · 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: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

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

@juliusmarminge
juliusmarminge merged commit 39802c0 into main Sep 5, 2026
22 checks passed
@juliusmarminge
juliusmarminge deleted the fix/audit-ssh-install-diagnostic branch September 5, 2026 10:42
patroza pushed a commit to patroza/t3code that referenced this pull request Sep 5, 2026
The new pingdotgg#10088 install-failure tests spawn with extendEnv:false, so
$HOME is unset and the remote runner script dies under set -u.

Made with grok-4.6
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 5, 2026
## What's Changed
* fix(server): keep Homebrew mise shims manual-only by @juliusmarminge in pingdotgg/t3code#10085
* fix(ssh): report remote package installation failures accurately by @juliusmarminge in pingdotgg/t3code#10088
* fix(web): keep bulk thread deletion going after failures by @m-de-graaff in pingdotgg/t3code#4615
* fix(web): scale agent spawn rows with interface font by @juliusmarminge in pingdotgg/t3code#10092
* fix(web): prevent sidebar tooltip title clipping by @UtkarshUsername in pingdotgg/t3code#10086
* fix(web): keep the composer expanded until the thread can scroll by @t3dotgg in pingdotgg/t3code#9965
* fix(web): preserve original mention text in the composer by @juliusmarminge in pingdotgg/t3code#10100

## New Contributors
* @m-de-graaff made their first contribution in pingdotgg/t3code#4615

**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260905.1286...v0.0.39-nightly.20260905.1287

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260905.1287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant