Files
PaperClipAI/server
Dotta db9be4c5a6 fix(workspaces): preserve safe one-shot failure messages (#18888)
## Thinking Path

> - Paperclip manages agent work and keeps saved work safe.
> - Remote workspaces use provider commands to build and copy a verified
archive.
> - Some providers return a one-shot command's combined output in
stdout.
> - The workspace transport checked only stderr for its two safe failure
messages.
> - This hid those messages behind a generic error on that provider
path.
> - This pull request checks both streams for the same exact messages.
> - The benefit is a useful existing error message without exposing
other output.

## Linked Issues or Issue Description

**What happened?**

Daytona one-shot execution returns combined output in stdout and leaves
stderr empty. The remote workspace transport checked only stderr after a
failed command. It therefore lost the existing full-disk and
unfinished-Git-operation messages.

**Expected behavior**

Preserve those same two exact safe messages from either returned stream.
Keep all other output private. Keep the existing stderr preference when
both streams contain different safe messages.

**Steps to reproduce**

Run the real workspace capture helper with a conflicted Git merge or an
injected ENOSPC write. Apply the provider's one-shot output contract to
the real child result. Before this fix, all three new cases return only
remote_workspace_operation_failed.

Related provider contract: #10941. The duplicate search found no PR for
this exact transport classification gap.

## What Changed

- Check stderr and stdout for only the two existing exact safe failure
messages.
- Add real helper regressions for one-shot Git and full-disk failures.
Keep the conflicted files and original saved result intact.
- Add privacy, unknown-output, split-message, stderr-preference and
healthy verified capture/restore controls.

## Verification

- RED: three real helper cases fail on the unchanged transport. They
cover a conflicted Git merge and ENOSPC during helper installation and
archive creation.
- GREEN: 73 tests pass in remote-workspace-transport.test.ts and
remote-workspace-snapshot-archive.test.ts.
- Server layered typecheck passes: `cd server && node
scripts/typecheck-layers.mjs` with Node24.22.2. All seven source/test
layers pass.
- Full CI is requested with the full-ci label. Current-head CI and
review are pending.
- The local install used the frozen lock with scripts disabled. The
maintained root SDK-link helper restored its skipped local postinstall
links. The original prerequisite failure is retained. Generated package
outputs were copied only after complete input, installed-toolchain and
output-hash equality checks; server declarations were checked in this
worktree.
- The full workspace typecheck, test suite and build were not run
locally. This two-file change uses focused real-helper tests and server
typechecking; full CI supplies the broader checks.

## Risks

- A failed command can now show one of the existing safe messages when
the provider puts it in stdout. Unknown, prefixed, suffixed and private
output still produces the generic error.
- This change does not repair an archive failure or prove that a
retained workspace was saved. It changes no capture, ownership, archive
validation, stop, save or retry guard. No live provider command or
recovery action was run for this PR.
- No API, permission, schema, configuration, map or documentation
contract changes are required.

## Model Used

- OpenAI GPT-6 (Codex), with reasoning, tool use and code execution. The
host does not expose the exact deployment identifier or context-window
size.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-11-03 18:44:14 -06:00
..