See what an agent or a script changed, and take it back.
Applies To
Every liveworkspace app
When an agent or a script changes one of your tabs through the API, the change lands as a changeset: one write to one tab, applied all or nothing, credited to the person whose API token made it, and undoable as one unit. This article covers how to see what a changeset did and how to take it back.
In the Editor
If you have the file open when a changeset lands, you see it happen.
Show brings the changed elements into view, switching to their tab if you are on another one.
Undo reverts the change. Afterwards the note reads Undone, or, when some elements were changed again in the meantime, something like Undone, 2 kept because they changed since (see What Undo Keeps).
If the undo fails, the note offers Show and Undo again, and an error says "Could not undo Webber's change".
The note stays until you close it. Changes from the same token within ten seconds of each other share one note, with the counts added up and the latest summary, and Undo on it reverts each of them, newest first. A newer burst from the same token replaces the note.
Your own Undo shortcut (Ctrl+Z or ⌘Z) never takes back an agent's change: it only ever undoes your own edits. Anything you change while the agent works is kept, and an element you have selected is off limits to it: the changeset is refused and the agent is told who holds it.
The note is an information message, so switching off In-Editor Notifications in Settings hides it; the outline still shows. Undo needs edit access to the tab, so Viewers and Participants see changes arrive but can't revert them.
Once the Note Is Gone
From the API
Three routes read and revert changesets, with the same authentication as the rest of the API:
Each changeset in the list looks like this:
Reading the history needs read access to the file; reverting needs edit access to the tab. A revert made with a token is refused with 409 elements_held when somebody has one of its elements selected, as any agent change is; one made from the editor's Undo never is. See Errors and Rate Limits for the other answers.
What Undo Keeps
A revert applies the changeset in reverse to the tab as it is now, element by element. Anything changed since is left alone rather than overwritten, and listed as kept with a reason:
changed: someone edited an element the changeset added or changed.
gone: an element the changeset added or changed has since been deleted.
present: an element the changeset removed is back on the tab.
order: someone reordered the elements a changeset reordered.
How Long You Can Undo
A changeset can be reviewed and reverted for 30 days after it lands, the same as the Trash keeps a deleted file. After that its record is deleted: it no longer appears in the list, and showing or reverting it answers 404. The change itself stays on the tab.