Agents and delegation
A delegated worker gets a message and its own conversation. It does not receive the caller’s intervening history automatically. To review the current changes for the unchecked count in notes.txt, give the reviewer the file, the question, and the context it needs:
(agent/ask 'reviewer "Read notes.txt in our workspace.Check the caller's count of twounchecked items. Count '[ ]' linesand quote them. Do not edit files.Report whether the count is correct.")This is an example request, not a claim that a reviewer ran it. If the file contains the three lines shown on the Harness entry page, the answer should identify two unchecked items. The request supplies that expected context; the worker does not inherit the caller’s history or the entry page’s example by magic.
One request, two conversations
Section titled “One request, two conversations”reviewer is a reusable recipe. The daemon finds or starts its worker, records the delegated call in the caller’s turn, and delivers the message as an inbound turn in the worker’s session. The worker uses its own instructions, history, model requests, and tool results. Its response returns as the result of agent/ask:
Caller session agent/ask waits │ sends message ▼Reviewer session own Agent and history inbound turn model → tools → model agent__respond │ returns response ▼Caller uses the resultThe worker must close the open request by calling the agent__respond JSON tool. A statement in its transcript alone does not return a result. If a model reply ends while the request remains open, the runtime schedules another round and reminds the worker to respond; that is not a fixed-time guarantee. The Scheme call waits for the explicit response.
The worker’s conversation is its own session document, not a copy added to the caller’s history. The caller sees the returned answer and can decide what to do with it. A reusable recipe is a BotSpec; the worker’s saved instructions and settings are an AgentSpec; the conversational instance is an Agent. During the conversation, an Actor handles one model request and records its outcome. The Agent carries the continuing conversation; the Actor handles a single request within it.
Roles without a fixed team
Section titled “Roles without a fixed team”The caller assembles workers around the task. It asks one worker a small question, starts fresh workers for independent investigations, and returns to the same reviewer for a follow-up. A recipe such as reviewer supplies instructions and tools. Calling it creates the work; defining the role does not schedule it.
The runtime records the relationship between the conversations: who is waiting, which request the response closes, and what result returns. The reused reviewer keeps its earlier discussion, so a correction continues that conversation rather than starting another briefing.
A task needs workers and explicit requests, not a simulated management hierarchy. Composing tools shows how the interpreter dispatches known handoffs and collects their results.
What the worker receives
Section titled “What the worker receives”A fresh worker receives its recipe instructions and the message sent with that call. Put the task, relevant facts, and paths in that message. A named recipe supplies its task tools; the host also supplies evaluation, communication, and session-bookkeeping operations. Available tools still pass normal authorization; a recipe is not permission to run them.
An anonymous (agent/ask "message") starts a fresh worker with a small default tool set, not file-reading, search, or shell tools. For file investigation, choose a recipe such as explore. Loading a .prompt module can explicitly request tool inheritance; that is separate from an ordinary anonymous ask. The live tool description calls an anonymous ask a “full worker,” but that wording does not grant it domain tools.
Workers in the same project use the shared workspace. Separate conversations do not mean separate checkouts: a worker’s changes are visible to the caller and other workers. Toolkit file writers coordinate writes to a path, but shell commands and external editors are outside those locks. This is not an isolated or transactional workspace.
When a worker’s connection or model setting is empty, the runtime fills it from the caller first, then project and kernel defaults. A reused worker keeps settings already filled in, so a later caller model change need not change it. A one-shot call may pin a model with :model "connection/model".
Reuse or start fresh
Section titled “Reuse or start fresh”Built-in named recipes use session scope: a caller reuses the same worker on later calls in that session. The reviewer can remember earlier reviews, but receives only the new message, not the caller’s intervening conversation. Project scope shares a worker among callers in the project; global scope shares one across the kernel. Another caller session gets a separate session-scoped reviewer.
For an independent review, use a one-shot call. It starts a fresh conversation from the recipe and does not add that worker to the reusable roster:
(agent/one-shot/ask 'reviewer "Read notes.txt in our workspace.Check the caller's count of twounchecked items. Count '[ ]' linesand quote them. Do not edit files.Report whether the count is correct." :readonly #t)This is also illustrative, not an executed review. One-shot means a fresh conversation, not deletion of the saved session document after its response.
What readonly actually restricts
Section titled “What readonly actually restricts”Session-scoped and one-shot workers follow the caller’s current permission mode and delegated allow/block settings. Changes to those settings are reflected while the worker runs, and its approval requests can appear in the caller’s TUI. These settings govern whether a tool may run; they do not add tools to the recipe. Project- and global-scoped workers keep their own permission settings rather than following one caller.
:readonly #t removes write-class tools from the worker’s Scheme bindings. It does not remove direct JSON write tools granted by the recipe. Shell remains available when the recipe grants it, and shell commands can change files. Readonly is not a filesystem sandbox; direct tool requests still follow normal policy.
How calls finish
Section titled “How calls finish”agent/ask waits for an explicit response. agent/send also waits, but lets the worker close the request without a response through agent/void. agent/message delivers additional input without waiting for a reply.
A response schema can constrain an anonymous or named one-shot ask:
(agent/one-shot/ask 'reviewer "Does the proposed changealter the public API?" (dict :answer (s/enum "yes" "no")) :readonly #t)The schema constrains the answer, not how the reviewer investigates. Ordinary reused named asks reject response schemas. Independent one-shot calls can overlap inside map; calls to the same reused named worker are serialized there. Composing tools explains how evaluation waits for dependent results.
When the caller disconnects
Section titled “When the caller disconnects”An ordinary session parks when its clients leave. Its session-scoped and one-shot workers can park too when they lose their only active caller. A worker still needed by another eligible caller can remain active; project- and global-scoped workers have different lifecycle rules. Already-dispatched MCP calls and active CLI evaluations have their own settlement rules.
Parking keeps the conversation and open requests for reattachment. It is not a response, cancellation, or crash. Runtime and session state explains those boundaries.
Implementation sources
Section titled “Implementation sources”Paths are relative to the Harness repository. Recipes and saved agent settings are in packages/harness-model/src/kernel/BotSpec.ts and packages/harness-model/src/session/Agent.ts. Worker creation, delivery, model inheritance, and reused-call behavior are in packages/harness-server/src/daemon/session/SessionOrchestrator.ts; tool selection is in packages/harness-server/src/toolkit/tool-table.ts and packages/harness-tool-runtime/src/worker-tools.ts. Delegated permissions are in packages/harness-sdk/src/worker-permissions.ts.
The readonly distinction follows packages/harness-scheme-runtime/src/bound-tools.ts, env.ts, and the named-worker assertions in packages/harness-server/src/scheme-repl/__tests__/agent.test.ts. The implementation’s anonymous default tool set, rather than the “full worker” label in a live tool description, is the basis for the limit described above.