Repository navigation
Conversation
When the installer script (install.ps1 / install.sh) exits non-zero during a TUI update, the failure message only contained the exit code, leaving users unable to see why the installer failed. Capture the installer's stdout/stderr in runCommand and append the tail to the failure message. - runCommand now pipes and captures child output instead of inheriting (inherited output is overwritten by the TUI's full-screen render) - formatInstallerFailure builds the message with the last 20 lines of installer output, noting how many earlier lines were omitted - tests cover the message formatting and an end-to-end installer failure
li-xiu-qi
requested review from
MelodyVAR,
Uking-xxx,
ZouR-Ma and
liuedcson
as code owners
October 20, 2026 12:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #276
Problem
When
step updateruns from the TUI and the installer script exits non-zero,the only error shown is
install.ps1 exited with code 1— no installeroutput, so users cannot see why the installer failed and cannot file an
actionable report.
Two things cause this in
packages/coding-agent/src/step/local-update.ts:installLatestStepReleasebuilds the failure message from the exit codealone; the installer's stdout/stderr are never captured.
runCommandspawns the installer withstdio: "inherit", but the TUIrenders full-screen, so the child's output is overwritten before the user
can read it.
Changes
runCommandnow pipes and captures the child's stdout/stderr instead ofinheriting them, returning
{ code, output }.formatInstallerFailure(scriptName, code, output)builds the failuremessage with the tail of the captured output (last 20 lines, noting how
many earlier lines were omitted).
installLatestStepReleaseuses it for the non-zero-exit message.Behavior and compatibility
runCommandis module-private with a single caller(
installLatestStepRelease); no other call sites.persisted sessions, or provider responses.
function only runs in the TUI update path (
maybeUpdateStep'sinstallUpdatedefault), where inherited output was already invisibleunder the full-screen render — so there is no visible-output regression.
The CLI
step updatecommand takes the archive path(
runStepUpdateCommand) and does not go through this function.Updated Step in …).Validation
local-update.test.ts: three forformatInstallerFailure(no output / short output / long-output tail truncation) and one
end-to-end test that mocks the installer download with a failing script,
spawns it for real, and asserts the failure message contains the
installer's output.
vitest run src/step/local-update.test.ts— 8/8 pass (4 pre-existingfindArchiveRoottests + 4 new).installLatestStepReleasewith a mockedfailing installer (real powershell/bash spawn) confirms the message
content: the fixed code embeds the installer output, the pre-fix code
shows the bare exit code only.
npm run check— all green (biome, tsgo with zero errors, repo checkscripts).
Limitations
the TUI it was never visible; if a future CLI path reuses this function,
pass-through would need revisiting.