fix: workspace moves skip empty chats, explain failures once, and resume after a reload
Why
Moving the "Debugging Errors" cloud workspace to a computer failed with "Could not find this conversation's Claude session file". The workspace had a chat tab that never got a message. Claude writes a session file only after the first message, and prepareWorkspace stopped the whole move at the first chat it could not pack, after the branch was already pushed and agents were stopped.
The same investigation found the move UI showing one failure in up to four places with raw server text, and three open chats on one Claude session after a box restart.
Before and after for every change, and which part of Paradev runs each step of a move: https://app.superset.sh/page/workspace-moves-one-failure-one-place-ob5qgh
What changes
host-service: a chat with no session file is skipped as not_started. Any other failure to pack or upload one chat skips it as failed. The rest of the workspace moves.
chat-runtime: resuming an agent session that already has a running chat returns that chat. Stopped chats on that session close once the new agent starts. This covers the chat pane, the restart prompt, and superset sessions resume / send.
desktop:
- Decides "cloud workspace?" from the cloud workspace list. A sidebar move no longer goes through the relay ("Host is not online").
- A chat that didn't arrive shows its reason only in its pane. The toast has no whole-move Try again (that made a second destination). The extra error toast is deleted. The destination banner hides on failure.
- The source banner says what happened ("This workspace moved. Its N chats stayed here.").
describeMoveErrorgives plain words for relay, cloud status, old host, timeouts, and procedure-prefixed errors.- Toast status strings are now extracted and translated.
- Cancel from the banner stops the toast at once and shows as stopped.
- Unfinished chat moves to this computer resume when the app starts. One move never runs twice.
- Teammates see a move in progress. Only the mover gets Cancel and Try again.
API and realtime (MoveBook):
- New
chatMove.waitingOnHostquery. - Optional
anyoneinput onworkspaceMove.latestandchatMove.latest, plus a newisMineoutput field. heartbeatalso returnserror.- Two MoveBook additions: a
waitingOnHostop, andcreatedBy: null(anyone) on the twolatestops.
API (stored chats): chatHistory.events with latest failed on every first page. It defaulted beforeSeq to Number.MAX_SAFE_INTEGER, which Postgres refuses for the integer first_seq column ("out of range for type integer"). So a sleeping cloud workspace showed "Starting cloud workspace" instead of its stored chat. Found by running the desktop app against a local stack with workspace-moves on. The existing integration test for this path fails without the fix and passes with it. That suite doesn't run in CI.
Compatibility
Every input is optional and every output field is new, so released desktop and CLI builds keep working. Realtime and the API deploy in no fixed order:
- New API, old realtime:
waitingOnHostreturns[](old MoveBook refuses the unknown op), and ananyoneread falls back to the caller's own move. - Old desktop: it doesn't send
anyoneand ignoresisMine.
SkippedChat.reason gains "failed". No client branches on reason.
Not included
A server rule in workspaceMove.begin that refuses a second move after one whose chats failed. The only path that made a duplicate destination was the toast's Try again, and that is removed. A deliberate second move stays allowed.
Testing
- Passing:
- typecheck: desktop, host-service, trpc, shared, chat-runtime
bun run check:i18n: all locales translated- biome, sherif,
check:plugins
- Tests:
- desktop dashboard: 1944 pass
- chat-runtime: 503 pass
- host-service teleport, chat-v3 and sessions: 115 pass
- MoveBook: 10 pass
- new tests for: a chat with no session file,
waitingOnHost, anyone reads, the heartbeat reason, error wording, and a stopped chat resumed twice
- Full host-service suite: 29 failures in the workspace-creation and session-naming integration tests. The same 29 fail with these changes reverted.
- Not done: a real move in the running app, and the API's database integration suite.
Summary by cubic
Fixes workspace moves so a chat that fails to pack no longer stops the whole move, move failures are explained once in plain words, resuming an agent session never leaves duplicate open chats, and stored chats of a sleeping cloud workspace load again.
Behavior changes
- A chat with no Claude session file is skipped as
not_started; other pack or upload failures skip it asfailed, the rest of the workspace keeps moving, and a move where nothing moved fails with the first error. - Resuming an agent session with an already-running chat returns that chat and closes stopped chats on it once the new agent starts; legacy rows with
closed_at = 0count as open, and queued recovery prompts are kept. - Cloud workspace detection now uses the cloud workspace list, so sidebar moves no longer fail with "Host is not online" via the relay.
- Each failed chat shows its reason in its own pane; the localized toast reports the outcome with no whole-move Try again, and the source banner counts the chats that stayed, saying the workspace couldn't move when none arrived.
anyonereads show only where a move stands, not another person's error text, counts, or host details.- A cancelled move reports as cancelled, not timed out: the toast's cancel signal marks it, and the heartbeat reads a dead move again for its reason.
- Unfinished chat moves to this computer resume on app start, one move never runs twice, and teammates see moves in progress.
chatHistory.eventswithlatestno longer sendsbeforeSeqasNumber.MAX_SAFE_INTEGER, which Postgres rejected for the integerfirst_seqcolumn and broke every first page.- A stored chat while a cloud workspace wakes shares the connection pill used by the host pill, with a ~30s countdown and a Retry that wakes the box; the old waking strip is removed.
API and realtime
- Adds
chatMove.waitingOnHost;workspaceMove.latestandchatMove.latestaccept an optionalanyoneinput with a newisMineoutput, andheartbeatreturnserror. - Every input is optional and every output field is new, so released desktop and CLI builds keep working, and API and realtime can deploy in either order.
Summary by CodeRabbit
-
New Features
- Workspace moves can resume automatically after reopening the app, and progress now links to the move’s status for clearer follow-up.
- Connection indicators show wake-up progress and offer a retry action for cloud workspaces.
- Resuming an agent session can reuse an existing matching chat.
-
Improvements
- Move status now distinguishes completed, partial, cancelled, and failed outcomes, with clearer troubleshooting and retry guidance.
- Move controls reflect who started the move and where it is in progress.
-
Bug Fixes
- Chats that have not yet produced session data are handled without interrupting workspace moves.
- Move errors provide more actionable explanations.
-
Translations
- Updated workspace and chat move messages across supported languages.