Skip to content
中文

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

ItemValueRule
Script65536 JS string unitsShorten source; this is not a UTF-8 byte count.
VM memory32 MiBReduce objects and arrays.
VM stack1 MiBReduce recursion depth.
Interrupt polls20000Bound loops and split calls; this is not milliseconds or a JS instruction count.
Recorded operations5000 / executeAn Insert tree is one operation; ordinary Replace is two.
Printcumulative 65536 JS string unitsReduce output; includes spaces between values, not newlines between output entries.
TakeScreenshot4 IDs / executeExtras silently ignored; duplicates also count.
Active execute slots4 / canvasNew execute calls are rejected once 4 slots are occupied.
edit_id10 minutesMeasured from saving a failure; unknown/expired IDs need new source.
nodes.list ids1–100 / callComma-separated; missing nodes are null.
nodes.list depthnonnegative integerOmission reads the full subtree.
images.list ids1–4 / callPNG data URL; missing nodes are null.
images.list scale0.25–4, default 1Only format:png is supported.
Incremental transaction historylatest 500 revisionsCatch-up window for live viewers, not a version backup; outside it a full resync is needed.
Version historyall from 30 days; newest 100 alwaysOldest pruned first above 256 MiB; the oldest restorable version is earliest_restorable_version in versions.list.
execute warningsup to 8 touched top nodes, 20 eachNot 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

codeHTTPCause and action
CANVAS_NOT_FOUND404Canvas missing, deleted or outside this organization. Choose an accessible ID from list; do not retry unchanged.
NODE_NOT_FOUND404Target node missing. Read current nodes and fix the ID. Missing images.list nodes normally return null.
REVISION_CONFLICT409expected_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_BUSY429All execute slots on this canvas are occupied. Wait for in-flight calls before retrying; avoid parallel edits to the same canvas.
SCRIPT_ERROR400Syntax/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_FOUND404The version does not exist, predates history or was pruned; pick an available version from versions.list.
SCRIPT_LIMIT400VM 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_REJECTED400Illegal node operation. Inspect rejection for parent, immutable field, cycle, negative size or invalid reference; fix before retrying.
EDIT_EXPIRED400edit_id unknown or older than ten minutes. Send corrected full script.
INVALID_PARAMS400Invalid request JSON, ids, depth, scale, format or other input. Correct the field constraints.
INVALID_PAGE_TOKEN400Invalid pagination cursor. Drop cursor and restart list at the first page.
RENDER_FAILED503Node produced no image or rendering failed. Check dimensions/references before retrying.
NOT_IMPLEMENTED501Capability unavailable. Do not retry unchanged; use documented capabilities.
INTERNAL500Internal 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.