Limits and errors
These rules apply to /canvas/v1 and praxis.canvas. Correct invalid inputs; capacity and transient failures can be retried after checking current state.
Limits
| Item | Value | Rule |
|---|---|---|
| Script | 65536 JS string units | Shorten source; this is not a UTF-8 byte count. |
| VM memory | 32 MiB | Reduce objects and arrays. |
| VM stack | 1 MiB | Reduce recursion depth. |
| Interrupt polls | 20000 | Bound loops and split calls; this is not milliseconds or a JS instruction count. |
| Recorded operations | 5000 / execute | An Insert tree is one operation; ordinary Replace is two. |
| cumulative 65536 JS string units | Reduce output; includes spaces between values, not newlines between output entries. | |
| TakeScreenshot | 4 IDs / execute | Extras silently ignored; duplicates also count. |
| Active execute slots | 4 / canvas | New execute calls are rejected once 4 slots are occupied. |
| edit_id | 10 minutes | Measured from saving a failure; unknown/expired IDs need new source. |
| nodes.list ids | 1–100 / call | Comma-separated; missing nodes are null. |
| nodes.list depth | nonnegative integer | Omission reads the full subtree. |
| images.list ids | 1–4 / call | PNG data URL; missing nodes are null. |
| images.list scale | 0.25–4, default 1 | Only format:png is supported. |
| Incremental transaction history | latest 500 revisions | Catch-up window for live viewers, not a version backup; outside it a full resync is needed. |
| Version history | all from 30 days; newest 100 always | Oldest pruned first above 256 MiB; the oldest restorable version is earliest_restorable_version in versions.list. |
| execute warnings | up to 8 touched top nodes, 20 each | Not a full-canvas audit and may omit problems. |
Source and Print constants are named as 64 KiB limits, but implementation counts JavaScript string length. VM memory and stack count bytes. No fixed wall-clock execution duration is promised.
Errors and recovery
| code | HTTP | Cause and action |
|---|---|---|
CANVAS_NOT_FOUND | 404 | Canvas missing, deleted or outside this organization. Choose an accessible ID from list; do not retry unchanged. |
NODE_NOT_FOUND | 404 | Target node missing. Read current nodes and fix the ID. Missing images.list nodes normally return null. |
REVISION_CONFLICT | 409 | expected_version mismatch. Retrieve again, merge intent and retry with the new version. Public details currently names the numeric current revision revision; use the string retrieve.version for the next input. |
CANVAS_BUSY | 429 | All execute slots on this canvas are occupied. Wait for in-flight calls before retrying; avoid parallel edits to the same canvas. |
SCRIPT_ERROR | 400 | Syntax/runtime error or failed edit matching. Inspect line/column and message, repair and rerun; do not retry unchanged. details.prints holds what was printed before the failure. |
VERSION_NOT_FOUND | 404 | The version does not exist, predates history or was pruned; pick an available version from versions.list. |
SCRIPT_LIMIT | 400 | VM resources, interrupt polls, operations or Print exceed a limit. Reduce work before retrying. Source-length overflow currently returns SCRIPT_ERROR with SCRIPT_LIMIT in the message; shorten source. |
OPS_REJECTED | 400 | Illegal node operation. Inspect rejection for parent, immutable field, cycle, negative size or invalid reference; fix before retrying. |
EDIT_EXPIRED | 400 | edit_id unknown or older than ten minutes. Send corrected full script. |
INVALID_PARAMS | 400 | Invalid request JSON, ids, depth, scale, format or other input. Correct the field constraints. |
INVALID_PAGE_TOKEN | 400 | Invalid pagination cursor. Drop cursor and restart list at the first page. |
RENDER_FAILED | 503 | Node produced no image or rendering failed. Check dimensions/references before retrying. |
NOT_IMPLEMENTED | 501 | Capability unavailable. Do not retry unchanged; use documented capabilities. |
INTERNAL | 500 | Internal failure. Inspect the current canvas for a committed write before retrying to avoid duplicate creation. |
A missing/invalid API key returns 401; insufficient permissions return 403. Fix authentication or permissions; repeating a script cannot resolve these failures.
Operation rejections and layout diagnostics
For OPS_REJECTED, details.rejection identifies the operation code. Fix paths for PARENT_NOT_FOUND/NODE_NOT_FOUND; use frame/group for CANNOT_HAVE_CHILDREN; break ancestry cycles for CYCLE. ROOT_PROTECTED prevents deleting document. Use Replace for IMMUTABLE_FIELD, enabled:false for INSTANCE_CHILD_DELETE, corrected fields for INVALID_VALUE, and an existing source ID for UNKNOWN_REF.
Layout issues do not mean transaction failure. PARTIALLY_CLIPPED and FULLY_CLIPPED mean overflow beyond parent bounds. FIT_FILL_CYCLE means same-axis fit/fill cannot establish a natural size; supply a definite size or fallback. COLLAPSED_SIZE is reserved in the layout type but not emitted by the current layouter; do not rely on it to detect zero sizes. Get ctx.problems only returns clipping strings, not fit/fill cycles. enabled:false nodes and text without fill do not paint, and neither condition guarantees a warning.
Retries and diagnostics
An uncaught script failure rolls back the entire call; corrected scripts restart from the beginning. If a script succeeds but changes the wrong things, restore the earlier version with versions.list and restore (see the overview). Execute has no idempotency-key mechanism. After a network disconnect or INTERNAL, inspect retrieve/nodes.list to see whether a write committed before resending. If only image retrieval failed, retry images.list alone.
Keep canvas_id, versions before/after submission, error code/message/details, execute prints/warnings and viewer_url. Follow the script repair rules to rerun failures and the node reference to fix layout.