Skip to content

Extract logs into run directory by default, add --zip flag#434

Merged
robinaugh merged 1 commit intomainfrom
jason/RWX-164-extract-logs-by-default
Mar 18, 2026
Merged

Extract logs into run directory by default, add --zip flag#434
robinaugh merged 1 commit intomainfrom
jason/RWX-164-extract-logs-by-default

Conversation

@robinaugh
Copy link
Contributor

@robinaugh robinaugh commented Mar 18, 2026

Background

Server-side RFC-166 standardizes log downloads to always return zip archives with a run_id field. This PR is the CLI side of that change (RWX-164).

Problem

The CLI had dual GET/POST logic and optional extraction (--auto-extract). This made it impossible to deliver background process and ready-check logs alongside the main task log — a zip archive is the natural container for multiple files, but the old behavior only extracted when explicitly requested.

With RFC-166, the server always returns a zip with a run_id, so the dual path is unnecessary and the default behavior should always extract into a structured directory, making background process logs available automatically.

Solution

  • Default behavior: always extracts the zip into <output-dir>/<run-id>/ and prints the directory path + each extracted file
  • --zip flag: new flag to skip extraction and save the raw zip archive instead
  • --auto-extract: retained as a hidden no-op flag for backward compatibility
  • API layer: removed the GET code path from DownloadLogs; now always POSTs {token, filename, contents} as form data
  • LogDownloadRequestResult: Contents changed from *stringstring; added RunID string
  • Tests updated throughout to reflect new behavior
╰─⠠⠵ RWX_HOST=cloud.local ./rwx logs a419fbbbee774d878d782bbb431e290c --task input
Logs downloaded to /Users/jasonrobinaugh/code/cli/.rwx/downloads/a419fbbbee774d878d782bbb431e290c/
  /Users/jasonrobinaugh/code/cli/.rwx/downloads/a419fbbbee774d878d782bbb431e290c/input.log
  /Users/jasonrobinaugh/code/cli/.rwx/downloads/a419fbbbee774d878d782bbb431e290c/input.bg.sleep.log

Further confirmation needed

  • Smoke test once rwx-cloud/cloud#7104 is merged and deployed: rwx logs <task-id> should extract to .rwx/downloads/<run-id>/, and rwx logs <task-id> --zip should save the raw archive

Server now always returns zip archives with a run_id. The CLI now
always extracts into <output-dir>/<run-id>/ by default; --zip saves
the raw archive instead. --auto-extract is retained as a hidden no-op
for backward compatibility.
@robinaugh robinaugh self-assigned this Mar 18, 2026
@robinaugh robinaugh marked this pull request as ready for review March 18, 2026 18:01
@robinaugh robinaugh merged commit abfc50d into main Mar 18, 2026
1 check passed
@robinaugh robinaugh deleted the jason/RWX-164-extract-logs-by-default branch March 18, 2026 22:50
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.

2 participants