Skip to content

fix: show the actual error when release preparation fails - #203502

Merged
obviyus merged 1 commit into
mainfrom
update-failure-detail
Nov 22, 2026
Merged

obviyus merged 1 commit into
mainfrom
update-failure-detail

Conversation

@obviyus

@obviyus obviyus commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

A failed release build, dependency install, or fetch can hide its actual error behind a truncated block of colored warnings. Operators see that the update failed but cannot see the cause needed to repair it.

User Impact

Failed release preparation now retains the end of the error output without terminal escape codes, and openclaw update prints it alongside the existing guidance that the current version is still running. This improves new failure records; it cannot reconstruct output discarded by an older updater.

Why This Change Was Made

src/update/prepare-git.ts returns the final 8 KiB of the failed command's raw output (the package preparer follows the same pattern). src/update/run.ts passes that output into the failure step's detail. src/infra/update-run-codec.ts bounds detail to its first 1,024 characters, so the command's final error is lost.

Normalize the detail at its existing producer: reuse the ANSI stripper and surrogate-safe slice helper to keep the last 1,024 characters before writing the record. The CLI reads that same stored outcome detail. No new field, schema, protocol, or dependency is introduced.

Evidence

The regression invokes the real release CLI flow against a local Git remote and a build that emits more than 8 KiB of ANSI-colored warnings followed by fixture build failed. On the base, the stored detail contains only warnings and the regression fails because the final error is missing.

The combined release-preparation, CLI, and Gateway update-route tests passed (21 tests), including a second pass after lint cleanup. The regression took 2.8–16.5 seconds across those runs; its file took 20.1–81.3 seconds including imports and setup. Production and test typechecks passed; targeted format and lint checks passed. The complete changed-file check also found existing unused exports outside this fix; the diagnostic fix adds no exports.

The built CLI also ran openclaw update --no-restart --yes against an isolated Git install: it exited 1, printed the real error and current-version guidance, and update status --json retained the error in an ANSI-free 1,024-character detail. The build's normal package-manager footer remains after the error line.

A full build with declarations passed. The packed smoke passed its CLI, SDK-consumer, and bundled-channel checks, but its final workspace-bootstrap child timed out; that broader packaging proof is incomplete.

The change retains the existing failure-record owner and removes no runtime path: 11 added / 4 removed production lines and 33 added / 2 removed test lines.

Merge Danger

Two-way door: reverting restores the previous diagnostic formatting without changing update preparation, activation, or rollback. The blast radius is failed release-preparation diagnostics and their CLI display; existing stored records and their schema are unchanged.

Preserve the ANSI-free end of failed preparation output within the existing detail limit, and show that stored error in the CLI.
Cover the release CLI flow with a real Git fixture whose failing build ends after more than 8 KiB of colored warnings.
@clawsweeper

clawsweeper Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@obviyus

obviyus commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator Author

Rejected review findings:

  • The local review found no correctness or security defects. Its “real behavior proof missing” assessment came from the offline review context, which contained source but not the executed evidence. The actual built CLI on 4dd2bdc515213cb6008987dab899f44948e5c576 has now run against an isolated Git install with more than 8 KiB of colored build warnings. openclaw update --no-restart --yes exited 1 and printed the real error; openclaw update status --json retained it in an ANSI-free, 1,024-character outcome detail. No code change is required for this assessment.

Final lines of the actual CLI output:

warning: build notice
fixture build failed
[ELIFECYCLE] Command failed with exit code 42.
The new version could not be built. The current version is still running.

The regression failed on the base 450441b904031b886c5fff3238f25b424907dcfe because its stored detail contained only warnings instead of fixture build failed. With the fix, the combined preparation, CLI, and Gateway-route run passed all 21 tests; targeted format/lint and production/test typechecks passed. The PR description records the broader packed-smoke timeout and existing unused-export check failures separately.

@obviyus
obviyus merged commit 27cbf2c into main Nov 22, 2026
127 checks passed
@obviyus
obviyus deleted the update-failure-detail branch November 22, 2026 14:05
@obviyus

obviyus commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator Author

Landed the diagnostic fix: failed release preparation now keeps the ANSI-free end of command output, and the CLI shows that recorded error without losing current-version guidance. The regression is red on the base and green with the fix; all 21 focused tests and the isolated built-CLI failure/status proof passed. Thanks for the real-install failure report.

vincentkoc added a commit that referenced this pull request Nov 22, 2026
…203063

* origin/main:
  fix: show the actual error when release preparation fails (#203502)
  improve(ui): lead the Models page with an inline provider catalog (#203485)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 23, 2026
…03502)

## What Problem This Solves

A failed release build, dependency install, or fetch can hide its actual error behind a truncated block of colored warnings. Operators see that the update failed but cannot see the cause needed to repair it.

## User Impact

Failed release preparation now retains the end of the error output without terminal escape codes, and `openclaw update` prints it alongside the existing guidance that the current version is still running. This improves new failure records; it cannot reconstruct output discarded by an older updater.

## Why This Change Was Made

`src/update/prepare-git.ts` returns the final 8 KiB of the failed command's raw output (the package preparer follows the same pattern). `src/update/run.ts` passes that output into the failure step's `detail`. `src/infra/update-run-codec.ts` bounds `detail` to its first 1,024 characters, so the command's final error is lost.

Normalize the detail at its existing producer: reuse the ANSI stripper and surrogate-safe slice helper to keep the last 1,024 characters before writing the record. The CLI reads that same stored outcome detail. No new field, schema, protocol, or dependency is introduced.

## Evidence

The regression invokes the real release CLI flow against a local Git remote and a build that emits more than 8 KiB of ANSI-colored warnings followed by `fixture build failed`. On the base, the stored detail contains only warnings and the regression fails because the final error is missing.

The combined release-preparation, CLI, and Gateway update-route tests passed (21 tests), including a second pass after lint cleanup. The regression took 2.8–16.5 seconds across those runs; its file took 20.1–81.3 seconds including imports and setup. Production and test typechecks passed; targeted format and lint checks passed. The complete changed-file check also found existing unused exports outside this fix; the diagnostic fix adds no exports.

The built CLI also ran `openclaw update --no-restart --yes` against an isolated Git install: it exited 1, printed the real error and current-version guidance, and `update status --json` retained the error in an ANSI-free 1,024-character detail. The build's normal package-manager footer remains after the error line.

A full build with declarations passed. The packed smoke passed its CLI, SDK-consumer, and bundled-channel checks, but its final workspace-bootstrap child timed out; that broader packaging proof is incomplete.

The change retains the existing failure-record owner and removes no runtime path: 11 added / 4 removed production lines and 33 added / 2 removed test lines.

## Merge Danger

Two-way door: reverting restores the previous diagnostic formatting without changing update preparation, activation, or rollback. The blast radius is failed release-preparation diagnostics and their CLI display; existing stored records and their schema are unchanged.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant