Commit Graph

1 Commits

Author SHA1 Message Date
xarmian ad6cfc2c5e fix(cli): a bundle import shows progress, abandons a stalled upload, and resolves a lost answer (BUG-3476) (#1902)
* fix(cli): a bundle import shows progress, abandons a stalled upload, and resolves a lost answer (BUG-3476)

`pad workspace import <bundle>` printed nothing until the server answered,
sat silent on a dead TCP path until the kernel gave up or the 1h client
cap fired, and when the answer was lost could not say whether the
workspace existed, so a re-run could duplicate it.

- Each bundle import names its attempt with an import key (UUID), which
  the bundle door records and GET /workspaces/import-status answers
  (BUG-3475).
- Progress to stderr every 5s: bytes sent / total and percent, updated
  in place on a TTY.
- A stall (the transport takes no bytes for 90s; the server's per-Read
  deadline is 60s) abandons the upload.
- After the last byte: "Upload complete; the server is importing", then
  import-status every 10s. A settled outcome seen twice while the answer
  has not arrived ends the wait: the answer was lost.
- After any failure that is not the server's own JSON answer, it asks
  the key (waiting up to 90s for a running attempt to settle) and
  reports: complete -> success with the slug; kept -> the partial
  workspace named; removed / not_created -> safe to re-run; no record or
  unknown -> "outcome unknown: check 'pad workspace list' before
  re-running, a re-run may create a duplicate". An older server ignores
  the key and lands in that honest unknown branch.

The legacy JSON import is unchanged (its route takes no key).

Claude-Session: https://claude.ai/code/session_01Q9WssCjFuHjSfLABoW4tmS

* fix(cli): the stall message says what the counter knows (BUG-3476 codex r1)

Claude-Session: https://claude.ai/code/session_01Q9WssCjFuHjSfLABoW4tmS
2026-10-08 15:03:38 -04:00