Liking cljdoc? Tell your friends :D

com.blockether.vis.internal.session.agents

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.
raw docstring

askclj

(ask env question)
(ask env question opts)

As a subagent, ask your parent for a decision and wait for the reply text. Returns None when the parent is not running or does not reply within timeout_secs (default 600). Then choose the safest option and say so in your answer.

As a subagent, ask your parent for a decision and wait for the reply text. Returns None when
the parent is not running or does not reply within timeout_secs (default 600). Then choose the
safest option and say so in your answer.
sourceraw docstring

ask-budgetclj

(ask-budget env iterations reason)
(ask-budget env iterations reason opts)

As a subagent, ask your parent for more model iterations and wait for the answer. Ask before your budget ends, with the number that you need and the reason. Returns a dict with granted (0 when the parent refuses), iteration_budget and reply. reply is None when the parent is not running or does not answer within timeout_secs (default 600).

As a subagent, ask your parent for more model iterations and wait for the answer. Ask before
your budget ends, with the number that you need and the reason. Returns a dict with granted
(0 when the parent refuses), iteration_budget and reply. reply is None when the parent is not
running or does not answer within timeout_secs (default 600).
sourceraw docstring

cancel-agentclj

(cancel-agent env session-id)

Cancel a subagent and its descendants, including queued work. Returns its record.

Cancel a subagent and its descendants, including queued work. Returns its record.
sourceraw docstring

checkpoint!clj

(checkpoint! env messages)

Capture the last complete model input, before its in-flight tool call. Never copy runtime handles.

Capture the last complete model input, before its in-flight tool call. Never copy runtime handles.
sourceraw docstring

claim-iteration!clj

(claim-iteration! env)

Reserve one model iteration. A child budget is durable across replies, turns and restarts. When the budget ends in a turn, that turn gets one more iteration without a claim for the handoff of the child. A later claim refuses, and the child becomes budget_limited.

Reserve one model iteration. A child budget is durable across replies, turns and restarts.
When the budget ends in a turn, that turn gets one more iteration without a claim for the
handoff of the child. A later claim refuses, and the child becomes `budget_limited`.
sourceraw docstring

contextclj

(context env)
source

controls?clj

(controls? db actor-id target-id)

Leaders control their descendants. Subagents control themselves and their direct children.

Leaders control their descendants. Subagents control themselves and their direct children.
sourceraw docstring

default-iterationsclj

source

deny-agentclj

(deny-agent env session-id reason)

Refuse the open budget request of a subagent, with a short reason. The child keeps its budget and ends with a handoff. Returns the record.

Refuse the open budget request of a subagent, with a short reason. The child keeps its budget
and ends with a handoff. Returns the record.
sourceraw docstring

enabled?clj

(enabled? db sid)

Whether session sid can use managed subagents. A new session starts without the session settings of its source, so a managed child reads the setting of its leader. Without such a session setting, or with an invocation value, the configuration decides.

Whether session `sid` can use managed subagents. A new session starts without the session
settings of its source, so a managed child reads the setting of its leader. Without such a
session setting, or with an invocation value, the configuration decides.
sourceraw docstring

extend-agentclj

(extend-agent env session-id iterations)

Give a subagent more model iterations. Use it to answer a budget request (status asking with budget_request), or before council.resume of a budget_limited child. A budget stays at most 600, and a subagent can give only its own remaining iterations. Returns the record.

Give a subagent more model iterations. Use it to answer a budget request (status asking with
budget_request), or before council.resume of a budget_limited child. A budget stays at most
600, and a subagent can give only its own remaining iterations. Returns the record.
sourceraw docstring

fail!clj

(fail! error message)
source

finish!clj

(finish! db sid status)

Store the status of a finished child turn. A child that ended its turn in its handoff iteration becomes budget_limited, so its parent knows that it needs council.extend before council.resume. A child that answered within its budget is completed.

Store the status of a finished child turn. A child that ended its turn in its handoff
iteration becomes `budget_limited`, so its parent knows that it needs council.extend before
council.resume. A child that answered within its budget is `completed`.
sourceraw docstring

infoclj

(info db sid)
source

inherited-baseclj

(inherited-base env turn-position current-messages summaries)
source

install-runtime!clj

(install-runtime! callbacks)
source

max-active-childrenclj

source

max-depthclj

source

max-team-childrenclj

source

operation!clj

(operation! env operation opts)
source

promptclj

(prompt env)
source

queue-turn!clj

(queue-turn! db sid)

Queue subagent sid for a follow-up turn. A Council ping and council.resume both use it, so council.wait reports only the answer of the new turn. A follow-up can pass the active cap; only a new spawn counts against it. Answers a function that undoes the change, or nil when the child is cancelled or has no iterations left. A child that already runs stays as is.

Queue subagent `sid` for a follow-up turn. A Council ping and council.resume both use it, so
council.wait reports only the answer of the new turn. A follow-up can pass the active cap; only
a new spawn counts against it. Answers a function that undoes the change, or nil when the child
is cancelled or has no iterations left. A child that already runs stays as is.
sourceraw docstring

reconcile-orphans!clj

(reconcile-orphans! db live-sids)

Fail the children that a dead process left queued or running. Spare a child or a leader that live-sids names: a live process still owns that team. Returns the count.

Fail the children that a dead process left queued or running. Spare a child or a leader
that `live-sids` names: a live process still owns that team. Returns the count.
sourceraw docstring

refusal-answerclj

(refusal-answer env report)

The answer of a child turn that claim-iteration! stopped: the stop reason, then the last report of the turn. Without a report, it names where the parent can read the work.

The answer of a child turn that `claim-iteration!` stopped: the stop reason, then the last
report of the turn. Without a report, it names where the parent can read the work.
sourceraw docstring

require-enabled!clj

(require-enabled! db sid)

Refuse new managed work before bootstrapping a session or consuming a checkpoint.

Refuse new managed work before bootstrapping a session or consuming a checkpoint.
sourceraw docstring

restrict-routerclj

(restrict-router env router)

Apply an inherited allowlist to every request and retry, including automatic fallback.

Apply an inherited allowlist to every request and retry, including automatic fallback.
sourceraw docstring

resume-agentclj

(resume-agent env session-id task)
(resume-agent env session-id task opts)

Give a finished subagent a follow-up task in its own session, with its whole context. Then wait like council.run and return the records. A Council ping continues the child the same way, without the wait. A child without iterations left needs council.extend first. A running child needs council.wait. timeout_secs defaults to 240 (max 1800).

Give a finished subagent a follow-up task in its own session, with its whole context. Then
wait like council.run and return the records. A Council ping continues the child the same way,
without the wait. A child without iterations left needs council.extend first. A running child
needs council.wait. timeout_secs defaults to 240 (max 1800).
sourceraw docstring

routing-changeclj

(routing-change env before)

The route command issued for this session since before, as {:preference {:provider :model} :command command}, or nil. Agent routing and the engine's authentication rescue issue commands; a manual pick is composer state that the next submitted turn snapshots, so it never re-routes a running turn.

The route command issued for this session since `before`, as
`{:preference {:provider :model} :command command}`, or nil. Agent routing and the
engine's authentication rescue issue commands; a manual pick is composer state that
the next submitted turn snapshots, so it never re-routes a running turn.
sourceraw docstring

runclj

(run env tasks)
(run env tasks opts)

Run each task in its own subagent and wait for all of them. A task is a string or a dict with task and optional model, provider, iteration_budget and context. iteration_budget defaults to 120 (max 600). Give a large task more at the start.

A child uses your model and your full context. A child on another model gets only the system prompt and its task, unless context is "full". Children share the checkout.

Records have session_id, status, answer and question. More than 16 tasks start as earlier ones finish. timeout_secs defaults to 240 (max 1800). If a status is still running, call council.wait. lost means the child stopped without an answer.

asking with budget_request needs council.extend or council.deny. budget_limited needs council.extend before council.resume, and it stays budget_limited until council.resume.

Run each task in its own subagent and wait for all of them. A task is a string or a dict with
task and optional model, provider, iteration_budget and context. iteration_budget defaults to
120 (max 600). Give a large task more at the start.

A child uses your model and your full context. A child on another model gets only the system
prompt and its task, unless context is "full". Children share the checkout.

Records have session_id, status, answer and question. More than 16 tasks start as earlier ones
finish. timeout_secs defaults to 240 (max 1800). If a status is still running, call
council.wait. lost means the child stopped without an answer.

asking with budget_request needs council.extend or council.deny. budget_limited needs
council.extend before council.resume, and it stays budget_limited until council.resume.
sourceraw docstring

stop-reasonclj

(stop-reason env)

Give the cause when claim-iteration! refuses the child session of env.

Give the cause when `claim-iteration!` refuses the child session of `env`.
sourceraw docstring

symbolsclj

source

wait-agentsclj

(wait-agents env)
(wait-agents env ids-or-opts)
(wait-agents env ids opts)

Wait again for subagents by session_ids (default: all your children). Same records and timeout as council.run.

Wait again for subagents by session_ids (default: all your children). Same records and timeout as council.run.
sourceraw docstring

wake-allowed?clj

(wake-allowed? db author-id recipient-id)

Automatic resume has two sources: an explicit ping between independent sessions, and a managed team. A child may return to its leader; siblings must share a task team. A managed session keeps its team rule, so a cancelled or exhausted subagent stays idle. Only a managed subagent wakes itself; an independent session stays idle.

Automatic resume has two sources: an explicit ping between independent sessions, and
a managed team. A child may return to its leader; siblings must share a task team.
A managed session keeps its team rule, so a cancelled or exhausted subagent stays idle.
Only a managed subagent wakes itself; an independent session stays idle.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close