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.
(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.
(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).
(ask-files env files reason)(ask-files env files reason opts)As a subagent, ask your parent for file access and wait for the answer. files holds write, read_only and deny rules: paths or globs, absolute, ~ or relative to the parent's workspace root. Returns a dict with granted, files (your grant now), missing and reply. granted is True only when the grant covers every write rule that you asked for. missing lists the others. reply is None when the parent is not running or does not answer within timeout_secs (default 600).
After a grant, your Python sandbox restarts before the next block and restores your saved helpers.
As a subagent, ask your parent for file access and wait for the answer. files holds write, read_only and deny rules: paths or globs, absolute, ~ or relative to the parent's workspace root. Returns a dict with granted, files (your grant now), missing and reply. granted is True only when the grant covers every write rule that you asked for. missing lists the others. reply is None when the parent is not running or does not answer within timeout_secs (default 600). After a grant, your Python sandbox restarts before the next block and restores your saved helpers.
(cancel-agent env session-id)Cancel a subagent, including its queued work. Returns its record.
Cancel a subagent, including its queued work. Returns its record.
(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.
(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`.
(controls? db actor-id target-id)A leader controls its children. A subagent controls only itself.
A leader controls its children. A subagent controls only itself.
(deny-agent env session-id reason)Refuse the open budget or file request of a subagent, with a short reason. The child keeps its budget and its files. Returns the record.
Refuse the open budget or file request of a subagent, with a short reason. The child keeps its budget and its files. Returns the record.
(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.
(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. 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. Returns the record.
(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`.
(grant-files env session-id files)Add file rules to the grant of a subagent. Use it to answer a file request (status asking with files_request), or before council.resume. files holds write, read_only and deny rules, like a task dict. Returns the record, with a warning when an active sibling can write the same files.
A grant gives at most your own access. A write rule outside your writable roots or under your deny rules fails, and your deny rules stay closed to the child. A child without write rules writes only the granted rules after a write grant. The child gets the new access at its next block.
Add file rules to the grant of a subagent. Use it to answer a file request (status asking with files_request), or before council.resume. files holds write, read_only and deny rules, like a task dict. Returns the record, with a warning when an active sibling can write the same files. A grant gives at most your own access. A write rule outside your writable roots or under your deny rules fails, and your deny rules stay closed to the child. A child without write rules writes only the granted rules after a write grant. The child gets the new access at its next block.
(handoff messages)The parent's model input without tool work, like a Codex fork. It keeps system messages, requests, fold gists, Council messages, notes and answers. It drops tool calls, tool results and reasoning, and joins neighbouring text of one role. A closing message marks the conversation as the parent's context, so a child does not act on the parent's requests.
The parent's model input without tool work, like a Codex fork. It keeps system messages, requests, fold gists, Council messages, notes and answers. It drops tool calls, tool results and reasoning, and joins neighbouring text of one role. A closing message marks the conversation as the parent's context, so a child does not act on the parent's requests.
(leader-id db sid)The leader of session sid as a string: the team leader for a subagent, else sid.
The leader of session `sid` as a string: the team leader for a subagent, else `sid`.
(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.
(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.
(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.
(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.
(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.
(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).
(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.(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 files. iteration_budget defaults to 120 (max 600). Give a large task more at the start.
files is a file grant: {"write": [...], "read_only": [...], "deny": [...]}. Each rule is a path or a glob, relative to your workspace root, ~ or absolute, and also covers files that do not exist yet. With write, the child can change only the files that its rules match.
A child gets the system prompt, your requests, notes and answers, and its task. It does not get your tool calls or their output. Children share the checkout. Only a leader starts subagents.
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. asking with files_request needs council.grant 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 files. iteration_budget defaults to
120 (max 600). Give a large task more at the start.
files is a file grant: {"write": [...], "read_only": [...], "deny": [...]}. Each rule is a
path or a glob, relative to your workspace root, ~ or absolute, and also covers files that do
not exist yet. With write, the child can change only the files that its rules match.
A child gets the system prompt, your requests, notes and answers, and its task. It does not get
your tool calls or their output. Children share the checkout. Only a leader starts subagents.
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. asking with files_request
needs council.grant or council.deny. budget_limited needs council.extend before council.resume,
and it stays budget_limited until council.resume.(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`.
(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.
(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.
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 |