Execution of one model-written block in the session's persistent Python interpreter.
Rejects blocks that are not code, runs a block with timing and Activity
reporting, interrupts and unwinds a runaway block, and retires a worker that
does not unwind. policy-reload-epoch counts /reloads; an environment built
under an older epoch is replaced unless the reload left its policy unchanged.
Execution of one model-written block in the session's persistent Python interpreter. Rejects blocks that are not code, runs a block with timing and Activity reporting, interrupts and unwinds a runaway block, and retires a worker that does not unwind. `policy-reload-epoch` counts `/reload`s; an environment built under an older epoch is replaced unless the reload left its policy unchanged.
(execute-code environment code & {:keys [timeout-ms tool-event-fn]})Run a single :code block through the Python sandbox.
Optional kwargs: :timeout-ms - hard-cap eval time, clamped at the rt/eval-timeout-ms bounds.
Every call performs a real Python eval. There is no result cache: forms with side effects MUST run their bodies on every invocation, and forms without side effects re-run cheaply enough that caching them is not worth the correctness footgun.
Run a single :code block through the Python sandbox.
Optional kwargs:
:timeout-ms - hard-cap eval time, clamped at the
rt/*eval-timeout-ms* bounds.
Every call performs a real Python eval. There is no result cache:
forms with side effects MUST run their bodies on every
invocation, and forms without side effects re-run cheaply enough
that caching them is not worth the correctness footgun.(get-locals _environment)User-defined sandbox vars surface. Live-vars introspection is cosmetic-off for the Python engine (the agent uses its own Python scope + stdlib), so this returns an empty map. Kept as a stable seam for the trailer/renderer callers.
User-defined sandbox vars surface. Live-vars introspection is cosmetic-off for the Python engine (the agent uses its own Python scope + stdlib), so this returns an empty map. Kept as a stable seam for the trailer/renderer callers.
Monotonic /reload epoch. Every /reload bumps it (via a reload hook).
The hook reads the policy of each live env again. An env with the same policy
takes the new epoch and keeps its sandbox (#408). For the other envs, stale idle
sandboxes close immediately and busy ones close after their turn. The next turn
rebuilds the immutable security-policy snapshot from the freshly-reloaded vis.yml.
The snapshot drives the Python session, egress proxy, and process jail at
env-creation time, so it can only change by rebuilding the env, never by an
in-place reseat.
Monotonic `/reload` epoch. Every `/reload` bumps it (via a reload hook). The hook reads the policy of each live env again. An env with the same policy takes the new epoch and keeps its sandbox (#408). For the other envs, stale idle sandboxes close immediately and busy ones close after their turn. The next turn rebuilds the immutable security-policy snapshot from the freshly-reloaded vis.yml. The snapshot drives the Python session, egress proxy, and process jail at env-creation time, so it can only change by rebuilding the env, never by an in-place reseat.
(retire-python-context-once! python-context environment reason error)Stop the old context before another call can dispose or replace it.
Stop the old context before another call can dispose or replace it.
(set-history-owner-fn! f)Set the function that returns this process as owner of durable Activity history.
Set the function that returns this process as owner of durable Activity history.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |