Time Travel gives every writable layer in Space Agent a local Git history. EachDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/agent0ai/space-agent/llms.txt
Use this file to discover all available pages before exploring further.
L1/<group>/ and L2/<user>/ root becomes its own Git repository, and every save quietly schedules a commit in the background. The Time Travel page lets you browse that history, inspect per-file diffs, jump back to an earlier state, or create a new revert commit — all without touching a terminal.
Enabling Time Travel
Time Travel is controlled by theCUSTOMWARE_GIT_HISTORY runtime parameter, which defaults to true. When disabled, the route still renders but the history APIs return { enabled: false }.
GIT_BACKEND parameter controls which Git implementation the server uses:
| Value | Behavior |
|---|---|
auto (default) | Tries native first, falls back to isomorphic |
native | Always uses native Git subprocess |
isomorphic | Always uses the isomorphic JS backend |
The isomorphic backend caches immutable history-entry and tree objects for repeated reads, so Time Travel page loads remain fast even on hosts without a native
git binary.Accessing the Time Travel UI
Navigate to#/time_travel from the app menu or from the dashboard Files panel. The route is served from /mod/_core/time_travel/view.html and is also embedded in the admin area’s Time Travel tab.
The page’s Refresh and repository picker controls are injected into the shared shell header bar via x-inject so they stay in shell chrome without becoming persistent shell extensions.
What the UI Covers
Pick a repository
The page defaults to the current user’s
~ (L2/<username>/) history. A permission-aware picker lets you switch to any writable L1 or L2 root you manage. The picker is populated by space.api.fileList({ gitRepositories: true, access: 'write' }).Browse and filter commits
Commits are listed in reverse-chronological order with pagination. Use the file filter to narrow the list to commits that touched a specific path or filename. The current HEAD is distinguished from preserved forward-travel refs by the
currentHash in the API response.Inspect diffs
Click any commit to see a per-file diff. Diff patches larger than 1 MB show a notice instead of rendering. The diff viewer uses the same
/api/git_history_diff endpoint as space.api.gitHistoryDiff(...).Preview before apply
Before rolling back or reverting, the UI calls
gitHistoryPreview to show you which files will be affected. Revert conflicts surface a short recommendation first; technical backend details are kept behind an explicit expand action.How Commits Are Created
The server schedules a commit after a quiet period following each write:| Time since last write | Debounce interval |
|---|---|
< 1 minute | 10 seconds |
1–5 minutes | 5 seconds |
5–10 minutes | 1 second |
> 10 minutes | Immediate |
Auth File Protection
TheL2 repository .gitignore permanently excludes the three auth-sensitive files:
L2 history never restores an old password verifier, old session records, or an old wrapped browser key. Those files are always preserved at their current state. This means:
- Rollback cannot log a user out.
- Rollback cannot restore a previous password hash.
- Rollback cannot silently downgrade the user’s crypto state.
Rollback vs. Revert
Rollback
Moves HEAD to the selected past commit. The server preserves the previous HEAD in a backend-owned ref so the Time Travel page can still show forward-travel options after moving back. Use rollback when you want to fully restore the tree to an earlier point.
Revert
Creates a new commit whose changes are the inverse of the selected commit. HEAD advances rather than moves backward. Use revert when you want to undo a specific change without losing the commits that came after it.
JavaScript API
All Time Travel operations are exposed throughspace.api. These helpers map directly to the server endpoints.
space.api.gitHistoryList
space.api.gitHistoryDiff
space.api.gitHistoryPreview
preview before rollback or revert to show the user which files will be affected.
space.api.gitHistoryRollback
space.api.gitHistoryRevert
Server Endpoints
The frontend API helpers map one-to-one to these server routes:| Frontend helper | Server endpoint |
|---|---|
gitHistoryList | POST /api/git_history_list |
gitHistoryDiff | POST /api/git_history_diff |
gitHistoryPreview | POST /api/git_history_preview |
gitHistoryRollback | POST /api/git_history_rollback |
gitHistoryRevert | POST /api/git_history_revert |
CUSTOMWARE_GIT_HISTORY=false.
Repository Discovery
The Time Travel picker populates itself usingfileList with gitRepositories: true:
L2/<username>/ and L1/<group>/, never .git metadata paths. Read-only repositories are excluded when access: 'write' is set.