Repository navigation
API: a computer's daily saved copies, and restoring one - #2017
Merged
Merged
Conversation
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
November 22, 2026 05:06
davidmckayv
force-pushed
the
api/workspace-snapshots
branch
2 times, most recently
from
November 22, 2026 07:11
7326203 to
a1fc568
Compare
Two operations on the computer a Bot runs on: - getWorkspaceSnapshots: the computer's saved copies of its files and browser sign-ins, newest first (one a day, the last 7 kept, and one saved just before each restore), the latest restore and how it ended, and whether the caller may restore it. - restoreComputer: put the computer back the way it was in one copy. Only when someone asks: OpenBot saves the computer as it is now first, then replaces its files and sign-ins and starts it again. Answered at once with the restore running (202). One restore of a computer at a time (409 COMPUTER_RESTORE_RUNNING). An administrator of the organization may name another person's computer; otherwise it is the caller's own. A Bot's action while its computer is being restored is answered 503 COMPUTER_RESTORING, worth retrying.
davidmckayv
force-pushed
the
api/workspace-snapshots
branch
from
November 22, 2026 10:11
a1fc568 to
49f4fc9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two operations on the computer a Bot runs on, so a person can get their computer back after a Bot (or they) wiped it:
GET .../computers/{botId}/workspace-snapshots(getWorkspaceSnapshots): the computer's saved copies of its files and browser sign-ins, newest first. One is saved a day and the last 7 are kept; one more is saved just before every restore (kindbefore-restore). Also the latest restore and how it ended,available(false where this OpenBot keeps no copies) andcanRestorefor the caller.POST .../computers/{botId}/restore(restoreComputer): restore the computer from one copy. Answered at once (202) with the restore running; the read above says how it ends. One restore per computer at a time (409COMPUTER_RESTORE_RUNNING).Why this shape
computer; nobody else can reach another person's.COMPUTER_RESTORING, which is retryable.Checks
bun run api:generate(bundle and clients regenerated),bun run api:lintclean,bun test apipasses.The screens come in their own pull request.