improve shx upload error handling
ci / smoke (push) Successful in 55s

This commit is contained in:
2026-06-04 22:10:55 +00:00
parent b2ef6d8e99
commit 17bd6622eb
4 changed files with 353 additions and 44 deletions
+8 -15
View File
@@ -2,13 +2,11 @@
## high value
- [ ] surface Zipline error bodies on failed uploads
- right now `curl -fsS` drops the JSON body on HTTP 4xx/5xx, which makes auth/quota/debugging annoyingly blind.
- keep non-zero exits, but capture the response body and print the server message when available.
- [x] surface Zipline error bodies on failed uploads
- HTTP failures now preserve the response body and print a parsed server message when available.
- [ ] validate the response shape before printing success output
- the script currently assumes the API returns `.files`; if Zipline returns a different success/error shape, users can get empty output with little context.
- fail clearly when `.files` is missing or empty.
- [x] validate the response shape before printing success output
- successful responses are now rejected unless they include a non-empty `.files` array.
- [ ] add a `--no-env` / `--env-file <path>` flag
- auto-loading `/root/.openclaw/.env` is handy here, but it makes the helper less portable and harder to use in CI or on another machine.
@@ -16,13 +14,8 @@
## reliability / test gaps
- [ ] add tests for the unhappy paths that matter most
- missing file
- missing token
- missing `jq` in normal mode
- server-side upload failure
- this script is tiny, so covering the sharp edges will buy more confidence than adding features.
- [x] add tests for the unhappy paths that matter most
- covered: missing file, missing token, missing `jq` in normal mode, server-side upload failure, and malformed success payloads.
- [ ] add a mock assertion that the upload request is formed correctly
- current smoke test only checks the printed output.
- also assert that `curl` was called with the auth header and multipart `file=@...` field so refactors do not silently break real uploads.
- [x] add a mock assertion that the upload request is formed correctly
- the smoke tests now assert the auth header, upload endpoint, and multipart `file=@...` field.