Skip to content
Sign in

harness

v1.10.2

Thin durable turn loop that wires session-manager, context-manager, and llm-router into an agent loop; spawns sub-agents as child sessions.

license: Apache-2.0Used in 4 kitsagentautonomousharnessloop

Install

bash
iii call compose::add worker=harness@1.10.2

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Functions58

harness::ask

Function

Ask the user for a decision between discrete options: 1-4 questions, 2-4 options each; the UI adds a free-text "Other" choice, so do not include one. The questions are shown as a clickable card in the chat and stay open while you do other work. The answer arrives as a user message (one `Header: answer` line per question; a skipped question reads `(skipped)`, and a dismissed card sends a notice instead of answers), so do not repeat the questions in text. Set `about.class` to `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. It defaults to `scope` for other questions. Not available to sub-agents or structured-output turns.

Request
  • aboutall of

    What this decision concerns and what it blocks.

    all of (1)
    Variant 1
    • blocksstring[]

      Cards whose work waits on this answer.

    • classall of

      Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

      Show 1 nested
      all of (1)
      Variant 1
      valuestringenum security, publish, external_cost, data, scope, run_health, …
    • ticketstring

      The card this question concerns.

    • whystring

      One paragraph explaining why the answer is needed.

  • expires_in_mininteger· uint64min 0

    Minutes until the expiry action runs. Omitted asks wait forever.

  • on_expiryall of

    What to do at expiry. Defaults to leaving the question open and telling the agent that it must not decide for the user.

    all of (1)
    Variant 1
    any of (2)
    Variant 1
    • answerstringrequired
    Variant 2
    valuestringenum block
  • questionsobject[]required1…4 items

    1-4 questions shown together on one card; the answer arrives as the user's next message, one line per question.

    • headerstringrequiredmin 1 chars

      Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

    • multi_selectboolean

      Let the user pick several options (checkboxes) instead of one.

    • optionsobject[]required2…4 items

      2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

      • descriptionstring

        Optional one-line explanation shown under the label.

      • labelstringrequired1…80 chars

        The choice as the user sees and sends it, 1-80 characters, unique within its question.

      • recommendedboolean

        Marks the agent's preferred choice. At most one option per question.

    • questionstringrequiredmin 1 chars

      The full question text shown above the options.

Response
  • aboutobject
    • blocksstring[]

      Cards whose work waits on this answer.

    • classall of

      Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

      all of (1)
      Variant 1
      valuestringenum security, publish, external_cost, data, scope, run_health, …
    • ticketstring

      The card this question concerns.

    • whystring

      One paragraph explaining why the answer is needed.

  • expires_in_mininteger· uint64min 0
  • on_expiryany of
    any of (2)
    Variant 1
    • answerstringrequired
    Variant 2
    valuestringenum block
  • question_idstringrequired

    The function-call id of this ask.

  • questionsobject[]required

    The questions as shown, in request order.

    • headerstringrequiredmin 1 chars

      Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

    • multi_selectboolean

      Let the user pick several options (checkboxes) instead of one.

    • optionsobject[]required2…4 items

      2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

      • descriptionstring

        Optional one-line explanation shown under the label.

      • labelstringrequired1…80 chars

        The choice as the user sees and sends it, 1-80 characters, unique within its question.

      • recommendedboolean

        Marks the agent's preferred choice. At most one option per question.

    • questionstringrequiredmin 1 chars

      The full question text shown above the options.

  • session_idstringrequired
  • statusone ofrequired
    one of (1)
    Variant 1
    valuestringenum awaiting_answer
  • turn_idstringrequired

    The turn that asked; the question remains open if the session moves on.

harness::ask::answer

Function

Answer a durable ask; only human console/operator calls may answer.

Request
  • answersobject[]
    • choicestring
    • choicesstring[]
    • headerstringrequired
    • otherstring
    • skippedboolean
  • byobjectrequired
    • channelstringrequiredenum chat, control-plane, kanban, expiry
    • userstring
  • dismissedboolean
  • question_idstringrequired
  • session_idstringrequired
Response
  • aboutobjectrequired
    • blocksstring[]

      Cards whose work waits on this answer.

    • classall of

      Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

      all of (1)
      Variant 1
      valuestringenum security, publish, external_cost, data, scope, run_health, …
    • ticketstring

      The card this question concerns.

    • whystring

      One paragraph explaining why the answer is needed.

  • answer_textstring
  • answersobject[]
    • choicestring
    • choicesstring[]
    • headerstringrequired
    • otherstring
    • skippedboolean
  • asked_atinteger· int64required
  • asked_bystring

    Asking agent profile id, when the session has a frozen profile.

  • byany of
    any of (2)
    Variant 1
    • channelstringrequiredenum chat, control-plane, kanban, expiry
    • userstring
    Variant 2
    valuenull
  • expires_atinteger· int64
  • expires_in_mininteger· uint64min 0
  • on_expiryany ofrequired
    any of (2)
    Variant 1
    • answerstringrequired
    Variant 2
    valuestringenum block
  • outcomeany of
    any of (2)
    Variant 1
    valuestringenum answered, dismissed, withdrawn, expired_default, not_delivered
    Variant 2
    valuenull
  • question_idstringrequired
  • questionsobject[]required
    • headerstringrequiredmin 1 chars

      Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

    • multi_selectboolean

      Let the user pick several options (checkboxes) instead of one.

    • optionsobject[]required2…4 items

      2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

      • descriptionstring

        Optional one-line explanation shown under the label.

      • labelstringrequired1…80 chars

        The choice as the user sees and sends it, 1-80 characters, unique within its question.

      • recommendedboolean

        Marks the agent's preferred choice. At most one option per question.

    • questionstringrequiredmin 1 chars

      The full question text shown above the options.

  • session_idstringrequired
  • settled_atinteger· int64
  • statestringrequiredenum open, answering, answered, dismissed, withdrawn, expired
  • turn_idstringrequired

harness::ask::list

Function

List durable asks, including closed entries, with optional session and state filters.

Request
  • cursorstring

    The last key returned by the previous page (exclusive).

  • limitinteger· uintmin 0
  • session_idstring
  • stateany of
    any of (2)
    Variant 1
    valuestringenum open, answering, answered, dismissed, withdrawn, expired
    Variant 2
    valuenull
Response
  • cursorstring
  • entriesobject[]required
    • aboutobjectrequired
      • blocksstring[]

        Cards whose work waits on this answer.

      • classall of

        Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

        Show 1 nested
        all of (1)
        Variant 1
        valuestringenum security, publish, external_cost, data, scope, run_health, …
      • ticketstring

        The card this question concerns.

      • whystring

        One paragraph explaining why the answer is needed.

    • answer_textstring
    • answersobject[]
      • choicestring
      • choicesstring[]
      • headerstringrequired
      • otherstring
      • skippedboolean
    • asked_atinteger· int64required
    • asked_bystring

      Asking agent profile id, when the session has a frozen profile.

    • byany of
      any of (2)
      Variant 1
      • channelstringrequiredenum chat, control-plane, kanban, expiry
      • userstring
      Variant 2
      valuenull
    • expires_atinteger· int64
    • expires_in_mininteger· uint64min 0
    • on_expiryany ofrequired
      any of (2)
      Variant 1
      • answerstringrequired
      Variant 2
      valuestringenum block
    • outcomeany of
      any of (2)
      Variant 1
      valuestringenum answered, dismissed, withdrawn, expired_default, not_delivered
      Variant 2
      valuenull
    • question_idstringrequired
    • questionsobject[]required
      • headerstringrequiredmin 1 chars

        Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

      • multi_selectboolean

        Let the user pick several options (checkboxes) instead of one.

      • optionsobject[]required2…4 items

        2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

        Show 3 nested
        • descriptionstring

          Optional one-line explanation shown under the label.

        • labelstringrequired1…80 chars

          The choice as the user sees and sends it, 1-80 characters, unique within its question.

        • recommendedboolean

          Marks the agent's preferred choice. At most one option per question.

      • questionstringrequiredmin 1 chars

        The full question text shown above the options.

    • session_idstringrequired
    • settled_atinteger· int64
    • statestringrequiredenum open, answering, answered, dismissed, withdrawn, expired
    • turn_idstringrequired

harness::ask::settle

Function

Internal control-plane: record that a harness::ask card was answered through the card or dismissed, so every client shows it settled.

Request
  • outcomeone ofrequired
    one of (2)
    Variant 1
    valuestringenum answered
    Variant 2
    valuestringenum dismissed
  • question_idstringrequired

    The ask's function-call id (`harness::ask` result `question_id`).

  • session_idstringrequired
Response
  • settlementsobject[]required

    The session's settlements, oldest first (at most `ask_settlement::MAX_SETTLEMENTS`).

    • outcomeone ofrequired
      one of (2)
      Variant 1
      valuestringenum answered
      Variant 2
      valuestringenum dismissed
    • question_idstringrequired

      The function-call id of the ask (`AskResponse::question_id`).

    • settled_atinteger· int64required

      Unix milliseconds.

harness::ask::settlements

Function

Internal control-plane: list which harness::ask cards in a session were answered or dismissed (the console's ask card reads this).

Request
  • session_idstringrequired
Response
  • settlementsobject[]required

    The session's settlements, oldest first (at most `ask_settlement::MAX_SETTLEMENTS`).

    • outcomeone ofrequired
      one of (2)
      Variant 1
      valuestringenum answered
      Variant 2
      valuestringenum dismissed
    • question_idstringrequired

      The function-call id of the ask (`AskResponse::question_id`).

    • settled_atinteger· int64required

      Unix milliseconds.

harness::ask::withdraw

Function

Withdraw a question that no longer needs an answer. Agent calls always target their own session.

Request
  • question_idstringrequired
  • session_idstring

    Stamped by the harness for an agent call; operators supply it explicitly.

Response
  • aboutobjectrequired
    • blocksstring[]

      Cards whose work waits on this answer.

    • classall of

      Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

      all of (1)
      Variant 1
      valuestringenum security, publish, external_cost, data, scope, run_health, …
    • ticketstring

      The card this question concerns.

    • whystring

      One paragraph explaining why the answer is needed.

  • answer_textstring
  • answersobject[]
    • choicestring
    • choicesstring[]
    • headerstringrequired
    • otherstring
    • skippedboolean
  • asked_atinteger· int64required
  • asked_bystring

    Asking agent profile id, when the session has a frozen profile.

  • byany of
    any of (2)
    Variant 1
    • channelstringrequiredenum chat, control-plane, kanban, expiry
    • userstring
    Variant 2
    valuenull
  • expires_atinteger· int64
  • expires_in_mininteger· uint64min 0
  • on_expiryany ofrequired
    any of (2)
    Variant 1
    • answerstringrequired
    Variant 2
    valuestringenum block
  • outcomeany of
    any of (2)
    Variant 1
    valuestringenum answered, dismissed, withdrawn, expired_default, not_delivered
    Variant 2
    valuenull
  • question_idstringrequired
  • questionsobject[]required
    • headerstringrequiredmin 1 chars

      Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

    • multi_selectboolean

      Let the user pick several options (checkboxes) instead of one.

    • optionsobject[]required2…4 items

      2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

      • descriptionstring

        Optional one-line explanation shown under the label.

      • labelstringrequired1…80 chars

        The choice as the user sees and sends it, 1-80 characters, unique within its question.

      • recommendedboolean

        Marks the agent's preferred choice. At most one option per question.

    • questionstringrequiredmin 1 chars

      The full question text shown above the options.

  • session_idstringrequired
  • settled_atinteger· int64
  • statestringrequiredenum open, answering, answered, dismissed, withdrawn, expired
  • turn_idstringrequired

harness::compact

Function

Compact a session's conversation now and wait for the outcome: summarise its older history with the session's (or the named) model, keep the recent tail verbatim, and tell every client watching the session. `/compact` through harness::send starts the same compaction without waiting.

Request
  • instructionsstring

    Guidance for the summariser: what to keep, drop, or emphasise. Steers this compaction only.

  • modelstring

    The model that writes the summary; omitted, the session's last turn's.

  • providerstring
  • session_idstringrequired
Response
  • compaction_idstringrequired
  • entry_idsstring[]required

    The transcript rows it wrote, in order: the start notice (absent when it never started) and the outcome row.

  • messagestringrequired

    The outcome as every client shows it.

  • session_idstringrequired
  • statusone ofrequired
    one of (4)
    Variant 1
    valuestringenum ok
    Variant 2
    valuestringenum busy
    Variant 3
    valuestringenum empty
    Variant 4
    valuestringenum failed
  • summarystring
  • tokens_afterinteger· uint64min 0
  • tokens_beforeinteger· uint64min 0

harness::context-policy

Function

Return the Harness context-pruning policy for a destination model without making a model request.

Request
  • modelstringrequired
Response
  • allow_prunebooleanrequired

    Whether aged function results may be pruned for this model.

harness::delete-session-tree

Function

Durably cancel and delete only the selected session subtree; returns an operation snapshot.

Request
  • session_idstringrequired
Response
  • attemptinteger· uint32requiredmin 1

    Initial attempt is 1; only an explicit failed-operation retry increments it.

  • deleted_session_idsstring[]required
  • errorstring
  • operation_idstringrequired
  • session_idstringrequired
  • statusstringrequiredenum deleting, completed, failed

harness::delete-session-tree-run

Function

Internal queued subtree deletion continuation.

Request
  • operation_idstringrequired
Response
any of (2)
Variant 1
  • attemptinteger· uint32requiredmin 1

    Initial attempt is 1; only an explicit failed-operation retry increments it.

  • deleted_session_idsstring[]required
  • errorstring
  • operation_idstringrequired
  • session_idstringrequired
  • statusstringrequiredenum deleting, completed, failed
Variant 2
valuenull

harness::delete-session-tree-status

Function

Read a durable session subtree deletion snapshot, or null if unknown.

Request
  • operation_idstringrequired
Response
any of (2)
Variant 1
  • attemptinteger· uint32requiredmin 1

    Initial attempt is 1; only an explicit failed-operation retry increments it.

  • deleted_session_idsstring[]required
  • errorstring
  • operation_idstringrequired
  • session_idstringrequired
  • statusstringrequiredenum deleting, completed, failed
Variant 2
valuenull

harness::edit_queued

Function

Internal control-plane: edit a still-parked queued message in place by entry_id, preserving its queue position.

Request
  • entry_idstringrequired

    The queued row to edit (its client-visible `entry_id`).

  • messagestringrequired

    The replacement user message text.

  • session_idstringrequired
Response
  • updatedbooleanrequired

    False when no still-parked row matched — already drained or unknown.

harness::filesystem::grant

Function

Internal control-plane: grant a session access to an additional filesystem root.

Request
  • rootstringrequired
  • session_idstringrequired
Response
  • rootsstring[]required
  • session_idstringrequired

harness::filesystem::grants

Function

Internal control-plane: list additional filesystem roots granted to a session.

Request
  • session_idstringrequired
Response
  • rootsstring[]required
  • session_idstringrequired

harness::filesystem::info

Function

Internal control-plane: the default working-directory root new sessions are scoped to.

Request
Empty object
Response
  • boundaryall ofrequired

    Effective per-session boundary for shell/coder calls: the configured `filesystem_boundary`, or under `auto`, `workspace` when the filesystem approval hook can widen it, otherwise `configured_roots`.

    all of (1)
    Variant 1
    valuestringenum workspace, configured_roots
  • default_rootstring

    Working-directory root stamped onto the first turn of a session whose send carries no explicit `fs_scope.root`; `null` when defaulting is disabled (`default_filesystem_root: "off"`) or neither `III_COMPOSE_DIR` nor the cwd is available.

harness::filesystem::revoke

Function

Internal control-plane: revoke a session's access to an additional filesystem root.

Request
  • rootstringrequired
  • session_idstringrequired
Response
  • rootsstring[]required
  • session_idstringrequired

harness::function::call

Function

Internal: invoke one iii function (unwrapped from agent_call), enforce the dispatch policy, and capture the normalised result — or report it pending.

Request
  • callobjectrequired
    • argumentsunknownrequired
    • function_idstringrequired

      The iii function to invoke (already unwrapped from `agent_call`).

    • idstringrequired

      function_call id, echoed into the result.

  • session_idstringrequired
Response
any of (2)
Variant 1
  • contentone of[]required
    one of (7)
    Variant 1
    • textstringrequired
    • typestringrequiredenum text
    Variant 2
    • attachment_idstring

      Optional link to the stored original of this inline image (`session::put-attachment`, resolvable with `session::get-attachment`). Lets readers ask `session::messages { include_image_data: false }` and fetch the bytes lazily instead of receiving them inline. Persisted verbatim on the transcript; model-bound consumers never see it (see [`ContentBlock::strip_files`]). Omitted on the wire when absent so legacy transcripts stay byte-identical.

    • datastringrequired
    • mimestringrequired
    • typestringrequiredenum image
    Variant 3
    • attachment_idstringrequired
    • mimestringrequired
    • namestringrequired
    • sizeinteger· uint64requiredmin 0
    • typestringrequiredenum file
    Variant 4
    • signaturestring
    • textstringrequired
    • typestringrequiredenum thinking
    Variant 5
    • datastringrequired
    • typestringrequiredenum redacted_thinking
    Variant 6
    • argumentsunknownrequired
    • function_idstringrequired
    • idstringrequired
    • typestringrequiredenum function_call
    Variant 7
    • contentunknown[]required
    • function_call_idstringrequired
    • is_errorboolean
    • typestringrequiredenum function_result
  • detailsunknownrequired
  • duration_msinteger· uint64requiredmin 0
  • function_call_idstringrequired
  • function_idstringrequired
  • is_errorbooleanrequired
Variant 2
  • function_call_idstringrequired
  • function_idstringrequired
  • pendingbooleanrequired
  • pending_timeout_msinteger· uint64min 0

harness::function::resolve

Function

Internal: settle a pending call's result (or release a held call) and resume the parked turn.

Request
  • actionstring

    `deliver` (default) supplies the result; `execute` releases a hook-held call through the remaining call pipeline.

  • contentone of[]
    one of (7)
    Variant 1
    • textstringrequired
    • typestringrequiredenum text
    Variant 2
    • attachment_idstring

      Optional link to the stored original of this inline image (`session::put-attachment`, resolvable with `session::get-attachment`). Lets readers ask `session::messages { include_image_data: false }` and fetch the bytes lazily instead of receiving them inline. Persisted verbatim on the transcript; model-bound consumers never see it (see [`ContentBlock::strip_files`]). Omitted on the wire when absent so legacy transcripts stay byte-identical.

    • datastringrequired
    • mimestringrequired
    • typestringrequiredenum image
    Variant 3
    • attachment_idstringrequired
    • mimestringrequired
    • namestringrequired
    • sizeinteger· uint64requiredmin 0
    • typestringrequiredenum file
    Variant 4
    • signaturestring
    • textstringrequired
    • typestringrequiredenum thinking
    Variant 5
    • datastringrequired
    • typestringrequiredenum redacted_thinking
    Variant 6
    • argumentsunknownrequired
    • function_idstringrequired
    • idstringrequired
    • typestringrequiredenum function_call
    Variant 7
    • contentunknown[]required
    • function_call_idstringrequired
    • is_errorboolean
    • typestringrequiredenum function_result
  • detailsunknown
  • fs_scopeany of

    execute only: one-shot additional roots trusted by the caller and unioned with the session's durable filesystem grants.

    any of (2)
    Variant 1
    • grantsstring[]
    Variant 2
    valuenull
  • function_call_idstringrequired
  • is_errorboolean
  • session_idstringrequired
  • turn_idstringrequired
Response
  • resolvedbooleanrequired

    False when the call is unknown, already done, or (execute) not held.

  • turn_resumedbooleanrequired

    True when this resolve re-enqueued the turn.

harness::hook::on-post-call

Function

Synchronous hook: after the called function returns, before the result is appended. May rewrite content/details/is_error. Args `functions` globs select the called functions. Each matching observer's target is called with the hook input plus `call` and `result` { function_call_id, function_id, content, is_error, details }; the harness gets back the merged outcome { decision, held_by?, result?, annotations? }. A `shell::*`/`coder::*` target may answer mutations.fs_scope.root on a `shell::*`/`coder::*` call to move the session's working directory.

Request
  • callobjectrequired

    The function call a call hook runs around.

    • argumentsunknownrequired
    • descriptionstring

      on-pre-call only: the `agent_call` wrapper's display-only `description` of this call, when the model gave one.

    • function_idstringrequired
    • idstringrequired
    • implicit_namespacestringrequired

      The namespace this id runs in when a call names none.

    • namespacestringrequired

      The engine namespace the call runs in.

  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • resultobjectrequired

    What the called function returned.

    • contentunknown[]required
    • detailsunknownrequired
    • function_call_idstringrequired
    • function_idstringrequired
    • is_errorbooleanrequired
  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired
Response
  • callobjectrequired

    The function call a call hook runs around.

    • argumentsunknownrequired
    • descriptionstring

      on-pre-call only: the `agent_call` wrapper's display-only `description` of this call, when the model gave one.

    • function_idstringrequired
    • idstringrequired
    • implicit_namespacestringrequired

      The namespace this id runs in when a call names none.

    • namespacestringrequired

      The engine namespace the call runs in.

  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • resultobjectrequired

    What the called function returned.

    • contentunknown[]required
    • detailsunknownrequired
    • function_call_idstringrequired
    • function_idstringrequired
    • is_errorbooleanrequired
  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired

harness::hook::on-post-generate

Function

Synchronous hook: after the final assistant message update. Observe only: each matching observer's target is called with the hook input plus `generated` { message }; the harness gets back { decision: continue }.

Request
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • generatedobjectrequired

    The generated assistant message.

    • messageunknownrequired
  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired
Response
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • generatedobjectrequired

    The generated assistant message.

    • messageunknownrequired
  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired

harness::hook::on-post-turn

Function

Synchronous hook: at finalize, after the output contract validated the result, before the turn completes. Deny re-prompts the turn (bounded by max_validation_retries). Args `sessions` globs scope it; args `payload`+`result_into` call a plain composition function (fp::pipe) as the validator. Each matching observer's target is called with the hook input plus the turn's `result` (or the template with the result injected); the harness gets back the merged outcome { decision, reason?, prompt? }.

Request
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • resultunknownrequired

    The turn's result, validated by its output contract.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired
Response
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • resultunknownrequired

    The turn's result, validated by its output contract.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired

harness::hook::on-pre-call

Function

Synchronous hook: after the allow/deny policy passes, before the called function runs. May deny, hold, or rewrite arguments. Args `functions` globs select the called functions. Each matching observer's target is called with the hook input plus `call` { id, function_id, namespace, implicit_namespace, arguments }, the arguments as the previous target left them; the harness gets back the merged outcome { decision, reason?, held_by?, arguments?, annotations? }.

Request
  • callobjectrequired

    The function call a call hook runs around.

    • argumentsunknownrequired
    • descriptionstring

      on-pre-call only: the `agent_call` wrapper's display-only `description` of this call, when the model gave one.

    • function_idstringrequired
    • idstringrequired
    • implicit_namespacestringrequired

      The namespace this id runs in when a call names none.

    • namespacestringrequired

      The engine namespace the call runs in.

  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • resume_afterstring

    Set when a released hold resumes the chain after this holder's target; removed before any target is called.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired
Response
  • callobjectrequired

    The function call a call hook runs around.

    • argumentsunknownrequired
    • descriptionstring

      on-pre-call only: the `agent_call` wrapper's display-only `description` of this call, when the model gave one.

    • function_idstringrequired
    • idstringrequired
    • implicit_namespacestringrequired

      The namespace this id runs in when a call names none.

    • namespacestringrequired

      The engine namespace the call runs in.

  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • resume_afterstring

    Set when a released hold resumes the chain after this holder's target; removed before any target is called.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired

harness::hook::on-pre-generate

Function

Synchronous hook: after context assembly, before generation. May extend the system prompt, append messages, or veto. Each matching observer's target is called with the hook input plus `generate` { system_prompt, messages, model, provider, functions_generation, tools, expose } as the previous target left it, and on a sub-agent's turn `parent` / `parent_session_id` as harness::on-turn-completed reports them; the harness gets back the merged outcome { decision, reason?, system_prompt?, append_messages?, annotations? }. An observer whose contribution is static passes it as args.inject_prompt; it joins the prompt before assembly of the turns its `sessions` globs and filters select, and its target is not called. A target that reads a few fields lists them as args.input (dotted paths, `[]` maps a list) and gets those plus the envelope.

Request
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • generateobjectrequired

    What generation is about to send.

    • exposeunknownrequired

      The session's function exposure mode.

    • functions_generationinteger· uint64requiredmin 0
    • messagesunknown[]required
    • modelstringrequired
    • providerstringrequired
    • system_promptstringrequired
    • toolsunknown[]required

      The decision tools the model is offered.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • parentany of

    The spawning call, on a sub-agent's turn; as `harness::on-turn-completed` reports it.

    any of (2)
    Variant 1
    • function_call_idstringrequired
    • session_idstringrequired
    • turn_idstringrequired
    Variant 2
    valuenull
  • parent_session_idstring

    The session this turn's session is displayed under; as `harness::on-turn-completed` reports it.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired
Response
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • generateobjectrequired

    What generation is about to send.

    • exposeunknownrequired

      The session's function exposure mode.

    • functions_generationinteger· uint64requiredmin 0
    • messagesunknown[]required
    • modelstringrequired
    • providerstringrequired
    • system_promptstringrequired
    • toolsunknown[]required

      The decision tools the model is offered.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • parentany of

    The spawning call, on a sub-agent's turn; as `harness::on-turn-completed` reports it.

    any of (2)
    Variant 1
    • function_call_idstringrequired
    • session_idstringrequired
    • turn_idstringrequired
    Variant 2
    valuenull
  • parent_session_idstring

    The session this turn's session is displayed under; as `harness::on-turn-completed` reports it.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired

harness::hook::on-pre-turn

Function

Synchronous hook: first step of a turn, before any model spend. May veto. Observe it with args { sessions?, priority?, timeout_ms?, on_error? }. Each matching observer's target is called with the hook input { point, session_id, turn_id, step, depth, own_namespace, metadata? } and answers { decision, reason?, mutations?, annotations? }; the harness gets back the merged outcome { decision, reason? }.

Request
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired
Response
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • metadataunknown

    The turn's `options.metadata`.

  • own_namespacestring

    The namespace the harness runs in; a call without a namespace goes there.

  • pointstringrequired

    The hook point: `pre_turn`, `pre_generate`, `post_generate`, `pre_call`, `post_call` or `post_turn`.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired

harness::metrics

Function

Aggregate durable model usage, function outcomes, and available trace/span observability for the session tree `root_session_id` belongs to (`session_id` is accepted as an alias, and a sub-agent id is resolved to its root). `complete` is true only after every session in the durable tree has reached a terminal turn. Pass `omit_context: true` when you only need the counters and cost: each session's context snapshot is then left out.

Request
one of (2)
Variant 1
Empty object
Variant 2
Empty object
Response
  • by_sessionobject[]required
    • by_modelobject[]

      The same counters per model that generated a step, ordered by provider then model. Absent when nothing generated, and from a harness that predates it.

      • cache_read_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • cache_write_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • cost_usdnumber· doublerequired

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • function_callsinteger· uint64requiredmin 0
      • input_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • modelstringrequired
      • output_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • providerstringrequired
      • reasoning_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • turnsinteger· uint64requiredmin 0

        Model steps (assistant messages) this model generated.

      • unreported_generationsinteger· uint64min 0

        Generations stored with no usage at all: a stream cut before the provider reported, a request refused before a provider saw it, or one still streaming. The transcript does not say which, so none counts as zero: while this is non-zero every counter is a lower bound. Absent when zero.

    • cache_read_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • cache_write_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • contextany of

      The session's latest per-generation context snapshot (categories, budget, usage) — absent for sessions that have not generated since snapshots landed.

      any of (2)
      Variant 1
      • categoriesobjectrequired

        Where the request's tokens sit. Categories are assembly-time estimates; `hook_guidance` is the measured growth after assembly (pre-generate hook appends and orphan-repair patches), 0 when the request left assembly unchanged.

        Show 6 nested
        • hook_guidanceinteger· uint64min 0
        • messagesobjectrequired

          Estimated tokens of the assembled window's messages, by role.

          Show 4 nested
          • assistantinteger· uint64requiredmin 0
          • custominteger· uint64requiredmin 0
          • function_resultinteger· uint64requiredmin 0
          • userinteger· uint64requiredmin 0
        • overheadinteger· uint64requiredmin 0

          Provider framing plus response_format / provider_options fields.

        • skillsinteger· uint64min 0

          Selected skill bodies contained in the system prompt.

        • system_promptinteger· uint64requiredmin 0

          Final assembled system prompt excluding tokens attributed to `skills`: identity, per-step aids, and any compaction summary section.

        • toolsinteger· uint64requiredmin 0

          Function schemas exposed to the model.

      • compactedbooleanrequired

        The context carries a conversation summary: compacted on this step, or anchored on an earlier compaction entry (a previous step, the console's `/compact`). The summary's tokens count in `system_prompt`.

      • effective_max_output_tokensinteger· uint64requiredmin 0

        Output allocation `usable` was derived against.

      • estimatorstring

        Which estimator produced the numbers (`heuristic` until the context-manager resolves a real tokenizer). Absent when the context-manager predates the breakdown response.

      • freeinteger· uint64requiredmin 0
      • modelstringrequired
      • prefix_divergencesobject[]

        Already-sent rows this session's requests rewrote, newest last (at most [`MAX_PREFIX_DIVERGENCES`]), carried from step to step.

        Show 9 nested
        • cache_readinteger· uint64min 0

          `usage.cache_read` of the rewriting request: what the provider still reused.

        • call_idstring
        • causestring

          What rewrote the row, as far as the harness can tell: `prune` (context-manager pruned or reduced function results to fit the budget that step) or `system_prompt` (row 0: a compaction summary or a prompt change).

        • indexinteger· uint64min 0

          First row (0 = system prompt, then one per message) that differs from the session's previous request. Absent when only the provider's wire mapping changed.

        • prev_leninteger· uint64min 0

          Rows the previous request carried.

        • provider_notestring

          The provider's own wire-level finding, cause included, when it reported one (a final-message warning starting with [`PROVIDER_PREFIX_NOTE`]).

        • rolestring
        • stepinteger· uint64requiredmin 0
        • turn_idstringrequired
      • prompt_sections_fallbackstring

        Why no shared prefix went out: `disabled` (config), `no_stable_prefix` (empty identity prompt) or `prefix_rewritten` (a pre_generate hook replaced the prompt head; its prompt still wins, it just shares nothing).

      • prompt_surface_digeststring

        Identity of the shared prompt prefix this generation went out with (`sha256:` of the stable section) — present only when the request carried `system_sections`. A local identity, never a provider hit; `usage.cache_read` is the reuse signal.

      • providerstring
      • session_cost_usdnumber· double

        Running cost of the whole session in USD, accumulated across every generation step. `usage.cost_usd` is one step's bill — on providers with steep cache discounts the per-step number swings two orders of magnitude, so a chip showing it alone reads as a bouncing total.

      • session_idstringrequired
      • stepinteger· uint64requiredmin 0
      • summarized_head_tokensinteger· uint64min 0

        Size of the history that summary replaced.

      • timestampinteger· int64required
      • totalinteger· uint64requiredmin 0

        Final request estimate: categories plus post-assembly growth.

      • turn_idstringrequired
      • usableinteger· uint64requiredmin 0

        The input budget the window was fit into.

      • usageany of

        Actual provider usage for this generation, stamped after the terminal frame; absent when the provider returned none (or the generation never completed).

        Show 2 nested
        any of (2)
        Variant 1
        • cache_readinteger· uint64min 0
        • cache_writeinteger· uint64min 0
        • cost_usdnumber· double
        • inputinteger· uint64min 0
        • outputinteger· uint64min 0
        • reasoninginteger· uint64min 0
        Variant 2
        valuenull
      Variant 2
      valuenull
    • cost_usdnumber· doublerequired

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • depthinteger· uint32requiredmin 0
    • function_call_errorsinteger· uint64requiredmin 0
    • function_callsinteger· uint64requiredmin 0
    • input_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • output_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • parent_session_idstring
    • reasoning_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • session_idstringrequired
    • turnsinteger· uint64requiredmin 0
    • unreported_generationsinteger· uint64min 0

      Generations stored with no usage at all: a stream cut before the provider reported, a request refused before a provider saw it, or one still streaming. The transcript does not say which, so none counts as zero: while this is non-zero every counter is a lower bound. Absent when zero.

  • completebooleanrequired
  • root_session_idstringrequired
  • totalsobjectrequired
    • by_modelobject[]

      The same counters per model that generated a step, ordered by provider then model. Absent when nothing generated, and from a harness that predates it.

      • cache_read_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • cache_write_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • cost_usdnumber· doublerequired

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • function_callsinteger· uint64requiredmin 0
      • input_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • modelstringrequired
      • output_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • providerstringrequired
      • reasoning_tokensinteger· uint64requiredmin 0

        Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

      • turnsinteger· uint64requiredmin 0

        Model steps (assistant messages) this model generated.

      • unreported_generationsinteger· uint64min 0

        Generations stored with no usage at all: a stream cut before the provider reported, a request refused before a provider saw it, or one still streaming. The transcript does not say which, so none counts as zero: while this is non-zero every counter is a lower bound. Absent when zero.

    • cache_read_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • cache_write_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • cost_usdnumber· doublerequired

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • function_call_errorsinteger· uint64requiredmin 0
    • function_callsinteger· uint64requiredmin 0
    • input_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • output_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • reasoning_tokensinteger· uint64requiredmin 0

      Summed over the generations that reported usage. One of them may lack this counter and is left out; `null` means none reported it or more than one lacked it — never a measured zero, so the key is always present and a reader can tell the two apart. A generation with no usage at all is counted in `unreported_generations` instead and makes this a lower bound.

    • sessionsinteger· uint64requiredmin 0
    • turnsinteger· uint64requiredmin 0
    • unreported_generationsinteger· uint64min 0

      Generations stored with no usage at all: a stream cut before the provider reported, a request refused before a provider saw it, or one still streaming. The transcript does not say which, so none counts as zero: while this is non-zero every counter is a lower bound. Absent when zero.

  • tracesany of

    Trace/span aggregates when the engine's in-memory observability exporter is available. Usage metrics remain available when it is not.

    any of (2)
    Variant 1
    • by_sessionobject[]required
      Show 7 nested
      • depthinteger· uint32requiredmin 0
      • duration_msinteger· uint64requiredmin 0

        Elapsed window from the session's first observed span to its last.

      • error_span_countinteger· uint64requiredmin 0
      • parent_session_idstring
      • session_idstringrequired
      • span_countinteger· uint64requiredmin 0
      • trace_countinteger· uint64requiredmin 0
    • duration_msinteger· uint64requiredmin 0

      Elapsed window from the first observed span to the last observed span.

    • error_span_countinteger· uint64requiredmin 0
    • span_countinteger· uint64requiredmin 0
    • trace_countinteger· uint64requiredmin 0

      Distinct traces across the root session and all descendants.

    Variant 2
    valuenull

harness::observe

Function

Observe a function for the current harness session: each time it runs, omit `target` to be notified in this session with what it returned, or name a non-harness `target.function_id` to call with it. Pass the function's `args` when it takes them and `filters` on its `input.<field>` to choose calls. Set `lifecycle.expires_in_ms` on every wake except a timer, to how long the work should take; a one-shot wake without it expires after 10 minutes with a notice. Returns `{ observer_id, once }`; a `note` is advice about the observer, which was created either way. Call-target results are discarded and do not return to this session.

Request
  • actionstring

    User-facing text saying what happened, shown with each delivery.

  • argsobject

    Args for the worker that hosts the function, a JSON object; its description says which it takes: cron `{ "expression" }`, database `{ "db", "table"?, "ops"? }`, `harness::on-timer` `{ "in_ms" }` or `{ "at" }` (epoch ms). Omit for a function that takes none.

  • conditionsobject[]

    Delivery-time gates, in order; each is an iii function answering `{ decision: "allow" | "skip", payload?, reason? }`.

    • configunknown

      Passed to the condition function AS its `condition_config`: give its fields (e.g. `id`, `expect`) directly, not wrapped in `condition_config`.

    • function_idstringrequired
  • filtersobject

    Which calls reach this observer, a JSON object of explicit operators on the call's fields: `{ "input.scope": { "$eq": "run" } }`.

  • function_idstringrequired

    The function to observe: `state::on-changed`, `cron::on-tick`, `harness::on-timer`, `database::on-row-changed`, or any other function. What it returns is the event.

  • labelstring

    A short human label echoed back in the notification text.

  • lifecycleany of

    When the observer stops delivering; top-level `once` is the shorthand.

    any of (2)
    Variant 1
    • expires_in_msinteger· int64

      Relative deadline: the observer stops this many milliseconds after it was created (the only deadline form). Set it on every wake except a timer, to how long the work should take: if nothing fires by then, the session is woken with a notice. A one-shot wake without it expires after 10 minutes.

    • max_firesinteger· uint64min 0

      Lifetime delivery budget; the observer is removed on its Nth delivery.

    • onceboolean

      Remove the observer after its first delivery (same as top-level `once`).

    Variant 2
    valuenull
  • namespacestring

    Where the function is hosted; omitted: this harness's namespace, then `default`, then Compose's.

  • onceboolean

    Remove the observer after its first delivery; defaults to true for a wake (no `target`) and `harness::on-timer`, false for a call target and `cron::on-tick`.

  • targetany of

    The function called with each event: `{ function_id, payload?, event_into? }` — the fixed payload and the JSON pointer where the event is injected into it (default `/event`). Omit it to be notified in this session instead. `harness::spawn` is never a valid target.

    any of (2)
    Variant 1
    • event_intostring

      JSON pointer where the event lands inside the payload (default `/event`).

    • function_idstringrequired
    • payloadunknown

      Payload template; the delivered event is injected into it at `event_into`.

    Variant 2
    valuenull
Response
  • notestring

    Advisory only — the observer was CREATED. Says what applied by default or what looks suspicious in its wiring (e.g. a filter naming a key someone already wrote). Read it and act on it if it applies.

  • observer_idstringrequired
  • oncebooleanrequired

    The effective `once` flag applied (after the per-function default).

harness::observer::deliver

Function

Internal target of every observer an agent created with harness::observe: evaluates the binding's conditions, projects the observed call's output into the target's payload, and dispatches it (a wake into the owner session, or a plain function call). Receives the Observed envelope from iii's delivery, or the payload as sent from a call through the observer (a source's deliver hook); never called directly.

Request
any of (2)
Variant 1
all of (1)
Variant 1
  • activation_idstringrequired
  • callerany of
    Show 2 nested
    any of (2)
    Variant 1
    • function_idstring

      The handler the call was made from; absent for a top-level call.

    • invocation_idstring
    • parentany of

      The caller of that handler, one level only.

      Show 2 nested
      any of (2)
      Variant 1
      • function_idstring
      • invocation_idstring
      • worker_idstring
      • worker_namestring
      Variant 2
      valuenull
    • worker_idstring
    • worker_namestring
    Variant 2
    valuenull
  • duration_msnumber· doublerequired
  • errorany of
    Show 2 nested
    any of (2)
    Variant 1
    • codestringrequired
    • messagestringrequired
    Variant 2
    valuenull
  • function_idstringrequired
  • inputunknown
  • invocation_idstringrequired
  • metadataunknown
  • namespacestring
  • observer_idstringrequired
  • outputunknown
  • started_at_msinteger· uint64requiredmin 0
  • statusstringrequiredenum success, error
Variant 2
valueunknown
Response
  • deliveredbooleanrequired

    Whether the target was dispatched this fire.

  • gatestring

    Which gate or condition stopped it. Present iff `!delivered`.

  • notestring

    Why. Present iff `!delivered`.

harness::observers::dispose

Function

Remove one observer a session created, by observer id (the engine observer and the durable record); a still-armed wake notifies its parked owner. `session_id` must name the owner; in-turn calls may omit it.

Request
  • observer_idstringrequired

    The observer to remove (`id` is accepted as an alias).

  • session_idstring

    The observer's owner session; in-turn calls may omit it (the calling session is injected).

Response
  • removedbooleanrequired

    False when no record existed (already removed) — honest, not an error.

harness::observers::list

Function

List the observers a session created with harness::observe: observer id, observed function with its args and filters, target (absent = notifies the owner), label, conditions, lifecycle, and fire count. In-turn calls may omit `session_id`.

Request
  • session_idstring

    Owner session whose observers to list; in-turn calls may omit it (the calling session is injected).

Response
  • observersobject[]required
    • actionstring

      Human-readable event text declared as `action`.

    • argsunknown
    • conditionsobject[]
      • configunknown

        Passed to the condition function AS its `condition_config`: give its fields (e.g. `id`, `expect`) directly, not wrapped in `condition_config`.

      • function_idstringrequired
    • created_atinteger· int64required
    • expires_atinteger· int64
    • filtersunknown
    • firesinteger· uint64requiredmin 0
    • function_idstring

      The observed function.

    • labelstring
    • max_firesinteger· uint64min 0
    • namespacestring

      Where the observed function is hosted, when the observer names it.

    • observer_idstringrequired
    • oncebooleanrequired
    • targetstring

      The function a delivery calls. Absent for a wake — the delivery notifies the owner session.

harness::on-ask

Function

A durable ask was accepted or changed state. Carries the whole entry; filter on input.session_id.

Request
  • aboutobjectrequired
    • blocksstring[]

      Cards whose work waits on this answer.

    • classall of

      Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

      all of (1)
      Variant 1
      valuestringenum security, publish, external_cost, data, scope, run_health, …
    • ticketstring

      The card this question concerns.

    • whystring

      One paragraph explaining why the answer is needed.

  • answer_textstring
  • answersobject[]
    • choicestring
    • choicesstring[]
    • headerstringrequired
    • otherstring
    • skippedboolean
  • asked_atinteger· int64required
  • asked_bystring

    Asking agent profile id, when the session has a frozen profile.

  • byany of
    any of (2)
    Variant 1
    • channelstringrequiredenum chat, control-plane, kanban, expiry
    • userstring
    Variant 2
    valuenull
  • expires_atinteger· int64
  • expires_in_mininteger· uint64min 0
  • on_expiryany ofrequired
    any of (2)
    Variant 1
    • answerstringrequired
    Variant 2
    valuestringenum block
  • outcomeany of
    any of (2)
    Variant 1
    valuestringenum answered, dismissed, withdrawn, expired_default, not_delivered
    Variant 2
    valuenull
  • question_idstringrequired
  • questionsobject[]required
    • headerstringrequiredmin 1 chars

      Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

    • multi_selectboolean

      Let the user pick several options (checkboxes) instead of one.

    • optionsobject[]required2…4 items

      2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

      • descriptionstring

        Optional one-line explanation shown under the label.

      • labelstringrequired1…80 chars

        The choice as the user sees and sends it, 1-80 characters, unique within its question.

      • recommendedboolean

        Marks the agent's preferred choice. At most one option per question.

    • questionstringrequiredmin 1 chars

      The full question text shown above the options.

  • session_idstringrequired
  • settled_atinteger· int64
  • statestringrequiredenum open, answering, answered, dismissed, withdrawn, expired
  • turn_idstringrequired
Response
  • aboutobjectrequired
    • blocksstring[]

      Cards whose work waits on this answer.

    • classall of

      Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

      all of (1)
      Variant 1
      valuestringenum security, publish, external_cost, data, scope, run_health, …
    • ticketstring

      The card this question concerns.

    • whystring

      One paragraph explaining why the answer is needed.

  • answer_textstring
  • answersobject[]
    • choicestring
    • choicesstring[]
    • headerstringrequired
    • otherstring
    • skippedboolean
  • asked_atinteger· int64required
  • asked_bystring

    Asking agent profile id, when the session has a frozen profile.

  • byany of
    any of (2)
    Variant 1
    • channelstringrequiredenum chat, control-plane, kanban, expiry
    • userstring
    Variant 2
    valuenull
  • expires_atinteger· int64
  • expires_in_mininteger· uint64min 0
  • on_expiryany ofrequired
    any of (2)
    Variant 1
    • answerstringrequired
    Variant 2
    valuestringenum block
  • outcomeany of
    any of (2)
    Variant 1
    valuestringenum answered, dismissed, withdrawn, expired_default, not_delivered
    Variant 2
    valuenull
  • question_idstringrequired
  • questionsobject[]required
    • headerstringrequiredmin 1 chars

      Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

    • multi_selectboolean

      Let the user pick several options (checkboxes) instead of one.

    • optionsobject[]required2…4 items

      2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

      • descriptionstring

        Optional one-line explanation shown under the label.

      • labelstringrequired1…80 chars

        The choice as the user sees and sends it, 1-80 characters, unique within its question.

      • recommendedboolean

        Marks the agent's preferred choice. At most one option per question.

    • questionstringrequiredmin 1 chars

      The full question text shown above the options.

  • session_idstringrequired
  • settled_atinteger· int64
  • statestringrequiredenum open, answering, answered, dismissed, withdrawn, expired
  • turn_idstringrequired

harness::on-ask-settled

Function

A durable ask was accepted or changed state. Carries the whole entry; filter on input.session_id.

Request
  • aboutobjectrequired
    • blocksstring[]

      Cards whose work waits on this answer.

    • classall of

      Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

      all of (1)
      Variant 1
      valuestringenum security, publish, external_cost, data, scope, run_health, …
    • ticketstring

      The card this question concerns.

    • whystring

      One paragraph explaining why the answer is needed.

  • answer_textstring
  • answersobject[]
    • choicestring
    • choicesstring[]
    • headerstringrequired
    • otherstring
    • skippedboolean
  • asked_atinteger· int64required
  • asked_bystring

    Asking agent profile id, when the session has a frozen profile.

  • byany of
    any of (2)
    Variant 1
    • channelstringrequiredenum chat, control-plane, kanban, expiry
    • userstring
    Variant 2
    valuenull
  • expires_atinteger· int64
  • expires_in_mininteger· uint64min 0
  • on_expiryany ofrequired
    any of (2)
    Variant 1
    • answerstringrequired
    Variant 2
    valuestringenum block
  • outcomeany of
    any of (2)
    Variant 1
    valuestringenum answered, dismissed, withdrawn, expired_default, not_delivered
    Variant 2
    valuenull
  • question_idstringrequired
  • questionsobject[]required
    • headerstringrequiredmin 1 chars

      Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

    • multi_selectboolean

      Let the user pick several options (checkboxes) instead of one.

    • optionsobject[]required2…4 items

      2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

      • descriptionstring

        Optional one-line explanation shown under the label.

      • labelstringrequired1…80 chars

        The choice as the user sees and sends it, 1-80 characters, unique within its question.

      • recommendedboolean

        Marks the agent's preferred choice. At most one option per question.

    • questionstringrequiredmin 1 chars

      The full question text shown above the options.

  • session_idstringrequired
  • settled_atinteger· int64
  • statestringrequiredenum open, answering, answered, dismissed, withdrawn, expired
  • turn_idstringrequired
Response
  • aboutobjectrequired
    • blocksstring[]

      Cards whose work waits on this answer.

    • classall of

      Classify the decision as `security` for credentials or permissions, `publish` for a release or deployment, `external_cost` for paid spend, or `data` for data access, migration, or deletion. Defaults to `scope` for other questions.

      all of (1)
      Variant 1
      valuestringenum security, publish, external_cost, data, scope, run_health, …
    • ticketstring

      The card this question concerns.

    • whystring

      One paragraph explaining why the answer is needed.

  • answer_textstring
  • answersobject[]
    • choicestring
    • choicesstring[]
    • headerstringrequired
    • otherstring
    • skippedboolean
  • asked_atinteger· int64required
  • asked_bystring

    Asking agent profile id, when the session has a frozen profile.

  • byany of
    any of (2)
    Variant 1
    • channelstringrequiredenum chat, control-plane, kanban, expiry
    • userstring
    Variant 2
    valuenull
  • expires_atinteger· int64
  • expires_in_mininteger· uint64min 0
  • on_expiryany ofrequired
    any of (2)
    Variant 1
    • answerstringrequired
    Variant 2
    valuestringenum block
  • outcomeany of
    any of (2)
    Variant 1
    valuestringenum answered, dismissed, withdrawn, expired_default, not_delivered
    Variant 2
    valuenull
  • question_idstringrequired
  • questionsobject[]required
    • headerstringrequiredmin 1 chars

      Short chip label such as `Approach`; prefixes the answer line (`Approach: <label>`). No length limit: the card shows a long one with an ellipsis and the whole text on hover.

    • multi_selectboolean

      Let the user pick several options (checkboxes) instead of one.

    • optionsobject[]required2…4 items

      2-4 discrete choices; do not add an "Other" option, the UI adds a free-text one.

      • descriptionstring

        Optional one-line explanation shown under the label.

      • labelstringrequired1…80 chars

        The choice as the user sees and sends it, 1-80 characters, unique within its question.

      • recommendedboolean

        Marks the agent's preferred choice. At most one option per question.

    • questionstringrequiredmin 1 chars

      The full question text shown above the options.

  • session_idstringrequired
  • settled_atinteger· int64
  • statestringrequiredenum open, answering, answered, dismissed, withdrawn, expired
  • turn_idstringrequired

harness::on-compaction

Function

An explicit compaction of a session started (`phase: started`) or finished (`phase: completed`, with `status` ok/busy/empty/failed and the user-facing `message`). Filter on input.session_id or input.compaction_id.

Request
  • compaction_idstringrequired
  • entry_idsstring[]
  • messagestring

    `completed` only: the user-facing message.

  • phasestringrequired

    `started` or `completed`.

  • session_idstringrequired
  • statusstring

    `completed` only: `ok`, `busy`, `empty` or `failed`.

  • timestampinteger· int64required
  • tokens_afterinteger· uint64min 0
  • tokens_beforeinteger· uint64min 0
Response
  • compaction_idstringrequired
  • entry_idsstring[]
  • messagestring

    `completed` only: the user-facing message.

  • phasestringrequired

    `started` or `completed`.

  • session_idstringrequired
  • statusstring

    `completed` only: `ok`, `busy`, `empty` or `failed`.

  • timestampinteger· int64required
  • tokens_afterinteger· uint64min 0
  • tokens_beforeinteger· uint64min 0

harness::on-functions-change

Function

Internal: refresh the cached function-registry snapshot when functions are registered, re-registered or unregistered (an observer of engine::on-functions-changed).

Request
  • eventstring

    Engine event tag (advisory; the handler re-fetches the full list).

Response
  • okbooleanrequired

harness::on-message-queued

Function

A message parked in a session's server-side queue while its turn streams. Filter on input.session_id.

Request
  • entry_idstringrequired
  • queued_atinteger· int64required
  • session_idstringrequired
  • timestampinteger· int64required
Response
  • entry_idstringrequired
  • queued_atinteger· int64required
  • session_idstringrequired
  • timestampinteger· int64required

harness::on-observers-changed

Function

A session's observer set or fire count changed: refetch harness::observers::list. Filter on input.session_id.

Request
  • session_idstringrequired
  • timestampinteger· int64required
Response
  • session_idstringrequired
  • timestampinteger· int64required

harness::on-ready

Function

The harness completed boot and can accept turns. An observer added later receives the current ready event once it is active, delivered like every call of this function (a call with metadata { for_observer: <observer id> }).

Request
  • statusstringrequired

    Always `ready`.

  • timestampinteger· int64required
Response
  • statusstringrequired

    Always `ready`.

  • timestampinteger· int64required

harness::on-session-deleted

Function

Internal: drop a deleted session's observers. Not called directly.

Request
  • activation_idstringrequired
  • callerany of
    any of (2)
    Variant 1
    • function_idstring

      The handler the call was made from; absent for a top-level call.

    • invocation_idstring
    • parentany of

      The caller of that handler, one level only.

      Show 2 nested
      any of (2)
      Variant 1
      • function_idstring
      • invocation_idstring
      • worker_idstring
      • worker_namestring
      Variant 2
      valuenull
    • worker_idstring
    • worker_namestring
    Variant 2
    valuenull
  • duration_msnumber· doublerequired
  • errorany of
    any of (2)
    Variant 1
    • codestringrequired
    • messagestringrequired
    Variant 2
    valuenull
  • function_idstringrequired
  • inputunknown
  • invocation_idstringrequired
  • metadataunknown
  • namespacestring
  • observer_idstringrequired
  • outputany of
    any of (2)
    Variant 1
    • session_idstringrequired
    Variant 2
    valuenull
  • started_at_msinteger· uint64requiredmin 0
  • statusstringrequiredenum success, error
Response
  • okbooleanrequired
  • removedinteger· uint64requiredmin 0

harness::on-session-tree-deletion

Function

A subtree deletion changed status. Observe it before requesting deletion, with filters on input.session_id or input.operation_id, and recover once by operation_id.

Request
  • attemptinteger· uint32requiredmin 1

    Initial attempt is 1; only an explicit failed-operation retry increments it.

  • deleted_session_idsstring[]required
  • errorstring
  • operation_idstringrequired
  • session_idstringrequired
  • statusstringrequiredenum deleting, completed, failed
Response
  • attemptinteger· uint32requiredmin 1

    Initial attempt is 1; only an explicit failed-operation retry increments it.

  • deleted_session_idsstring[]required
  • errorstring
  • operation_idstringrequired
  • session_idstringrequired
  • statusstringrequiredenum deleting, completed, failed

harness::on-skills-change

Function

Internal: refresh the cached model-invocable skill catalog.

Request
  • opstring
Response
  • okbooleanrequired

harness::on-timer

Function

One-shot deadline: called once at `at` (epoch ms) with { scheduled_at, actual_at }. Observe it with args { at }; an observer receives the call for its own `at` only. An `at` more than 7 days out is refused (CONFIG_ERROR); an `at` already past is called once as soon as its observers are active. The natural second leg of any armed wake or fan-in gate: 'wake me when X happens, or tell me at T that it did not'. For recurrence observe cron::on-tick.

Request
  • actual_atinteger· int64required

    When the call was made.

  • scheduled_atinteger· int64required

    The observers' `at`.

Response
  • actual_atinteger· int64required

    When the call was made.

  • scheduled_atinteger· int64required

    The observers' `at`.

harness::on-turn-completed

Function

A harness turn reached a terminal status (completed/cancelled/failed). Filter on input.session_id, or on input.parent.session_id / input.parent_session_id.

Request
  • contextany of

    The latest generation's context accounting.

    any of (2)
    Variant 1
    • categoriesobjectrequired

      Where the request's tokens sit. Categories are assembly-time estimates; `hook_guidance` is the measured growth after assembly (pre-generate hook appends and orphan-repair patches), 0 when the request left assembly unchanged.

      Show 6 nested
      • hook_guidanceinteger· uint64min 0
      • messagesobjectrequired

        Estimated tokens of the assembled window's messages, by role.

        Show 4 nested
        • assistantinteger· uint64requiredmin 0
        • custominteger· uint64requiredmin 0
        • function_resultinteger· uint64requiredmin 0
        • userinteger· uint64requiredmin 0
      • overheadinteger· uint64requiredmin 0

        Provider framing plus response_format / provider_options fields.

      • skillsinteger· uint64min 0

        Selected skill bodies contained in the system prompt.

      • system_promptinteger· uint64requiredmin 0

        Final assembled system prompt excluding tokens attributed to `skills`: identity, per-step aids, and any compaction summary section.

      • toolsinteger· uint64requiredmin 0

        Function schemas exposed to the model.

    • compactedbooleanrequired

      The context carries a conversation summary: compacted on this step, or anchored on an earlier compaction entry (a previous step, the console's `/compact`). The summary's tokens count in `system_prompt`.

    • effective_max_output_tokensinteger· uint64requiredmin 0

      Output allocation `usable` was derived against.

    • estimatorstring

      Which estimator produced the numbers (`heuristic` until the context-manager resolves a real tokenizer). Absent when the context-manager predates the breakdown response.

    • freeinteger· uint64requiredmin 0
    • modelstringrequired
    • prefix_divergencesobject[]

      Already-sent rows this session's requests rewrote, newest last (at most [`MAX_PREFIX_DIVERGENCES`]), carried from step to step.

      Show 9 nested
      • cache_readinteger· uint64min 0

        `usage.cache_read` of the rewriting request: what the provider still reused.

      • call_idstring
      • causestring

        What rewrote the row, as far as the harness can tell: `prune` (context-manager pruned or reduced function results to fit the budget that step) or `system_prompt` (row 0: a compaction summary or a prompt change).

      • indexinteger· uint64min 0

        First row (0 = system prompt, then one per message) that differs from the session's previous request. Absent when only the provider's wire mapping changed.

      • prev_leninteger· uint64min 0

        Rows the previous request carried.

      • provider_notestring

        The provider's own wire-level finding, cause included, when it reported one (a final-message warning starting with [`PROVIDER_PREFIX_NOTE`]).

      • rolestring
      • stepinteger· uint64requiredmin 0
      • turn_idstringrequired
    • prompt_sections_fallbackstring

      Why no shared prefix went out: `disabled` (config), `no_stable_prefix` (empty identity prompt) or `prefix_rewritten` (a pre_generate hook replaced the prompt head; its prompt still wins, it just shares nothing).

    • prompt_surface_digeststring

      Identity of the shared prompt prefix this generation went out with (`sha256:` of the stable section) — present only when the request carried `system_sections`. A local identity, never a provider hit; `usage.cache_read` is the reuse signal.

    • providerstring
    • session_cost_usdnumber· double

      Running cost of the whole session in USD, accumulated across every generation step. `usage.cost_usd` is one step's bill — on providers with steep cache discounts the per-step number swings two orders of magnitude, so a chip showing it alone reads as a bouncing total.

    • session_idstringrequired
    • stepinteger· uint64requiredmin 0
    • summarized_head_tokensinteger· uint64min 0

      Size of the history that summary replaced.

    • timestampinteger· int64required
    • totalinteger· uint64requiredmin 0

      Final request estimate: categories plus post-assembly growth.

    • turn_idstringrequired
    • usableinteger· uint64requiredmin 0

      The input budget the window was fit into.

    • usageany of

      Actual provider usage for this generation, stamped after the terminal frame; absent when the provider returned none (or the generation never completed).

      Show 2 nested
      any of (2)
      Variant 1
      • cache_readinteger· uint64min 0
      • cache_writeinteger· uint64min 0
      • cost_usdnumber· double
      • inputinteger· uint64min 0
      • outputinteger· uint64min 0
      • reasoninginteger· uint64min 0
      Variant 2
      valuenull
    Variant 2
    valuenull
  • open_asksinteger· uintmin 0
  • parentany of
    any of (2)
    Variant 1
    • function_call_idstringrequired
    • session_idstringrequired
    • turn_idstringrequired
    Variant 2
    valuenull
  • parent_session_idstring
  • reasonstring
  • resultunknown
  • result_errorstring
  • session_idstringrequired
  • statusstringrequired

    `completed`, `cancelled` or `failed`.

  • terminalbooleanrequired

    `false` while the session still owns an armed wake (claimed or not), or when this turn drained a queued message and reseeds the session: the run continues and a later turn carries the real outcome.

  • timestampinteger· int64required
  • turn_idstringrequired
Response
  • contextany of

    The latest generation's context accounting.

    any of (2)
    Variant 1
    • categoriesobjectrequired

      Where the request's tokens sit. Categories are assembly-time estimates; `hook_guidance` is the measured growth after assembly (pre-generate hook appends and orphan-repair patches), 0 when the request left assembly unchanged.

      Show 6 nested
      • hook_guidanceinteger· uint64min 0
      • messagesobjectrequired

        Estimated tokens of the assembled window's messages, by role.

        Show 4 nested
        • assistantinteger· uint64requiredmin 0
        • custominteger· uint64requiredmin 0
        • function_resultinteger· uint64requiredmin 0
        • userinteger· uint64requiredmin 0
      • overheadinteger· uint64requiredmin 0

        Provider framing plus response_format / provider_options fields.

      • skillsinteger· uint64min 0

        Selected skill bodies contained in the system prompt.

      • system_promptinteger· uint64requiredmin 0

        Final assembled system prompt excluding tokens attributed to `skills`: identity, per-step aids, and any compaction summary section.

      • toolsinteger· uint64requiredmin 0

        Function schemas exposed to the model.

    • compactedbooleanrequired

      The context carries a conversation summary: compacted on this step, or anchored on an earlier compaction entry (a previous step, the console's `/compact`). The summary's tokens count in `system_prompt`.

    • effective_max_output_tokensinteger· uint64requiredmin 0

      Output allocation `usable` was derived against.

    • estimatorstring

      Which estimator produced the numbers (`heuristic` until the context-manager resolves a real tokenizer). Absent when the context-manager predates the breakdown response.

    • freeinteger· uint64requiredmin 0
    • modelstringrequired
    • prefix_divergencesobject[]

      Already-sent rows this session's requests rewrote, newest last (at most [`MAX_PREFIX_DIVERGENCES`]), carried from step to step.

      Show 9 nested
      • cache_readinteger· uint64min 0

        `usage.cache_read` of the rewriting request: what the provider still reused.

      • call_idstring
      • causestring

        What rewrote the row, as far as the harness can tell: `prune` (context-manager pruned or reduced function results to fit the budget that step) or `system_prompt` (row 0: a compaction summary or a prompt change).

      • indexinteger· uint64min 0

        First row (0 = system prompt, then one per message) that differs from the session's previous request. Absent when only the provider's wire mapping changed.

      • prev_leninteger· uint64min 0

        Rows the previous request carried.

      • provider_notestring

        The provider's own wire-level finding, cause included, when it reported one (a final-message warning starting with [`PROVIDER_PREFIX_NOTE`]).

      • rolestring
      • stepinteger· uint64requiredmin 0
      • turn_idstringrequired
    • prompt_sections_fallbackstring

      Why no shared prefix went out: `disabled` (config), `no_stable_prefix` (empty identity prompt) or `prefix_rewritten` (a pre_generate hook replaced the prompt head; its prompt still wins, it just shares nothing).

    • prompt_surface_digeststring

      Identity of the shared prompt prefix this generation went out with (`sha256:` of the stable section) — present only when the request carried `system_sections`. A local identity, never a provider hit; `usage.cache_read` is the reuse signal.

    • providerstring
    • session_cost_usdnumber· double

      Running cost of the whole session in USD, accumulated across every generation step. `usage.cost_usd` is one step's bill — on providers with steep cache discounts the per-step number swings two orders of magnitude, so a chip showing it alone reads as a bouncing total.

    • session_idstringrequired
    • stepinteger· uint64requiredmin 0
    • summarized_head_tokensinteger· uint64min 0

      Size of the history that summary replaced.

    • timestampinteger· int64required
    • totalinteger· uint64requiredmin 0

      Final request estimate: categories plus post-assembly growth.

    • turn_idstringrequired
    • usableinteger· uint64requiredmin 0

      The input budget the window was fit into.

    • usageany of

      Actual provider usage for this generation, stamped after the terminal frame; absent when the provider returned none (or the generation never completed).

      Show 2 nested
      any of (2)
      Variant 1
      • cache_readinteger· uint64min 0
      • cache_writeinteger· uint64min 0
      • cost_usdnumber· double
      • inputinteger· uint64min 0
      • outputinteger· uint64min 0
      • reasoninginteger· uint64min 0
      Variant 2
      valuenull
    Variant 2
    valuenull
  • open_asksinteger· uintmin 0
  • parentany of
    any of (2)
    Variant 1
    • function_call_idstringrequired
    • session_idstringrequired
    • turn_idstringrequired
    Variant 2
    valuenull
  • parent_session_idstring
  • reasonstring
  • resultunknown
  • result_errorstring
  • session_idstringrequired
  • statusstringrequired

    `completed`, `cancelled` or `failed`.

  • terminalbooleanrequired

    `false` while the session still owns an armed wake (claimed or not), or when this turn drained a queued message and reseeds the session: the run continues and a later turn carries the real outcome.

  • timestampinteger· int64required
  • turn_idstringrequired

harness::on-turn-started

Function

A harness turn began executing (first loop step). Filter on input.session_id, or on input.parent.session_id / input.parent_session_id for a sub-agent's parent.

Request
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • message_previewstring

    The first characters of the message that started the turn (a sub-agent's task text for a child).

  • parentany of

    The spawning call, for a sub-agent turn.

    any of (2)
    Variant 1
    • function_call_idstringrequired
    • session_idstringrequired
    • turn_idstringrequired
    Variant 2
    valuenull
  • parent_session_idstring

    The session this one is displayed under.

  • session_idstringrequired
  • timestampinteger· int64required
  • turn_idstringrequired
Response
  • depthinteger· uint32requiredmin 0

    0 for a top-level turn.

  • message_previewstring

    The first characters of the message that started the turn (a sub-agent's task text for a child).

  • parentany of

    The spawning call, for a sub-agent turn.

    any of (2)
    Variant 1
    • function_call_idstringrequired
    • session_idstringrequired
    • turn_idstringrequired
    Variant 2
    valuenull
  • parent_session_idstring

    The session this one is displayed under.

  • session_idstringrequired
  • timestampinteger· int64required
  • turn_idstringrequired

harness::projects::delete

Function

Internal control-plane: remove a project directory from the durable catalog.

Request
  • pathstringrequired
Response
  • deletedbooleanrequired

harness::projects::list

Function

Internal control-plane: list the operator's durable project catalog.

Request
Empty object
Response
  • projectsobject[]required
    • last_used_atinteger· int64required
    • namestringrequired
    • pathstringrequired

harness::projects::upsert

Function

Internal control-plane: remember, touch, or rename a project directory.

Request
  • namestring

    A custom display name. Omit to keep the current name (or use the folder name for a new project); pass blank to reset to the folder name.

  • pathstringrequired
Response
  • projectobjectrequired
    • last_used_atinteger· int64required
    • namestringrequired
    • pathstringrequired

harness::send

Function

Entry point: ensure the session, persist the incoming message, and kick off a turn; returns fast (or merges into a running turn).

Request
  • idempotency_keystring

    Webhook dedupe: a repeated key returns the original `{session_id, turn_id}` and appends nothing.

  • messagestringrequired

    The incoming user message text.

  • modelstring

    Required on a new session unless `options.agent` supplies a model; an existing session inherits its last turn's model when omitted.

  • optionsany of
    any of (2)
    Variant 1
    • agentstring

      Directory agent profile id (`directory::agents::*`) replacing the built-in identity; new sessions only, refused with a prompt field.

    • continuation_entry_idstring

      Explicit continuation of a user entry on this session's active path. Resolved and bounded by Harness; never inferred from message text.

    • functionsany of

      Fail-closed dispatch policy; omitted means deny all on a new session and inherit on an existing one (`{ allow: [] }` strips explicitly).

      Show 2 nested
      any of (2)
      Variant 1
      • allowstring[]
      • denystring[]
      • exposeall of
        Show 1 nested
        all of (1)
        Variant 1
        valuestringenum agent_call, native
      Variant 2
      valuenull
    • max_cost_usdnumber· double

      Hard USD budget for the complete root-and-subagent session tree. Every model used by the tree must advertise catalog pricing.

    • max_output_tokensinteger· uint64min 0

      Per-generation output-token ceiling forwarded to the router.

    • max_total_tokensinteger· uint64min 0

      Hard input-plus-output token budget for the complete root-and-subagent session tree.

    • max_turnsinteger· uint32min 0
    • max_validation_retriesinteger· uint32min 0

      Per-turn override of the validation-retry budget.

    • metadataunknown

      Tracing passthrough.

    • outputany of

      The turn's deliverable; default `{ type: "text" }`.

      Show 2 nested
      any of (2)
      Variant 1
      one of (2)
      Variant 1
      • typestringrequiredenum text
      Variant 2
      • schemaunknown
      • typestringrequiredenum json
      Variant 2
      valuenull
    • provider_optionsobject

      Provider-native per-call options, namespaced by provider id.

    • reasoningany of

      Ask the harness to pick the effort from the model's catalog row instead of naming one: `lowest` is the model's lowest reasoning effort (never `off`), or the provider default when the model offers no effort choices. Exclusive with `thinking_level` and `provider_options`; the choice is returned as `reasoning` on the send response.

      Show 2 nested
      any of (2)
      Variant 1
      valuestringenum lowest
      Variant 2
      valuenull
    • require_existing_sessionboolean

      Refuse a missing session and never ensure/create it. Durable ask delivery uses this so an answer cannot resurrect a deleted session.

    • skillsstring[]

      Exact skill ids advertised to the model; omitted or empty means all on a new session (existing: omitted inherits, empty resets).

    • system_promptstring
    • system_prompt_strategyany of

      How `system_prompt` combines with the built-in prompt; omitting both prompt fields on an existing session inherits the prior prompt.

      Show 2 nested
      any of (2)
      Variant 1
      one of (3)
      Variant 1
      valuestringenum override
      Variant 2
      valuestringenum enrich
      Variant 3
      valuestringenum disabled
      Variant 2
      valuenull
    • thinking_levelany of

      Omitting both reasoning fields on an existing session inherits the prior turn's; naming either resolves fresh (`provider_options: {}` resets to the provider default).

      Show 2 nested
      any of (2)
      Variant 1
      one of (2)
      Variant 1
      valuestringenum minimal, low, medium, high, xhigh
      Variant 2
      valuestringenum off
      Variant 2
      valuenull
    Variant 2
    valuenull
  • providerstring
  • sessionany of

    Applied when this send creates/ensures the session.

    any of (2)
    Variant 1
    • kindstring

      Session kind stored on creation: `user` (default), `automation` or `e2e`. Opaque to the harness; validated by session-manager.

    • metadataunknown
    • titlestring
    Variant 2
    valuenull
  • session_idstring

    Omit to create a new session.

Response
  • acceptedbooleanrequired
  • compactionany of

    Set when the message was the `/compact` command: nothing was appended and no turn ran. The compaction runs in the background; its start and outcome reach every client through the transcript and `harness::on-compaction`.

    any of (2)
    Variant 1
    • compaction_idstringrequired
    • entry_idstringrequired

      The transcript row its start notice takes (the `idempotency_key`'s `e_idem_` id when the send carried one).

    Variant 2
    valuenull
  • deduplicatedboolean

    True when `idempotency_key` matched an earlier send.

  • mergedboolean

    True when folded into an in-flight turn (steering).

  • queuedboolean

    True when the message was queued while a step was streaming; it lands in the transcript when the stream ends.

  • reasoningany of

    What `options.reasoning` resolved to; absent when the send named none.

    any of (2)
    Variant 1
    • reasoning_effortstring
    • thinking_levelany of
      Show 2 nested
      any of (2)
      Variant 1
      one of (2)
      Variant 1
      valuestringenum minimal, low, medium, high, xhigh
      Variant 2
      valuestringenum off
      Variant 2
      valuenull
    Variant 2
    valuenull
  • session_idstringrequired
  • turn_idstringrequired

harness::session-tree

Function

Read the durable root-and-descendant session tree for one harness run.

Request
  • root_session_idstringrequired
Response
  • completebooleanrequired
  • root_session_idstringrequired
  • sessionsobject[]required
    • depthinteger· uint32requiredmin 0
    • parent_session_idstring
    • parent_turn_idstring
    • session_idstringrequired

harness::spawn

Function

Spawn a sub-agent in a child session (never an observer target) and return { child_session_id, child_turn_id } immediately; the child's outcome reaches you only through whatever destination its task names. Check `harness::status` for child health; children are leaves unless options.orchestrator is true.

Request
  • agentstring

    Directory agent profile id (`directory::agents::*`) supplying the child's prompt, skills, model, and display; refused with `options.system_prompt`. Omitted, an in-turn spawn continues the parent turn's profile (name `options.system_prompt` for a child that needs a different identity).

  • displayany of

    Display-only name/icon/color for the child session; never affects ids, policy, or routing.

    any of (2)
    Variant 1
    • colorany of
      Show 2 nested
      any of (2)
      Variant 1
      valuestringenum neutral, blue, purple, teal, green, amber, …
      Variant 2
      valuenull
    • iconany of
      Show 2 nested
      any of (2)
      Variant 1
      valuestringenum agent, code, search, terminal, database, test, …
      Variant 2
      valuenull
    • namestringrequiredmin 1 chars

      Short functional name such as `Frontend`; trimmed, and cut to its first 48 characters when longer.

    Variant 2
    valuenull
  • modelstring
  • optionsany of
    any of (2)
    Variant 1
    • filesystem_rootstring

      Absolute filesystem root for the child turn; omit to inherit the parent's (a reused child keeps its own).

    • functionsany of

      Dispatch policy for the child, intersected with the parent's (narrow, never escalate).

      Show 2 nested
      any of (2)
      Variant 1
      • allowstring[]
      • denystring[]
      • exposeall of
        Show 1 nested
        all of (1)
        Variant 1
        valuestringenum agent_call, native
      Variant 2
      valuenull
    • max_childreninteger· uint32min 0

      Fan-out guard for the child's own spawns.

    • max_output_tokensinteger· uint64min 0

      Inherits the parent's ceiling unless explicitly narrowed/overridden.

    • max_turnsinteger· uint32min 0

      Turn cap for the child, capped at the parent's remaining budget; omit unless required (small values strand the child).

    • max_validation_retriesinteger· uint32min 0

      Override of the child's validation-retry budget.

    • orchestratorboolean

      Let the child spawn, send, and remove observers (still capped by the parent's policy); default false makes it a leaf.

    • outputany of

      The child's deliverable: text / json / json+schema.

      Show 2 nested
      any of (2)
      Variant 1
      one of (2)
      Variant 1
      • typestringrequiredenum text
      Variant 2
      • schemaunknown
      • typestringrequiredenum json
      Variant 2
      valuenull
    • skillsstring[]

      Exact skill ids advertised to the child; omitted or empty means all (a reused child inherits when omitted).

    • system_promptstring
    • system_prompt_strategyall of

      How `system_prompt` combines with the built-in prompt.

      Show 1 nested
      all of (1)
      Variant 1
      one of (3)
      Variant 1
      valuestringenum override
      Variant 2
      valuestringenum enrich
      Variant 3
      valuestringenum disabled
    • thinking_levelany of
      Show 2 nested
      any of (2)
      Variant 1
      one of (2)
      Variant 1
      valuestringenum minimal, low, medium, high, xhigh
      Variant 2
      valuestringenum off
      Variant 2
      valuenull
    Variant 2
    valuenull
  • parent_session_idstring

    Display-only parent for the console tree when there is no live parent turn; grants no policy inheritance.

  • providerstring
  • session_idstring

    Session id to spawn into, created if absent; an existing id may be reused only inside the caller's own tree.

  • taskstringrequired

    The child's self-contained goal, its opening user message; name every required resource selector literally (the child cannot infer them).

Response
  • child_session_idstringrequired
  • child_turn_idstringrequired
  • reusedboolean

    The named session already existed and was reused — its prior transcript and parent linkage were retained (only possible with an explicit `session_id`).

harness::status

Function

Read a session's current turn. Returns a lean summary by default; pass verbose: true for the full runtime report and untruncated result.

Request
  • session_idstringrequired
  • verboseboolean

    Include the full runtime report and unmodified result.

Response
any of (2)
Variant 1
  • armed_wakesobject[]

    WHAT the session is parked on, when `expects_wake`: each armed wake's watch and deadline, so "parked 12m on state operation_meta/status — never written" is readable from the outside instead of the session just looking quietly done.

    • argsunknown
    • created_atinteger· int64required
    • expires_atinteger· int64
    • filtersunknown
    • function_idstring

      The observed function and the observer's args and filters. Absent on records without a source.

    • observer_idstringrequired
  • childrenobject[]required
    • function_call_idstringrequired
    • session_idstringrequired
    • turn_idstringrequired
  • contextany of

    The last generate step's context accounting (budget, categories, provider-exact usage once it lands) — what a UI meter should show instead of re-estimating the transcript. Verbose only; absent before the first generate.

    any of (2)
    Variant 1
    • categoriesobjectrequired

      Where the request's tokens sit. Categories are assembly-time estimates; `hook_guidance` is the measured growth after assembly (pre-generate hook appends and orphan-repair patches), 0 when the request left assembly unchanged.

      Show 6 nested
      • hook_guidanceinteger· uint64min 0
      • messagesobjectrequired

        Estimated tokens of the assembled window's messages, by role.

        Show 4 nested
        • assistantinteger· uint64requiredmin 0
        • custominteger· uint64requiredmin 0
        • function_resultinteger· uint64requiredmin 0
        • userinteger· uint64requiredmin 0
      • overheadinteger· uint64requiredmin 0

        Provider framing plus response_format / provider_options fields.

      • skillsinteger· uint64min 0

        Selected skill bodies contained in the system prompt.

      • system_promptinteger· uint64requiredmin 0

        Final assembled system prompt excluding tokens attributed to `skills`: identity, per-step aids, and any compaction summary section.

      • toolsinteger· uint64requiredmin 0

        Function schemas exposed to the model.

    • compactedbooleanrequired

      The context carries a conversation summary: compacted on this step, or anchored on an earlier compaction entry (a previous step, the console's `/compact`). The summary's tokens count in `system_prompt`.

    • effective_max_output_tokensinteger· uint64requiredmin 0

      Output allocation `usable` was derived against.

    • estimatorstring

      Which estimator produced the numbers (`heuristic` until the context-manager resolves a real tokenizer). Absent when the context-manager predates the breakdown response.

    • freeinteger· uint64requiredmin 0
    • modelstringrequired
    • prefix_divergencesobject[]

      Already-sent rows this session's requests rewrote, newest last (at most [`MAX_PREFIX_DIVERGENCES`]), carried from step to step.

      Show 9 nested
      • cache_readinteger· uint64min 0

        `usage.cache_read` of the rewriting request: what the provider still reused.

      • call_idstring
      • causestring

        What rewrote the row, as far as the harness can tell: `prune` (context-manager pruned or reduced function results to fit the budget that step) or `system_prompt` (row 0: a compaction summary or a prompt change).

      • indexinteger· uint64min 0

        First row (0 = system prompt, then one per message) that differs from the session's previous request. Absent when only the provider's wire mapping changed.

      • prev_leninteger· uint64min 0

        Rows the previous request carried.

      • provider_notestring

        The provider's own wire-level finding, cause included, when it reported one (a final-message warning starting with [`PROVIDER_PREFIX_NOTE`]).

      • rolestring
      • stepinteger· uint64requiredmin 0
      • turn_idstringrequired
    • prompt_sections_fallbackstring

      Why no shared prefix went out: `disabled` (config), `no_stable_prefix` (empty identity prompt) or `prefix_rewritten` (a pre_generate hook replaced the prompt head; its prompt still wins, it just shares nothing).

    • prompt_surface_digeststring

      Identity of the shared prompt prefix this generation went out with (`sha256:` of the stable section) — present only when the request carried `system_sections`. A local identity, never a provider hit; `usage.cache_read` is the reuse signal.

    • providerstring
    • session_cost_usdnumber· double

      Running cost of the whole session in USD, accumulated across every generation step. `usage.cost_usd` is one step's bill — on providers with steep cache discounts the per-step number swings two orders of magnitude, so a chip showing it alone reads as a bouncing total.

    • session_idstringrequired
    • stepinteger· uint64requiredmin 0
    • summarized_head_tokensinteger· uint64min 0

      Size of the history that summary replaced.

    • timestampinteger· int64required
    • totalinteger· uint64requiredmin 0

      Final request estimate: categories plus post-assembly growth.

    • turn_idstringrequired
    • usableinteger· uint64requiredmin 0

      The input budget the window was fit into.

    • usageany of

      Actual provider usage for this generation, stamped after the terminal frame; absent when the provider returned none (or the generation never completed).

      Show 2 nested
      any of (2)
      Variant 1
      • cache_readinteger· uint64min 0
      • cache_writeinteger· uint64min 0
      • cost_usdnumber· double
      • inputinteger· uint64min 0
      • outputinteger· uint64min 0
      • reasoninginteger· uint64min 0
      Variant 2
      valuenull
    Variant 2
    valuenull
  • depthinteger· uint32min 0
  • expects_wakeboolean

    The session owns an armed wake (a one-shot notify subscription, claimed or not, until its delivery has seeded the woken turn), or its finished turn drained a queued message and is about to be reseeded: a completed turn here is NOT the run's outcome — a later turn in this session carries it. Mirrors the `terminal` flag on `harness::on-turn-completed` (`expects_wake == !terminal`). Pollers (e.g. workflow reconcile) must treat `completed && expects_wake` as still running.

  • failureany of

    Why a `failed` turn failed: `code`, and `retryable` when the failure is temporary, so a later send into this session may succeed. Present in the lean report too, only on a failed turn.

    any of (2)
    Variant 1
    • codestringrequired

      The failure code, e.g. `router/provider_transient` or `harness.turn_internal`.

    • retryablebooleanrequired

      The failure is temporary, so a later send into the session may succeed: a provider outage, rate limit or cut stream that outlasted the turn's `max_transient_resumes` recovery generations, or a turn the harness could not schedule.

    Variant 2
    valuenull
  • max_transient_resumesinteger· uint32min 0
  • max_turnsinteger· uint32min 0
  • max_validation_retriesinteger· uint32min 0
  • open_asksinteger· uintmin 0
  • partial_result_availableboolean
  • pending_function_callsstring[]
  • queuedobject[]

    Messages queued while a step streams, in arrival order; they land in the transcript when the stream ends.

    • channelany of

      How the message reached the session: `direct` is a person (or a client acting as one), `notification` an observer or system notice, `invoked-agent` a sub-agent's opening task. Absent on rows parked by a harness that predates the field. The console hides every row that is not `direct` from the person's queued-messages strip.

      Show 2 nested
      any of (2)
      Variant 1
      valuestringenum direct, invoked-agent, notification
      Variant 2
      valuenull
    • entry_idstringrequired

      Deterministic transcript entry id the drain appends under, so a redelivered drain is a no-op.

    • idstringrequired
    • messageany ofrequired

      The canonical transcript message union. Untagged: the single-variant role tags disambiguate deserialization (assistant/function_result/custom are tried before user so their required fields gate the match).

      Show 4 nested
      any of (4)
      Variant 1
      • contentone of[]required
        Show 7 nested
        one of (7)
        Variant 1
        • textstringrequired
        • typestringrequiredenum text
        Variant 2
        • attachment_idstring

          Optional link to the stored original of this inline image (`session::put-attachment`, resolvable with `session::get-attachment`). Lets readers ask `session::messages { include_image_data: false }` and fetch the bytes lazily instead of receiving them inline. Persisted verbatim on the transcript; model-bound consumers never see it (see [`ContentBlock::strip_files`]). Omitted on the wire when absent so legacy transcripts stay byte-identical.

        • datastringrequired
        • mimestringrequired
        • typestringrequiredenum image
        Variant 3
        • attachment_idstringrequired
        • mimestringrequired
        • namestringrequired
        • sizeinteger· uint64requiredmin 0
        • typestringrequiredenum file
        Variant 4
        • signaturestring
        • textstringrequired
        • typestringrequiredenum thinking
        Variant 5
        • datastringrequired
        • typestringrequiredenum redacted_thinking
        Variant 6
        • argumentsunknownrequired
        • function_idstringrequired
        • idstringrequired
        • typestringrequiredenum function_call
        Variant 7
        • contentunknown[]required
        • function_call_idstringrequired
        • is_errorboolean
        • typestringrequiredenum function_result
      • error_kindany of
        Show 2 nested
        any of (2)
        Variant 1
        valuestringenum auth_expired, rate_limited, context_overflow, transient, permanent
        Variant 2
        valuenull
      • error_messagestring
      • modelstringrequired
      • native_stop_reasonstring
      • providerstringrequired
      • rolestringrequiredenum assistant
      • stop_reasonstringrequiredenum end, length, function_call, aborted, error
      • timestampinteger· int64required
      • usageany of
        Show 2 nested
        any of (2)
        Variant 1
        • cache_readinteger· uint64min 0
        • cache_writeinteger· uint64min 0
        • cost_usdnumber· double
        • inputinteger· uint64min 0
        • outputinteger· uint64min 0
        • reasoninginteger· uint64min 0
        Variant 2
        valuenull
      • warningsstring[]
      Variant 2
      • contentone of[]required
        Show 7 nested
        one of (7)
        Variant 1
        • textstringrequired
        • typestringrequiredenum text
        Variant 2
        • attachment_idstring

          Optional link to the stored original of this inline image (`session::put-attachment`, resolvable with `session::get-attachment`). Lets readers ask `session::messages { include_image_data: false }` and fetch the bytes lazily instead of receiving them inline. Persisted verbatim on the transcript; model-bound consumers never see it (see [`ContentBlock::strip_files`]). Omitted on the wire when absent so legacy transcripts stay byte-identical.

        • datastringrequired
        • mimestringrequired
        • typestringrequiredenum image
        Variant 3
        • attachment_idstringrequired
        • mimestringrequired
        • namestringrequired
        • sizeinteger· uint64requiredmin 0
        • typestringrequiredenum file
        Variant 4
        • signaturestring
        • textstringrequired
        • typestringrequiredenum thinking
        Variant 5
        • datastringrequired
        • typestringrequiredenum redacted_thinking
        Variant 6
        • argumentsunknownrequired
        • function_idstringrequired
        • idstringrequired
        • typestringrequiredenum function_call
        Variant 7
        • contentunknown[]required
        • function_call_idstringrequired
        • is_errorboolean
        • typestringrequiredenum function_result
      • detailsunknownrequired
      • function_call_idstringrequired
      • function_idstringrequired
      • is_errorbooleanrequired
      • rolestringrequiredenum function_result
      • timestampinteger· int64required
      Variant 3
      • contentone of[]required
        Show 7 nested
        one of (7)
        Variant 1
        • textstringrequired
        • typestringrequiredenum text
        Variant 2
        • attachment_idstring

          Optional link to the stored original of this inline image (`session::put-attachment`, resolvable with `session::get-attachment`). Lets readers ask `session::messages { include_image_data: false }` and fetch the bytes lazily instead of receiving them inline. Persisted verbatim on the transcript; model-bound consumers never see it (see [`ContentBlock::strip_files`]). Omitted on the wire when absent so legacy transcripts stay byte-identical.

        • datastringrequired
        • mimestringrequired
        • typestringrequiredenum image
        Variant 3
        • attachment_idstringrequired
        • mimestringrequired
        • namestringrequired
        • sizeinteger· uint64requiredmin 0
        • typestringrequiredenum file
        Variant 4
        • signaturestring
        • textstringrequired
        • typestringrequiredenum thinking
        Variant 5
        • datastringrequired
        • typestringrequiredenum redacted_thinking
        Variant 6
        • argumentsunknownrequired
        • function_idstringrequired
        • idstringrequired
        • typestringrequiredenum function_call
        Variant 7
        • contentunknown[]required
        • function_call_idstringrequired
        • is_errorboolean
        • typestringrequiredenum function_result
      • custom_typestringrequired
      • detailsunknown
      • displaystring
      • rolestringrequiredenum custom
      • timestampinteger· int64required
      Variant 4
      • contentone of[]required
        Show 7 nested
        one of (7)
        Variant 1
        • textstringrequired
        • typestringrequiredenum text
        Variant 2
        • attachment_idstring

          Optional link to the stored original of this inline image (`session::put-attachment`, resolvable with `session::get-attachment`). Lets readers ask `session::messages { include_image_data: false }` and fetch the bytes lazily instead of receiving them inline. Persisted verbatim on the transcript; model-bound consumers never see it (see [`ContentBlock::strip_files`]). Omitted on the wire when absent so legacy transcripts stay byte-identical.

        • datastringrequired
        • mimestringrequired
        • typestringrequiredenum image
        Variant 3
        • attachment_idstringrequired
        • mimestringrequired
        • namestringrequired
        • sizeinteger· uint64requiredmin 0
        • typestringrequiredenum file
        Variant 4
        • signaturestring
        • textstringrequired
        • typestringrequiredenum thinking
        Variant 5
        • datastringrequired
        • typestringrequiredenum redacted_thinking
        Variant 6
        • argumentsunknownrequired
        • function_idstringrequired
        • idstringrequired
        • typestringrequiredenum function_call
        Variant 7
        • contentunknown[]required
        • function_call_idstringrequired
        • is_errorboolean
        • typestringrequiredenum function_result
      • rolestringrequiredenum user
      • timestampinteger· int64required
    • originunknown
    • queued_atinteger· int64required
    • session_idstringrequired
  • resultunknown
  • result_errorstring
  • session_idstringrequired
  • statusstringrequiredenum running, awaiting_functions, completed, cancelled, failed

    The coarse, harness-internal turn lifecycle (harness.md § API Reference). Finer-grained than the session's `status`, which the loop derives from it.

  • stepinteger· uint64requiredmin 0
  • stop_reasonstring

    Why a `completed` turn stopped when the model did not end it itself (`max_turns`). Present in the lean report too: a poller that reads `completed` with no error must still be able to tell an exhausted budget from a finished task.

  • transient_resumesinteger· uint32min 0
  • turn_countinteger· uint32requiredmin 0
  • turn_idstring
  • validation_retriesinteger· uint32min 0
Variant 2
valuenull

harness::stop

Function

Request cancellation of an in-flight turn (cascades to spawned children).

Request
  • quiet_deadlinesboolean

    For a stop that means no more turns: a session parked on a wake has no turn to cancel, so also record the stop on it. That wake's deadline then retires it without starting a turn, and the last one ends the session as cancelled; a delivery still wakes it. Omit to leave a parked session to end on its next wake, its deadline included.

  • session_idstringrequired
  • turn_idstring

    Omit to stop the current turn.

Response
  • stoppingbooleanrequired

harness::sweep-pending

Function

Internal cron sweep: resolve pending function calls past their timeout and re-enqueue the step of running turns left without one, so a turn never wedges; then move finished turn records' inline prompts to shared bodies and delete unused bodies. Not called directly.

Request
  • scheduled_atinteger· int64
Response
  • convertedinteger· uint64min 0

    Finished turn records rewritten with prompt refs.

  • okbooleanrequired
  • prompts_collectedinteger· uint64min 0

    Unreferenced prompt bodies deleted.

  • redriveninteger· uint64min 0

    Number of orphaned running turns whose step was re-enqueued.

  • resolvedinteger· uint64requiredmin 0

    Number of expired pending calls resolved this sweep.

harness::system-prompt::get

Function

Preview the system prompt layers a session will use without making a model request.

Request
  • default_onlyboolean

    Return only the built-in default layer, without session, runtime, registry, or hook layers.

  • filesystem_rootstring
  • selected_promptany of
    any of (2)
    Variant 1
    • bodystringrequired
    • namestringrequired
    • strategyall of
      Show 1 nested
      all of (1)
      Variant 1
      one of (3)
      Variant 1
      valuestringenum override
      Variant 2
      valuestringenum enrich
      Variant 3
      valuestringenum disabled
    Variant 2
    valuenull
  • session_idstringrequired
Response
  • partsobject[]required
    • bodystringrequired
    • kindstringrequiredenum built_in, selected, skills, runtime, injected
    • namestring

harness::teardown

Function

Internal control-plane: remove the observers a root harness session tree created.

Request
  • root_session_idstringrequired
Response
  • removedinteger· uint64requiredmin 0

harness::turn

Function

Internal durable loop step (enqueued onto the harness-turn queue); not called directly.

Request
  • depthinteger· uint32min 0

    Sub-agent depth carried from the turn record (0 = top-level).

  • message_previewstring

    Preview carried from the turn record so the step can stamp the `iii.tag.message` baggage before any state read.

  • session_idstringrequired
  • stepinteger· uint64requiredmin 0
  • turn_idstringrequired
Response
  • next_stepinteger· uint64min 0
  • session_idstringrequired
  • skippedboolean

    True when a redelivered/stale step was acked and dropped.

  • statusstringrequiredenum running, awaiting_functions, completed, cancelled, failed

    The coarse, harness-internal turn lifecycle (harness.md § API Reference). Finer-grained than the session's `status`, which the loop derives from it.

harness::ui-content

Function

Serve the harness worker's injected console UI assets (the target of its ade::ui::asset observers; the console calls it through each asset's observer with {path}).

Request
  • pathstringrequired

    The asset path from the observer's args (e.g. `state/page.js`).

Response
  • contentstringrequired

    The asset source, verbatim.

  • content_typestringrequired

    MIME type the console should serve the asset with.

harness::unobserve

Function

Remove an observer the current harness session created (`id` is the observer_id harness::observe returned).

Request
  • idstringrequired
Response
  • removedbooleanrequired

harness::unqueue

Function

Internal control-plane: remove a still-parked queued message by entry_id (the console's edit-queued path).

Request
  • entry_idstringrequired

    The queued row's transcript entry id, as surfaced by `harness::status` → `queued[].entry_id`. Stable and client-visible (the internal row id is not), so removals target it.

  • session_idstringrequired
Response
  • removedbooleanrequired

    False when no still-parked row matched — already drained or unknown.

Search the registry

Find workers, kits and executables, or jump to a page.