Reload document
reload_documentRefresh the current document from its source file, discarding any unsaved edits while keeping the same document ID. A pre-reload snapshot is saved for undo.
Instructions
Refresh a working copy FROM ITS SOURCE under the SAME doc_id, discarding working edits.
When to use: external edits changed the source file and you want to resync in place (keep the
same doc_id). To undo a single edit instead use restore_snapshot; to open a different file
use open_document.
Key params: doc_id must be open. Flow (reversible): take a PRE-reload snapshot of the current
working copy (undo via restore_snapshot), re-resolve the source through the sandbox and
re-validate it is STILL inside the workspace (a moved/vanished source is rejected with a stable
"path rejected" message), then re-copy the source over the working copy. A create_document
document has no external source, so its reload restores from its blank seed.
Return shape: ReloadDocumentResult — refreshed summary plus pre_reload_snapshot_id (the
pre-reload checkpoint).
Example: reload_document(doc_id)
Risk class: low (only the working copy is rewritten, reversibly; the original is never written).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| summary | Yes | Top-level document summary (viewBox / page / size / counts). | |
| pre_reload_snapshot_id | Yes |