Skip to content

refactor(reporter): save errors as a chain of causes - #761

Merged
wan9chi merged 1 commit into
mainfrom
refactor/saved-error-chain
Sep 27, 2026
Merged

wan9chi merged 1 commit into
mainfrom
refactor/saved-error-chain

Conversation

@wan9chi

@wan9chi wan9chi commented Sep 27, 2026

Copy link
Copy Markdown
Member

Motivation

The run summary saved each kind of error in its own way. Task errors used a six-variant enum whose message prefixes were rebuilt by hand when rendering. Upload failures picked their details separately for each client error variant. Task communication errors kept only their top message. #756 adds another set of these rules for remote cache read failures.

SavedError replaces all of them. It keeps an error's message and the messages of its sources, so any error can be saved without its own conversion. UploadError now derives thiserror, which exposes its sources.

The compact summary still shows only the message. --verbose and --last-details now show each cause on its own line below it:

      ⚠ Not uploaded to the remote cache: network error
        ↳ error sending request for url (http://127.0.0.1:0/projects/test/store)
        ↳ client error (Connect)
        ↳ tcp connect error
        ↳ <os error>

The ✗ line printed after a failed task still shows the whole chain on one line. The e2e redaction now also hides OS error messages at the start of a cause line.

## Motivation

The run summary saved each kind of error in its own way. Task errors used a six-variant enum whose message prefixes were rebuilt by hand when rendering. Upload failures picked their details separately for each client error variant. Task communication errors kept only their top message. #756 adds another set of these rules for remote cache read failures.

`SavedError` replaces all of them. It keeps an error's message and the messages of its sources, so any error can be saved without its own conversion. `UploadError` now derives `thiserror`, which exposes its sources.

The compact summary still shows only the message. `--verbose` and `--last-details` now show each cause on its own line below it:

```
      ⚠ Not uploaded to the remote cache: network error
        ↳ error sending request for url (http://127.0.0.1:0/projects/test/store)
        ↳ client error (Connect)
        ↳ tcp connect error
        ↳ <os error>
```

The `✗` line printed after a failed task still shows the whole chain on one line. The e2e redaction now also hides OS error messages at the start of a cause line.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  -2.14%  [-12.52% .. +13.49%]  overhead  +286.83%
dynamic/access             change  +0.41%  [ -5.03% ..  +8.92%]  overhead   +19.04%
dynamic/access-relative    change  -0.30%  [ -4.99% ..  +5.46%]  overhead   +64.70%
dynamic/access-contended   change  +5.47%  [ -7.89% .. +17.05%]  overhead   +21.13%
static/launch              change  +0.23%  [ -8.22% .. +11.78%]  overhead  +694.37%
static/access              change  -0.32%  [ -2.45% ..  +3.03%]  overhead +1418.57%
static/access-relative     change  -0.60%  [ -2.78% .. +14.36%]  overhead +1899.75%
static/access-contended    change  +0.15%  [ -2.15% ..  +1.45%]  overhead +1879.92%

macos

dynamic/launch             change  +0.02%  [ -2.56% ..  +2.90%]  overhead  +214.10%
dynamic/access             change  -0.36%  [ -2.27% ..  +1.57%]  overhead    +4.62%
dynamic/access-relative    change  +0.43%  [ -1.87% ..  +2.08%]  overhead  +276.03%
dynamic/access-contended   change  -0.09%  [ -3.38% ..  +2.72%]  overhead    +2.60%

windows

dynamic/launch             change  -0.77%  [ -4.15% ..  +3.82%]  overhead   +24.66%
dynamic/access             change  +0.00%  [ -1.64% ..  +1.47%]  overhead    +1.14%
dynamic/access-relative    change  +0.00%  [ -1.43% ..  +1.09%]  overhead    +1.11%
dynamic/access-contended   change  -0.53%  [ -2.94% ..  +4.23%]  overhead    +2.92%

@wan9chi
wan9chi merged commit 6f413dc into main Sep 27, 2026
19 checks passed
@wan9chi
wan9chi deleted the refactor/saved-error-chain branch September 27, 2026 13:17
wan9chi added a commit that referenced this pull request Sep 27, 2026
## Motivation

#755 uploads task results to the remote cache, but nothing reads them
back. Restoring them lets a task that ran on another machine, or before
`vp cache clean`, replay instead of running again.

## Changes

- `vt_remote_cache` adds `fetch` (`POST {endpoint}/fetch`), which
returns an exact match, a fallback match with its key, or no match, and
`download` (`GET {endpoint}/blob/{blob_id}`), which streams the blob's
chunks.
- After a local miss in `read` or `read-write` mode, `vp run` fetches
the entry. An exact entry is validated like a local one. Its archive is
downloaded to a `.tmp` file while being checked from the same stream,
then renamed, recorded locally, and replayed as a hit. Hits never
upload.
- A fallback, a failed validation, or a failed read is a miss. If the
local cache had an entry, its miss reason stays; otherwise the reason
comes from the remote cache, such as `remote cache fetch failed` or
`downloaded archive is corrupt`. Read failures aren't warnings, and
`--verbose` and `--last-details` show their causes like other errors
(#761). After a failed read, the `.tmp` file is removed and nothing is
recorded.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant