Persisted leader/subagent ownership. An explicit ping resumes an independent peer; a managed session stays under its team rule.
Persisted leader/subagent ownership. An explicit ping resumes an independent peer; a managed session stays under its team rule.
Read ATIF as saved conversation records. The records contain no runtime state.
Read ATIF as saved conversation records. The records contain no runtime state.
Cancellation token - leaf module.
The cancellation token lets a UI thread (TUI, REPL caller) abort an
in-flight turn! AND interrupt the worker future hosting the
blocking provider call. The cooperative side is checked at every
iteration boundary; the future side hard-cancels any HTTP call
that has already started.
Public API:
(cancellation-token) - fresh token
(cancellation-atom token) - cooperative flag atom (pass to turn!)
(cancellation-set-future! token fut) - register the worker future
(cancel! token) - set flag + interrupt registered future
(cancel! token reason) - same, stamping WHO cancelled
(cancel-reason token) - the recorded origin of the cancel
(cancelled? token) - true once cancel! has been called
(cancellation? throwable) - true if exception was caused by cancel!
(preserve-interrupt! t) - re-arm the interrupt flag a catch-all ate
This namespace has zero side effects at load time and depends only on Java interop - channels and the runtime can require it directly without pulling in the rest of the SDK.
Cancellation token - leaf module. The cancellation token lets a UI thread (TUI, REPL caller) abort an in-flight `turn!` AND interrupt the worker future hosting the blocking provider call. The cooperative side is checked at every iteration boundary; the future side hard-cancels any HTTP call that has already started. Public API: `(cancellation-token)` - fresh token `(cancellation-atom token)` - cooperative flag atom (pass to `turn!`) `(cancellation-set-future! token fut)` - register the worker future `(cancel! token)` - set flag + interrupt registered future `(cancel! token reason)` - same, stamping WHO cancelled `(cancel-reason token)` - the recorded origin of the cancel `(cancelled? token)` - true once `cancel!` has been called `(cancellation? throwable)` - true if exception was caused by `cancel!` `(preserve-interrupt! t)` - re-arm the interrupt flag a catch-all ate This namespace has zero side effects at load time and depends only on Java interop - channels and the runtime can require it directly without pulling in the rest of the SDK.
Host storage for committed runtime revisions. A single atomic catalog owns every live and turn reference; a session pin protects the revision files.
Host storage for committed runtime revisions. A single atomic catalog owns every live and turn reference; a session pin protects the revision files.
vis-agent sessions commands: list, show, fork, delete, search, export and import
persisted sessions.
`vis-agent sessions` commands: list, show, fork, delete, search, export and import persisted sessions.
Explicit, durable session goals. Only the slash/SDK user path creates or replaces an objective. The model can mark the active objective complete or blocked, but cannot resume, replace, cancel or increase its budget. Every mutation is a CAS on the persisted revision. A goal has no history and no reason: the transcript holds the earlier goals and the replies that explain each status. Completion is a model declaration supported by evidence, not an independent judge.
Explicit, durable session goals. Only the slash/SDK user path creates or replaces an objective. The model can mark the active objective complete or blocked, but cannot resume, replace, cancel or increase its budget. Every mutation is a CAS on the persisted revision. A goal has no history and no reason: the transcript holds the earlier goals and the replies that explain each status. Completion is a model declaration supported by evidence, not an independent judge.
Canonical iteration-entry shape — the single source of truth shared by
the LIVE progress tracker (internal/progress) and the RESUME projection
(channel-tui/chat).
Background: the live-vs-resume split was the root cause of every TUI regression. The live tracker accumulated chunks into one map shape; the resume path rebuilt a different map shape from persisted rows. This ns pins ONE shape both paths populate.
form envelope — one block = one form record (the engine :forms
BLOB), carrying :code, :stdout, :error, and its
settled Activity snapshot. Printed stdout is the single
success surface; op cards / render-fns are gone.
{:position n ;; 0-based display position of the iteration :scope "tN/iM" ;; BLOCK-level scope, never /fK :thinking string-or-nil ;; reasoning text for this iteration :code "<block source>" :forms [<form> ...] ;; form envelopes (engine :forms BLOB) :status :ok|:error|:running|:cancelled|:timeout :duration-ms long :error error-map-or-nil}
Canonical iteration-entry shape — the single source of truth shared by
the LIVE progress tracker (`internal/progress`) and the RESUME projection
(`channel-tui/chat`).
Background: the live-vs-resume split was the root cause of every TUI
regression. The live tracker accumulated chunks into one map shape; the
resume path rebuilt a *different* map shape from persisted rows. This ns
pins ONE shape both paths populate.
## Vocabulary
form envelope — one block = one form record (the engine `:forms`
BLOB), carrying `:code`, `:stdout`, `:error`, and its
settled Activity snapshot. Printed stdout is the single
success surface; op cards / render-fns are gone.
## Canonical iteration-entry
{:position n ;; 0-based display position of the iteration
:scope "tN/iM" ;; BLOCK-level scope, never /fK
:thinking string-or-nil ;; reasoning text for this iteration
:code "<block source>"
:forms [<form> ...] ;; form envelopes (engine :forms BLOB)
:status :ok|:error|:running|:cancelled|:timeout
:duration-ms long
:error error-map-or-nil}Persistent, channel-NEUTRAL per-session model preference.
ONE source of truth — session_soul.llm_pref_provider + llm_pref_model
in the DB — for every channel (web gateway + TUI), so a session routes
through the same PROVIDER + MODEL wherever it's opened and the choice
survives restarts. Provider + model (not just a model name) mirrors how a
turn records its route and disambiguates a model name shared by >1 provider.
The engine reads it at turn start (prepare-turn-context in loop.clj) as
the default route when the caller passes none; router-for-model hoists the
chosen model (the provider follows, since it's the one carrying that model).
DEBOUNCED WRITE-BACK: set-model! updates an in-memory value IMMEDIATELY
(footer + engine see it at once) and coalesces the DB write, so cycling the
model (TUI Ctrl+T) many times in a row produces a SINGLE write. Reads prefer
the pending in-memory value, falling back to the DB.
Values are {:provider <id-string-or-nil> :model <name>} or nil. Keyed by
the session-soul id (the gateway's sid and the engine env's :session-id).
Persistent, channel-NEUTRAL per-session model preference.
ONE source of truth — `session_soul.llm_pref_provider` + `llm_pref_model`
in the DB — for every channel (web gateway + TUI), so a session routes
through the same PROVIDER + MODEL wherever it's opened and the choice
survives restarts. Provider + model (not just a model name) mirrors how a
turn records its route and disambiguates a model name shared by >1 provider.
The engine reads it at turn start (`prepare-turn-context` in loop.clj) as
the default route when the caller passes none; `router-for-model` hoists the
chosen model (the provider follows, since it's the one carrying that model).
DEBOUNCED WRITE-BACK: `set-model!` updates an in-memory value IMMEDIATELY
(footer + engine see it at once) and coalesces the DB write, so cycling the
model (TUI Ctrl+T) many times in a row produces a SINGLE write. Reads prefer
the pending in-memory value, falling back to the DB.
Values are `{:provider <id-string-or-nil> :model <name>}` or nil. Keyed by
the session-soul id (the gateway's `sid` and the engine env's `:session-id`).Session runtime adapters and the boot catalog. An environment pins its adapter.
Session runtime adapters and the boot catalog. An environment pins its adapter.
The .vissnap session snapshot file (#405). A program reads its JSON manifest without
a JVM; only the engine reads the payload.
Layout, format version 1:
magic 8 bytes, VISSNAP and a zero byte
version 4 bytes, big-endian
length 4 bytes, big-endian, the manifest length
manifest UTF-8 JSON
payload the Nippy-frozen rows of one session tree, Zstandard-compressed
The manifest holds the format and Vis versions, the creation time, the root session, the session tree, counts, sizes and the payload SHA-256. A decode checks the digest before it thaws the payload.
The `.vissnap` session snapshot file (#405). A program reads its JSON manifest without a JVM; only the engine reads the payload. Layout, format version 1: magic 8 bytes, `VISSNAP` and a zero byte version 4 bytes, big-endian length 4 bytes, big-endian, the manifest length manifest UTF-8 JSON payload the Nippy-frozen rows of one session tree, Zstandard-compressed The manifest holds the format and Vis versions, the creation time, the root session, the session tree, counts, sizes and the payload SHA-256. A decode checks the digest before it thaws the payload.
Session-title subsystem, lifted out of the loop namespace: the three listener
registries (per-session value, global, and the pending/spinner channel), the
single set-title-with-broadcast! mutation point, and the async auto-title
side-channel (an off-surface ask! that names a session on its first
real turn). A LEAF — depends only on persistance, svar, runtime settings and
the provider catalog, never back on the loop.
Session-title subsystem, lifted out of the loop namespace: the three listener registries (per-session value, global, and the pending/spinner channel), the single `set-title-with-broadcast!` mutation point, and the async auto-title side-channel (an off-surface `ask!` that names a session on its first real turn). A LEAF — depends only on persistance, svar, runtime settings and the provider catalog, never back on the loop.
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 |