GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — harness/CHANGELOG.md at main · majorcontext/harness

Expand file tree

/

CHANGELOG.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
460 lines (368 loc) · 210 KB
/

CHANGELOG.md

Copy path

File metadata and controls

460 lines (368 loc) · 210 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Changelog

Harness is a fast, extensible, composable agent harness in Go. It ships a headless runtime library, a CLI, and an HTTP+SSE server.

Harness is pre-1.0. The runtime API, config schema, and plugin protocol may change between minor versions.

v0.1.0 — Unreleased

First tagged release.

Added

  • Claude Code config_dir (config) — a claude-code-cli entry names the CLI config directory, the CLAUDE_CONFIG_DIR of every process of the CLI for the entry: each run, the login check, the ACP login gate and authenticate, and harness login claude-code and harness logout claude-code. session_mirror needs it: the backend writes the saved transcript into that directory before a run and removes it after the run, in place of a new empty directory, so a mirrored run has the login, settings, and CLAUDE.md of the operator and a true --resume works on a host whose disk does not survive.
  • harness sessions import — fills an empty session directory from SyncBatch JSON lines on stdin, applied in order with the receiver rules of Sync. harness serve on that directory then lists and resumes the sessions.

Fixed

  • Claude Code session mirror after a crash — a session_mirror run now saves its transcript while it runs, at each mirror frame that holds a message, in place of only at the end of the run. When the harness process or its host dies in the middle of a turn, the next turn resumes the CLI with the messages and tool calls of the killed run, not on the older transcript.

  • Claude Code session with a lost transcript — when the Claude Code CLI no longer has the conversation that a session resumes (for example on a new machine with an empty ~/.claude), the turn no longer fails with No conversation found with session ID. The backend runs the same turn once on a new CLI session, which reads the earlier conversation through get_conversation_history, and later turns resume the new session.

  • Cross-backend model tool switch — a model API turn refuses a switch to a backend that owns its loop as a tool error. The turn continues on its current model; use session settings between turns, or spawn a task with the target model.

  • Code tool names — tools with hyphens have collision-safe callable aliases. call(tool, **kwargs) calls an exact tool name or function and stops on errors. Undefined names suggest tool calls, and search_tools accepts query=. The fixed description guides small results, safe bash input, and subagent session IDs without status polling.

  • Tasks from code scripts — scripts can call every task action, including through attempt. A spawned child reports later to its parent session; a script timeout or interrupt does not cancel it.

  • Code mode on a backend that owns the loop — a session in code mode now refuses a direct call of a tool that a script calls, with the same text and code as the harness loop, when the call arrives from a backend that owns the loop (Claude Code). The backend sends the mode text as engine context with the next input after a switch, with the first input of a session that starts in code mode, and again after a compaction. The log records what was sent, so a restart repeats nothing. The tools of the MCP endpoint are the same in both modes. PATCH with code_mode true no longer needs code in a declaration when the session runs on such a backend, and a model change between the two kinds of backend states the mode once.

  • Thinking blocks after a compaction — the Anthropic wire sends no thinking block for a message that the newest compaction kept, so a model that binds a thinking block to the content before it no longer answers HTTP 400 on the first call after a compaction. The history and the log keep the reasoning.

  • Session MCP loading — the servers of WithSessionMCP start to connect when the session is created or opened, and a turn never waits for them: a server that has not connected yet loads in the background, its tools stay behind the mcp tool so the tool definitions of the request never change, a transient notice says that its tools are loading, and a call to one of them waits at most 1 s and then answers <server> tools are still loading; try again shortly. Session.AwaitMCP(ctx) waits for the first attempt of each session server for a host that wants the tools in the first request; the ACP agent calls it for the mcpServers of a session.

  • MCP connect bound — connect_timeout_s also bounds a read of the tool list that a tools/list_changed notification starts, so a slow read no longer takes the fixed 15 s when a smaller timeout is set.

  • MCP bounds — the config keys mcp_response_bytes (default 1 MiB), mcp_result_bytes (default 256 KiB), and mcp_turn_calls (default none) bound the body of an HTTP MCP response, the result that the model reads (cut with a marker), and the MCP tool calls of one turn (a call over the bound is an error result).

  • Durable notices — every notice of a harness-loop session is a pin that the log holds: the MCP down notice, the added-tools notice, the plugin segment, the skills notice, and the process status. A model call that finds a text that differs from the newest notice of its kind appends one pin.recorded record before the request is built, so a restart or a new owner with the same live state sends the same bytes and appends nothing. The MCP down notice follows the same rules and adds [mcp: every server is connected again.] once when the last server connects. The first call of a new process no longer pins a notice that the log never recorded after the banner: it follows the history of its call. A compaction still keeps the newest notice of each kind, and the call that declares the prefix afterwards retires the added-tools notice for tools that are now declared, the skills notice that the new system prompt states, and the removed-server notice for a server that the declaration records as gone (gone in the declaration blob). A pin.recorded record with no text retires every pin of its kind. The transient notice of a session server that still loads is unchanged.

  • MCP error text — a failed MCP call tells the model mcp: server "<name>": call failed: <why> with the HTTP status or the JSON-RPC code, and never the text of the remote error, so a credential in that text stays out of tool results, events, and spans.

  • Session MCP shutdown — the end of a session waits for the WithSessionMCPAuthFailed calls in flight, so fn never runs after Release, End, or Close returns, and fn must not stop the session. The DELETE that ends a remote HTTP MCP session runs in the background, owned by the runtime and joined by Runtime.Close, so a release, a later Open of the session, and a connect that times out do not wait for the remote server.

  • MCP HTTP redirects — a Streamable HTTP MCP server can no longer redirect a request to another origin. The request is refused with the reason redirect refused, so the headers, the Harness-Session-Id header, and the body stay with the origin of the entry. config.MCPServerSpec.HTTPClient sets the client of one entry in Go; a client with its own CheckRedirect keeps its policy.

  • Account-selected tool calls — eligible tools can start while the model response is still streaming when an account is selected.

  • Tool input errors — live tool availability frames include a bounded, masked normalization error while retaining the raw input.

  • Step finish reasons — a step that ends on an output limit or a refusal reports the normalized provider finish reason.

  • Retry after tool block start — Options.DisableRetryAfterOutput stops recovery resends after a tool block starts, even when the stream ends before the tool input is complete.

  • Tool cancellation and session cleanup — cancellation stops waiting for custom tools that ignore their context and discards late results. Synthetic cancellation uses the standard context error and leaves accepted callback results and the turn stop cause unchanged. Runtime.End and session deletion cancel busy work instead of returning 409, withdraw queued inputs, and continue cleanup after caller timeout, including when a graceful release has started. A pending lifecycle stop keeps its first cause across shutdown and revocation, including cancellation during an append. Durable logs stay in the store; embedders own their deletion after the session's Done closes.

  • MCP skill integrity — skill pagination has a separate deadline from connection setup. An incomplete skill list cannot make an uncovered resource bypass skill verification, regardless of URI scheme; load the skill before reading its files. Tool-list refreshes preserve skill entries and their incomplete-list error.

Added

  • Tool changes on the Anthropic wire (config, internal/modelmeta, internal/provider/anthropic, internal/turn) — on a model that takes the mid-conversation-tool-changes-2026-07-01 beta, code mode sends the tools that it hides with defer_loading: true, and a mode switch appends one system message with tool_removal and tool_addition blocks in place of the engine-context notice, so a switch never changes an earlier byte. A request that holds code sends the beta header from its first call, so the header changes only at a declaration. The new key providers.anthropic.tool_changes turns it on or off; it defaults to on only for the direct Anthropic API.

  • Code mode setting — code_mode in CreateSession, SettingsPatch, settings.changed, and the session view switches a session between calling tools directly and calling them through the code tool. A switch appends one code-mode notice at the next model call and changes no byte of the earlier request; a direct call of a tool that only a script calls is refused with an error result. Each prefix.declared record holds the mode as code_mode.

  • code tool (config, internal/tool/codetool, internal/turn, protocol) — with code_mode true, every session has a code tool that runs a Starlark script. The script calls the other tools as functions (attempt, parallel, search_tools, describe_tool, json), and the model reads only the printed output and the last value. Each nested call passes the allowed tools, the hooks, and the scheduler of its model call, and appends a nested_call.recorded event that no model reads. turn gains the optional Nesting interface of a tool. The WebAssembly module offers no code.

  • Durable tool declaration (internal/session, internal/eventlog, protocol, docs/architecture.md) — a session records its tools and its MCP prompt segment in a prefix.declared event and a blob, so a restart and a new owner send the same tools array and prompt segment, with a tool that was not declared deferred. The session declares again at a compaction between two turns, at a change of the model with other tools, and at the first call of a process when a declared tool has a changed input schema.

  • Live tools at each declaration (internal/tool/mcpsrc, internal/tool/pluginsrc, docs/architecture.md) — a new declaration takes the tools, the definitions, the servers, the plugins, and the MCP prompt segment that the running process has, so a change of an MCP server or of the plugins reaches a running session at its next compaction between two turns, with no restart. The runtime keeps no first definition of a tool, no tool set of a first connect, and no MCP surface decision for the life of the process. A session keeps its declaration between two declarations.

  • Durable system prompt (internal/session, internal/selftool, sessionprompt.go, docs/architecture.md) — the declaration of a session holds its system prompt: the segments, the instructions files, the skills, the embedded skills, and the body of an agent profile. Every model call of a backend that does not own the loop sends the prompt of the newest declaration, in every process, and Open reads no prompt file for a session that has one. A new declaration reads the files again, so an edit of AGENTS.md reaches a running session at its next compaction between two turns, with or without a restart. The embedded skills of the declaration are the baseline of Skill updates, and session_info reports the declared prompt and tools. A session whose declaration holds no system prompt declares again at its next model call.

  • Turn context — harness.WithTurnContext(text) is an option of Session.Prompt, Session.PromptStream, and Turn.Steer. The model reads the text as engine context after the input on each model call of that turn, and no event, history read, or later turn holds it. It is not persisted. turn_context in the body of POST /sessions/{id}/inputs (protocol.Input.TurnContext, at most 4096 bytes) sets the same text over HTTP; a repeat of the input ID with another turn_context is a repeat and keeps the first text. Claude Code reads the text once, on the stdin line of the input that carries it.

  • Auth failure of a session MCP server — harness.WithSessionMCPAuthFailed(fn) calls fn(server, status) when a server of WithSessionMCP answers 401 or 403, so an embedder can mark the connection for reconnect. mcp.HTTPStatusError carries the status and no body, and an MCP log line holds the server, a reason, and the HTTP status or JSON-RPC code, never the text of the remote error.

  • Allow one MCP server — an AllowedTools entry mcp__<server>__* allows every tool of that runtime or session MCP server, a tool that arrives later included. An embedder no longer lists a server before it creates the session.

  • GPT-6.2 on the codex route — the static codex catalog lists gpt-6.2-sol and gpt-6.2-astra, with their models.dev window and efforts. The ChatGPT model-list request sends client_version 0.169.0, so the backend no longer hides models that need Codex CLI 0.166.0 or later.

  • Effort of an input — protocol.Input has an Effort field. A turn whose inputs all set an effort runs its model calls at the highest of them, and any other turn uses the effort of the session. The session setting does not change and the log gets no settings.changed event.

  • Newest-first session list — GET /sessions?order=newest lists sessions newest first, and protocol.ListSessions has a Newest field. It combines with parent, so a client reads the newest children of a session in one request. after names the last session of the previous page in the same order, and the list builds a view only for the sessions that it returns.

  • Child session list — GET /sessions?parent=<id> lists only the children of a session, and the list describes no other session, so the cost follows the number of children and not the number of sessions. protocol.ListSessions has a Parent field.

  • File attachments — an input accepts a blob of any media type with a name. The runtime writes a file that no provider takes to .harness/attachments/<sha256>/ and tells the model its path in a <harness-attachment/> tag.

  • Sender attribution — the model reads who sent each input that names a source_label: the self-closing tag <harness-sender name="<label>" source="<source>"/> leads a turn's input and follows the number of a steer item (source is absent when empty; name and source are XML-escaped). Readers and the event log are unchanged; an input of source command names no sender.

  • Tool input normalization — tools can opt in to normalize input once in harness-owned loops. Successful normalization supplies the canonical call input to execution, events, forwarding, and later model requests. A normalization error retains the raw input, records a tool error, and prevents execution. Plugin Before hooks see the normalized input; their rewrites affect execution only.

  • Ordered tool blocks (protocol) — model API streams announce tool calls when their identity is known and when their full input is available, interleaved with text. PromptStream retains these frames for lossless consumption.

  • Parallel embedder tools (harness) — a ParallelTool changes state, but its calls run beside the other read-only and parallel calls of their model call, up to 8 at once. A later call that is not read-only or parallel waits for them. Calls with the same non-empty KeyedTool key still run one at a time, in call order, and an AloneTool that is also a ParallelTool runs alone. Spec().ReadOnly keeps its meaning.

  • Durable step boundaries (protocol) — step.started and step.ended identify logical model steps by turn and zero-based index, with the normalized finish reason on completion. Backends that cannot expose steps omit them.

  • Contextual tool stop (harness) — Options.StopAfterContext inspects the current turn’s recorded text and tool results. Options.StopAfterErrors optionally includes failed results in predicate evaluation; named-tool stops and default behavior remain unchanged.

  • Lossless prompt streams (harness) — Session.PromptStream subscribes before admitting a new queued input. Its owned stream keeps every delta and item lifecycle frame in order, even if reading begins after the turn ends. Slow readers use unbounded queue memory without blocking the actor; close an unread stream to release it. Existing event streams keep best-effort live delivery, with completed-item reconciliation as a backstop. Options.DisableRetryAfterOutput lets append-only clients fail rather than resend a model call after its first output delta; later model calls retain their own pre-output retry budget, and the default policy stays unchanged.

  • Anthropic cache controls (config.Provider) — CacheFinalMessage (cache_final_message) can disable the automatic final-message cache marker while keeping the selected system marker. Nil or true keeps the default behavior. Embedding and config docs show the existing five-minute TTL option.

  • Conditional tool stop (harness) — Options.StopAfter lets an embedder end a turn based on a successful tool result, after result hooks and before retention. Every call in the step still finishes and is recorded. Existing named-tool stops stay independent; backends that own their loop ignore the predicate.

  • Per-session system blocks and cache selection (protocol.CreateSession) — SystemBlocks replaces the default prompt for one session and survives reopen. SystemCacheBreakpoint selects the Anthropic system block to cache; absent keeps the last-block default. The newest message marker and configured TTL stay unchanged.

  • Tools start while the model streams (harness) — a tool call starts when the model stream delivers it complete, not after the model call ends. Calls of ReadOnly tools run together; every other call runs alone, in arrival order, as in Codex. Results are still recorded in call order after the model call ends. A call that started may already have had its effect when the model call fails. Backends that own their loop are unchanged.

  • Stop after tools (harness) — Options.StopAfterTools lets an embedder end a turn after a successful named tool call, without another model request. All calls in the step finish first. Backends that own their loop do not use this option.

  • Faster stopped-session reads (harness, store) — disk stores persist disposable light checkpoints and fetch source records by sequence, so message pages need not rebuild every message body. Session listings describe sessions concurrently while keeping creation order. Checkpoints use the harness module identity; a local-path dependency replacement bypasses the cache.

  • Turn continues the trace of its one input (internal/session, protocol, docs/architecture.md) — a turn that starts from exactly one input with a valid traceparent makes its invoke_agent span a child of that span, in the same trace, with no link. A turn that starts from no such input, or from two or more, is still a root that links to each. The turn of a child session, the parent turn that reads a child report, a goal continuation turn, and the /compact turn of a backend that owns its context follow the same rule. A steer input still adds a link.

  • Live provider set (harness, internal/backend, internal/provider, internal/server, protocol, docs/architecture.md) — Runtime.SetProviders and PUT /providers replace the whole map of configured provider entries of a running runtime, and the set is not persisted. An entry whose config and API key are the same keeps its client, websocket pool, and catalog. A new or changed entry gets a new backend, and an entry that is left out takes no new call and closes after its calls in flight end. The body is validated as the config is, a failure is invalid_request and changes nothing, and the answer lists each provider with available and a reason, never a key or a header. Runtime.ReconnectProvider and POST /providers/{name}/reconnect move the credential revision of one entry: each pooled websocket keeps the revision that it was dialed under, so idle older sockets close at once, a busy one closes when its call ends, and the next connection authenticates again. A new login generation of an auth injected entry moves the revision too. A session whose provider is gone fails its next model call with model_unavailable.

  • jj engine for /workspace/changes (internal/workspace, protocol, docs/architecture.md) — a directory in a Jujutsu work tree now answers with engine jj, also when it is a git work tree too, and it needs jj on PATH. The head is @- as a change revision, the label is the nearest local bookmark, and the base is the fork point of @- and trunk(). The diff is the files on disk against the base or @- (the automatic merge for several parents), read from the git store without a snapshot or an operation, and a file that @ records as a conflict has the status conflicted. The response has a new field head_commit, the git commit ID of the head, present exactly when head_rev is. The contract table no longer allows an engine to snapshot on read. A jj repository config that sets harness.changes-command to an array of strings makes the engine run that command in the root instead of the git store diff, with HARNESS_CHANGES_SCOPE, HARNESS_CHANGES_BASE, and HARNESS_CHANGES_PATCH_BYTES in its environment, and take files, patch, and truncated from its JSON stdout. A failing, slow (over 10 s), undecodable, or over-limit command fails the request with internal (too_many_changes for a file list over the limit), and on Unix the engine kills the whole process group of a command that runs over the limit or leaves a grandchild that holds stdout. The engine stops at a nested git repository, which the git engine answers, and the uncommitted scope of a jj work tree with two parents diffs against the merge of the parents without rename detection (more than two fail that scope only). The git commands of the engine run in a private git directory that reads only the objects of the store, so no merge driver, filter, or attribute of the repository, the user, or the system applies (only the ignore rules of the repository and of the global git config do), and the tree of a commit that jj records as conflicted, also as a parent of a merge, holds the materialized content and mode of each conflicted file. The engine never snapshots, writes an operation, or writes a file of the work tree; jj may still write its own caches, move an old config file, or make its per-repository config files while it loads the repository.

  • Embedded skill updates (Options.Skills) — a running session calls SkillSource.List before each model call. A changed list reaches the model as one pinned segment after the history, so the system prompt, the tools, and the cached prefix stay as they are. load_skill and session_info follow the newest list.

  • Session ID in a plugin tool (plugin) — plugin.SessionID(ctx) returns the ID of the session that called a plugin tool. Tool.Execute gets the session on its context for a process plugin and for an in-process plugin.

  • session_info with no WorkDir (harness) — every session offers session_info, on every backend, with or without a WorkDir, so a host with no file system (for example one that uses Options.Skills) can call it. An AllowedTools list that leaves it out hides it. New now fails for an embedder tool or a plugin tool named session_info also with no WorkDir.

  • Embedded skills (harness, internal/prompt, internal/selftool, internal/backend/claudecode) — Options.Skills takes a SkillSource, so an embedder supplies the skills of each session, for example from a database. The runtime calls List once when a session is created or opened and adds the skills to the skill list, also with no WorkDir. An embedded skill replaces a skill of skills_dirs with the same name. The new runtime tool load_skill {name, file} reads one file of a listed skill with Read, and session_info reports the skill by name with no path. New fails when Options.Tools also has a load_skill tool. The skill list header, when the list holds an embedded skill, and the Claude Code tool-name segment, when the turn offers load_skill, say that a skill is loaded with load_skill when its line says so.

  • Step limit of an existing session (harness, protocol, internal/session) — Runtime.Open with WithMaxSteps(n) sets or clears the max_steps of a session that exists, with one settings.changed that carries max_steps. It applies from the next turn. Create rejects the option, and PATCH /sessions/{id} cannot set it.

  • Per-session limit of model requests (protocol, internal/turn, internal/backend/claudecode) — max_steps in POST /sessions (CreateSession.MaxSteps) caps the model requests of each turn. A turn that made that many requests and would make another ends at once with the new stop reason step_limit, keeps its messages, and ACP answers max_turn_requests. The Claude Code backend passes --max-turns and maps the error_max_turns result to step_limit. Zero or absent is no cap.

  • MCP Skills extension client (internal/mcp, internal/tool/mcpsrc, internal/skill) — harness declares io.modelcontextprotocol/skills, reads skills/list of each server that serves skills, and lists its skills in <mcp_skills> of the MCP segment (in the harness server instructions on the Claude Code backend). load_mcp_skill {server, uri} loads a skill, listed or not, and checks the size, SHA-256 digest, and frontmatter of SKILL.md against its entry. read_mcp_resource checks each file of a loaded skill against the held entry, lists its directories, and refuses a read of its files on another server. Skill content is tagged with its server as untrusted content; allowed-tools of an MCP-served skill is never honored.

  • GPT-6.1 Terra on the ChatGPT backend (internal/modelmeta) — the static codex catalog lists gpt-6.1-terra, with its models.dev name, efforts, and context window. A codex/gpt-6.1-terra session runs on the known window instead of the default one.

  • WebAssembly module in a Cloudflare Worker (sdk/embed, cmd/harness-wasm) — wasm({module, wasmExec, worker: false}) runs the module in the current JavaScript isolate on an in-memory file system, for a host that cannot start a Worker. module may be a compiled WebAssembly.Module, and wasmExec may be a function that loads wasm_exec.js. The store stays in memory: store.persist and store.dir reject. @majorcontext/harness-embed/memoryfs exports installMemoryFs() for a host that loads the module itself. A host that installs no file system now gets invalid_request with a reason that says so and names installMemoryFs, not cwd is not a directory. A new CI job runs one ACP turn under workerd.

  • Session headers on injected ChatGPT entries (internal/provider/openai, internal/backend) — an entry with auth: "injected" and models_from: "chatgpt" sends the hash of the session id as session_id and x-client-request-id, so a request that no response chain covers reads the prompt cache of the ChatGPT backend. The raw session id never leaves the process.

  • Message ids on the Claude Code chat span (internal/backend/claudecode, internal/turn) — the chat span of a Claude Code turn has one gen_ai.response event for each distinct model call of the turn. The event carries the Anthropic message id as gen_ai.response.id. The turn_metrics line does not change.

  • Trace links for turns that harness starts (internal/session, internal/tracing, harness) — a parent turn that starts from the report of a child links to the invoke_agent span of the child turn, and a goal continuation turn links to the invoke_agent span of the turn that the judge evaluated. The link is in the traceparent and tracestate of the input.admitted record.

  • Trace context from request headers (internal/server, internal/tracing, internal/session, protocol) — POST /sessions/{id}/inputs takes the traceparent and tracestate request headers as the trace context of the input when the body has no traceparent. POST /sessions/{id}/compact takes them as the trace context of the compaction: the /compact turn of a backend that owns its context links to it, and so does the summary call of a compaction that the runtime runs. A header that is not valid is ignored.

  • Compact only the expected turn (protocol, harness, internal/session) — protocol.Compact gains expected_turn_id. When it is set and the newest ended turn has another ID, Compact fails with turn_mismatch and appends nothing, so a client that saw an idle session does not compact one whose cache a new turn refreshed.

  • OpenTelemetry traces (harness, protocol, cmd/harness, internal/tracing, internal/turn, internal/session, internal/mcp) — each turn makes an invoke_agent span with a chat span for each model call and an execute_tool span for each tool call, in the generative AI semantic conventions. Options.TracerProvider takes a provider; serve, run, and acp export over OTLP/HTTP when OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is set. Every HTTP model request carries traceparent, and an MCP call carries it in params._meta. An input takes traceparent and tracestate, and its turn links to them. A turn_metrics line gains turn_id, call_seq, and call_id. OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true or Options.CaptureMessageContent adds message content. No span exists without a provider, and harness emits no metric.

  • Cache expiry and compaction point on the session view (protocol, internal/session, internal/eventlog, internal/backend) — context.compact_at is the token count at which the session compacts before the next turn. cache_expires_at is when the prompt cache expires: the newest model call reading plus its cache lifetime. It is absent when the lifetime is unknown and after a compaction. The Anthropic client states its cache_ttl, the ChatGPT Codex backend states 30 minutes, and the Claude Code backend sets ENABLE_PROMPT_CACHING_1H=1 and reads the lifetime from the usage of each call. context.measured gains cache_ttl_seconds.

  • Goal judge account exhaustion (protocol, internal/session) — a goal evaluation that reaches a provider usage limit adds cause, model (the resolved evaluator model ref), and optional resets_at to goal.changed. A host can move the session to another account before the next judge retry.

  • Goal evaluator transcript limit (internal/modelmeta, internal/backend/claudecode, internal/session) — Claude Code aliases use the latest matching Anthropic context window. The evaluator transcript budget does not exceed 391,808 bytes. Session views use the latest window reported by Claude Code when available.

  • Input admission check (harness) — harness.CheckInput(model, input) runs the checks that Session.Prompt runs on an input (provenance, parts, attachment type, decode, and size, and image input for model) without a session, and stores nothing. It returns the same invalid_request error as Prompt, so an embedder can refuse a bad attachment when it queues the input. It checks a typed slash command as plain text.

  • Tool allowlist replacement on open (harness, protocol, internal/session, internal/eventlog) — harness.WithAllowedTools(names) lets an embedder replace a stored session's tool allowlist before Runtime.Open resumes it. The runtime records one settings.changed when the sets differ. Nil allows all tools; an empty list allows none. Replay, session views, children, and model validation use the replacement. The HTTP settings surface cannot change the allowlist.

  • Deferred model changes in Claude Code (internal/selftool, internal/session, harness) — the model tool now allows status and set on a backend that owns its loop. set validates a ref or alias at once and returns effect: next_turn; status includes any pending_model. The pending model applies through the session settings path when the turn completes, fails, or is canceled, without changing the running turn or its backend process. A later set replaces the pending model, and a set to the current model clears it. Pending changes are live turn state and do not survive a handoff or process exit. Model API sessions keep immediate changes. The tool leaves effort unchanged.

  • Per-session subscription accounts (config, protocol, internal/tree, internal/session) — sessions store vendor-to-account IDs in settings, children inherit them, and the task tool accepts account overrides on spawn and send. Configured account routing appends the opaque ID to the proxy username; unavailable routing fails the model call.

  • Derived title as a record (protocol, internal/eventlog, internal/session) — a root session with no model title now records its derived title as session.titled with source derived: without title_model, after the first prompt; with title_model, when the title call fails and no person has titled the session. A derived record changes no state, so a reader of the log finds a title in every titled root session.

  • Model-written session title (config, protocol, internal/eventlog, internal/session, harness) — with title_model (a model ref or an alias), a root session sends its first prompt, cut to 2048 bytes, to that model after the first input is admitted, and the answer becomes the title in place of the first line of the prompt. The call runs beside the turn, once for each session, with effort off, a 32-token cap, and a 15 s timeout; a failure keeps the derived title, and its usage counts in the session usage. session.titled has a source, user, model, or derived: a title from a person always wins, and a title from a model never replaces it. Without title_model, nothing changes.

  • Session title (protocol, internal/eventlog, internal/session, internal/acp, cmd/harness) — a session has a title: the newest rename, else the first line of the first prompt cut to 8 words and 100 bytes (a prompt that starts with / or has no text gives none). PATCH /sessions/{id} and Session.Update take title and append the new durable kind session.titled; an empty title, a title with a control character, or a title over 200 bytes fails with invalid_request. The session view and GET /sessions carry title, harness sessions has a title column and title in --json, ACP session/list answers it instead of null, and ACP sends a session_info_update with title when it changes. The new control command /rename <title> renames a session, so an ACP client renames by prompting.

  • Session ID header for MCP servers (config, internal/mcp, internal/tool/mcpsrc, internal/turn, internal/backend/claudecode) — an HTTP MCP server entry can set include_session_id_header: true to receive Harness-Session-Id on tool-call requests. The value is the calling harness session ID. Native backends add it to the outgoing HTTP request; Claude Code receives it in the per-run MCP config for the corresponding bridged server. The field defaults to false and does not apply to stdio servers.

  • Live plugin set (harness, internal/tool/pluginsrc, internal/plugin, internal/turn, internal/provider, internal/server, protocol) — Runtime.SetPlugins and PUT /plugins ({"plugins": [<entry of the config key plugins>]}) replace the whole set of config plugins. A bad manifest or name fails with invalid_request and changes nothing. A plugin with the same entry keeps its process, a changed plugin gets a new process, and a removed plugin stops. Hooks and events go to the live set from the next dispatch. The system.transform segments now go in an engine-context block at the end of each request, after the cache breakpoint, and no more in the system prompt, so a change of the set never changes the cached prefix. A tool that a call adds is deferred, named in the mcp-set notice, and loaded with mcp(action="select"). A session with a config plugin now has the mcp tool. plugin_cache keeps only the newest entry of each plugin name.

  • Time limit for MCP and plugin tool calls (config, internal/tool/mcpsrc, internal/tool/pluginsrc, internal/toolresult) — each MCP tool call and each plugin tool call now ends after tool_timeout_s seconds (default 120), a new field of an mcp_servers entry, including a session server, and of a plugins entry. A value below 1 fails the config load. A call that passes the limit has its context canceled and returns the error result <tool name> timed out after <N> s; the turn goes on. Before, a plugin tool call had no limit, and an MCP call ended after the 30 s request bound of the client, with the text call failed: timed out. The request bound of an MCP client is now the longer of 30 s and the limit plus 1 s.

  • Live MCP server set (harness, internal/tool/mcpsrc, internal/server, protocol) — Runtime.SetMCPServers and PUT /mcp/servers ({"mcp_servers": {<name>: <entry of the config key mcp_servers>}}) replace the whole set of runtime MCP servers. A new server connects at once in the background, a server that the body leaves out closes (a call in flight to it ends with an error), a server with a changed spec connects again, and a server with the same spec stays as it is. The answer is {"servers": [...]}, the same entries as the status action of the mcp tool. A body with no mcp_servers, a spec that breaks a rule of mcp_servers, and a name of a session server are invalid_request. The set is not saved: a new process starts from mcp_servers. A request prefix of a session does not change: a tool that arrives after the first connect (a late or retried server, an added server, a changed server, or a notifications/tools/list_changed notification) is deferred, whatever tool_loading says, and a pinned mcp-set notice names it with the instructions of its server and says which servers went. A tool that a session already sent stays in its definitions, and a call to it reads no such tool available. The mcp tool now always has the actions search and select, and harnesstest.MCPServer gains SetTools, NotifyToolsChanged, and Initializes.

  • Refresh MCP tools on a name miss (internal/tool/mcpsrc, internal/turn) — when mcp(action="select") or a tool call names a tool that a connected MCP server does not list, the runtime reads that server's tool list and waits for the read before deciding. A newly listed tool is deferred. Servers that are not connected are not refreshed.

  • WebMCP tools of a page as page tools (sdk/embed) — @majorcontext/harness-embed/webmcp has webmcpTools({prefix, fromOrigins, log}), which reads document.modelContext.getTools() and returns the tools as page tools for createHarness. A tool is named webmcp__ and its WebMCP name; a tool with an invalid name or schema is left out and logged. A call runs executeTool with the input object and the call signal, and a rejection is an error result with the name and message of the exception. readOnlyHint and consequentialHint add a line to the description, and the result of a tool with untrustedContentHint is spotlighted. Without document.modelContext, or when getTools rejects, it returns an empty list and never rejects.

  • Claude Code asks through ask_user_question (internal/backend/claudecode, internal/turn, internal/session, harness) — a Claude Code session asks a question with the harness tool ask_user_question over the harness MCP endpoint, as every other backend does, and the CLI no longer gets AskUserQuestion: --tools lists ToolSearch (and WebSearch when the search is on), and the --permission-prompt-tool, defer-hook, and plan-mode flags are gone. The call shows in the log and in the event stream under the name ask_user_question, so the tool.execute.before and tool.execute.after hooks of plugins see it, and AllowedTools names it. The request, the waiting status, the answer route, and the ACP form do not change. The backend interrupts the CLI once the request opens, and the answer starts a turn whose prompt is the text of the recorded result (User has answered your questions: ...). A session that lists AskUserQuestion in AllowedTools now fails Create.

  • Examples on a subscription login (examples) — prompt, custom-tool, switch-model, and guardrail set Config.SubscriptionDefault: they use ANTHROPIC_API_KEY when it is set, else the login of harness login codex, else claude on PATH.

  • Reference server for the embedded module (examples/embed-server) — a Go server in its own module (it imports github.com/majorcontext/gatekeeper/proxy; the harness module takes no new dependency). It serves the WebAssembly module, wasm_exec.js, sdk/embed, and a terminal-style page that chats with codex with auth: "injected": it keeps the conversation in OPFS and replays it with session/load after a reload, and shows the elapsed time and an estimate of the tokens of each turn. -token-file keeps the ChatGPT logins and -session-file the app sessions across restarts, for development. It signs the user in to ChatGPT on the server with the device code flow at /settings/codex, keeps the tokens per user, and adds them to the model requests through a gatekeeper relay behind a session check. The session is a stand-in for the session of your application.

  • Injected auth (config, internal/injectedauth, internal/backend, internal/acp, internal/acp/acpauth, internal/provider) — a providers entry of type openai, and the native anthropic entry, can set auth: "injected": a server in front of the endpoint holds the credential and adds it, and the adapter sends no Authorization, x-api-key, ChatGPT-Account-ID, or originator. extra_headers still apply, so an entry can carry the placeholders that a substituting proxy replaces. A 401 fails the turn with the error class login_required; a 403 does not. ACP session/new, session/load, and session/resume send a GET status probe to the wire's model-list endpoint, even without models_from; a cross-origin probe can add a CORS preflight. A 401 probe rejects the session request with login_required. A 401 within 2 minutes after a status probe that answered 200 ends the turn permanent. The Responses adapter hashes the session ID for prompt_cache_key rather than sending the raw ID. The new keys login_url and models_from are user-only. models_from: "chatgpt" now decides the live model list fetch, in place of auth: "chatgpt"; the native codex entry sets it, and an entry with auth: "chatgpt" and no models_from lists the static models. harness acp offers the method injected-<provider> only when the entry sets login_url and the client advertises elicitation.url: it shows the URL and polls the status probe until the server accepts the sign-in. A permanent error from a transport no longer starts with the request line Post "<url>": that the HTTP client adds, for every provider.

  • Action for a codex entry that replaces the native one (config) — if your codex entry in providers has auth: "chatgpt", add models_from: "chatgpt" to keep the live model list. The fetch now follows models_from alone; without it the entry lists the static models.

  • Default model from the subscription (config, cmd/harness) — harness login codex and harness login claude-code save model (codex/gpt-6.1-sol or claude-code/sonnet) in the user config when it sets none, keep every other key, never replace a model that is set, and print one line. A run or acp config that sets no model (and no flag or HARNESS_MODEL does), and whose anthropic entry has no non-empty selected key, configured auth, or non-empty credential header, resolves its default to codex/gpt-6.1-sol when codex_auth_file exists and is not empty, else to claude-code/sonnet when claude is on PATH, else to anthropic/claude-fable-5. The check is one stat and one PATH lookup, with no process and no network call. Only run and acp do this (Config.SubscriptionDefault, set by cmd/harness); serve and the Go API keep the built-in default, because a server must not change its default with what is on PATH. A Claude Code turn that fails while the CLI is logged out now has the error class login_required and names harness login claude-code, on every host. config.SetModel is the writer. The Try: line of login codex names the same model.

  • Skills for Claude Code sessions (internal/backend/claudecode, internal/prompt, internal/turn, harness) — a Claude Code session lists the skills of skills_dirs (default .agents/skills), with the same text and the same skills as a model API session, and the model opens a skill with read_file. The skill segment goes in the system prompt value after the append_system_prompt entries, behind a new segment that tells the CLI that its tools are the Harness tools and which Harness tool replaces each tool name that instructions use (Read is read_file, Task is task, BashOutput is process). The CLI Skill tool stays off. The value still holds neither the base prompt nor the AGENTS.md chain, because the CLI has its own and reads AGENTS.md and CLAUDE.md itself. The value goes to the CLI in a temporary file (--append-system-prompt-file), because Linux caps one argument at 128 KiB, and extra_args of a claude-code-cli entry now fails the config load when it holds --append-system-prompt or --append-system-prompt-file. Before, a Claude Code session loaded no skill since the CLI ran with --tools "".

  • Parallel reads in Claude Code (protocol, internal/backend/external, internal/tool) — protocol.ToolSpec has the new field read_only. The harness-hosted MCP endpoint lists a tool with readOnlyHint true when it is set, so the Claude Code CLI runs parallel calls of read_file, glob, grep, ls, read_tool_result, session_info, and get_conversation_history at once instead of one after another (three parallel calls of a 3 s tool took 9.2 s without the hint and 3.2 s with it). A tool of an MCP server passes its own readOnlyHint through. A write tool, a plugin tool, and every other tool stay without the hint.

  • Injected auth in the WebAssembly build (cmd/harness-wasm, internal/acp/acpauth, internal/jshost, internal/backend, internal/codexauth, sdk/embed) — the in-browser ChatGPT login (the device code flow, the login file in the store, and the page-origin check) was removed in favor of auth: "injected": the wasm module holds no model credential and offers no chatgpt method, and an entry with auth: "chatgpt" is not listed and fails a request before it is sent with the error class login_required. proxy.providers of createHarness replaces proxy.providerBaseURLs: it maps a provider name to {baseURL, loginURL}, which set base_url and login_url of the entry, and the native codex entry also gets auth: "injected". A server on the page origin holds the credential and answers 401 for a user who is not signed in, and the client of the page signs the user in through the ACP method injected-<provider>. harnessConnect takes no pageOrigin, and harness.Options has no IssuerTransport. HostLimits.NoLogin now means that the host has no file login. Every model request of the module follows no redirect (redirect: "manual"). The native harness login codex is unchanged.

  • web_fetch tool (config, internal/tool/webfetch, harness, internal/acp) — the config key web is an object {"fetch": bool} (search joins it, see Web search), and web.fetch true gives each session with a WorkDir the built-in tool web_fetch, on every backend. Claude Code gets it through the harness-hosted MCP endpoint, so each fetch runs through the tool.execute.before and tool.execute.after hooks, which can deny it by URL, and through retention; AllowedTools names it. The input is {url, format, max_bytes}: one GET of an http or https URL with no body, no cookie, no credential, no proxy variable, and the User-Agent harness/<version> (web_fetch). A custom dial resolves the host and refuses loopback, private, link-local, CGNAT, unique-local, multicast, and unspecified addresses, also as IPv4-mapped forms, and dials the address it checked, so DNS rebinding cannot bypass it. A call follows at most 5 redirects, each checked the same way, ends after 30 s, and reads at most 10 MiB. HTML becomes markdown (default), plain text, or the raw source; text and JSON pass through; a PNG, JPEG, GIF, or WebP image returns as an image; any other type returns its type and size. The result starts with the final URL and the status. web_fetch is off by default and the WebAssembly module offers no such tool: the host sets HostLimits.NoNetwork, a config that turns web.fetch on stays valid, and the build links neither the tool nor its HTML parser. ACP shows its tool kind as fetch. Options.WebTest is a test seam and not a config key.

  • Web search (config, internal/message, internal/provider, internal/backend, protocol, internal/acp) — web.search (default false) offers the native web search of the provider: the server tool web_search_20260209 on Anthropic Messages, the built-in web_search tool on OpenAI Responses and the Codex lane, and WebSearch in --tools for Claude Code. An openai-compat model sends nothing. The search runs inside the model call, so no hook can run on it. The tool name web_search in AllowedTools turns it off for a session that leaves it out. The log records a search as the new part web_search (call_id, query, results, and the opaque provider_data that the same provider needs to receive it again), and a text part may hold citations. A search goes back to the same provider as its own blocks or item, and to any other provider as text. protocol.Usage gains web_search_requests for Anthropic, which bills each search. ACP shows a search as a fetch tool call with a link for each source.

  • Native codex and claude-code providers (config, internal/backend, internal/acp/acpauth, cmd/harness) — codex and claude-code need no providers entry, as anthropic and openai do. After harness login codex, harness run -model codex/gpt-5.6-sol works with an empty config, and with claude logged in, -model claude-code/sonnet does. A providers entry of the same name replaces the native one as a whole. Runtime.Models and the model tool list both. harness login codex prints a Try: harness run -model codex/<id> line. ACP initialize always offers "Log in with ChatGPT", and offers "Log in with Claude Code" when claude (or the binary_path of an entry) resolves on PATH, so agentCapabilities.auth is now always present on harness acp.

  • Questions from a model API session (internal/turn, internal/session, harness) — with Options.AskUserQuestion, a session of a model API backend (ChatGPT, Anthropic, OpenAI, and OpenAI-compatible) can ask the user a question with the runtime tool ask_user_question, as Claude Code does with AskUserQuestion. The input is the input of AskUserQuestion, and the request has the kind question with that input as its payload. The tool is offered to a root session with no active goal, and AllowedTools applies to it by name. A call ends the turn awaiting_input and the session reads waiting. An answer starts a turn whose first step records the answers as the result of the call, and a dismissal gives the usual error result. The tool.execute.before and tool.execute.after hooks run on the call. The input matches AskUserQuestion: an option may carry a preview, question texts and option labels must be unique, and metadata, answers, and annotations are accepted and ignored. In an ACP form each question with options also has an optional question_N_other text property, whose text is the answer; this holds for Claude Code too, and the option properties are no longer required. A preview shows in the description of its option. The ACP elicitation and the flag harness serve -ask-user-question cover every backend.

  • Claude Code runs on Harness tools (internal/backend/claudecode, harness, internal/acp) — a Claude Code session gets no built-in tool of the CLI that acts on the machine or the network. --tools lists AskUserQuestion alone, on a run that may ask a question, and --strict-mcp-config always applies. With a WorkDir, the session gets read_file, write_file, edit_file, glob, grep, ls, bash, and session_info through the harness-hosted MCP endpoint, beside task, process, model, and get_conversation_history. Each call runs through Request.Call, so tool.execute.before and tool.execute.after hooks see it, and AllowedTools names these tools. A result over the retention threshold reaches the CLI as a preview with a handle, and read_tool_result reads the rest. The log records the calls under the harness names, and ACP shows their tool kinds. An embedder tool with the name of a built-in tool of the WorkDir now follows the same rule for Claude Code as for the other backends: Create and Open fail with invalid_request when AllowedTools is nil, so a persisted Claude Code session with such a tool fails Open until it lists its allowed tools. The turn fails when the CLI lists or calls a built-in tool other than an allowed AskUserQuestion. The adapter no longer passes --forward-subagent-text, because the CLI has no subagent tool. A profile tools list reads the Claude Code names Read, Write, Edit, MultiEdit, Glob, Grep, LS, and Bash as the matching harness tools. Calls of one key through the tool bridge run one at a time. An image that a bridge read_file returns is stored with the tool result in the log. The built-in agent profiles and the ACP kind table no longer name the tools Read, Glob, Grep, Edit, Bash, WebFetch, and TodoWrite of the CLI.

  • ACP elicitation for questions (internal/acp, internal/acp/rpc, internal/acp/cwdruntimes) — a client with the capability elicitation.form gets elicitation/create for a question of a Claude Code session. harness acp sets Options.AskUserQuestion for such a client only, so the session can ask. When the turn ends awaiting_input, the agent answers the prompt with end_turn and then sends a form with one property for each question. accept resolves the request with the answers, and starts the next turn; decline and cancel dismiss it. An input that dismisses the request, session/close, and the end of the input send $/cancel_request for the elicitation. A client without the capability sees no change.

  • Model list of a provider entry (config, internal/backend, internal/modelmeta) — a providers entry can set models, a list of model ids as its API names them. Runtime.Models, GET /models, and the ACP model option then list exactly those ids, in order, for that provider: the way to list the models of an openai-compat gateway or a local model. A listed id that models.dev knows, also with a routing namespace such as anthropic/claude-sonnet-5-5, has its name, description, and effort levels. Any other id has no name and offers every effort level up to high. On an entry with auth chatgpt, models replaces the fetched list. A project file can set models on any provider. An empty id or a duplicate id fails the config load.

  • ACP session/list in the wasm Worker (sdk/embed) — the Worker of the wasm transport passes the work directory of its file system to harnessConnect as defaultDir, so the module advertises sessionCapabilities.list and answers session/list with no cwd over a memory store, the OPFS store, and a Node store directory. Before, session/list there answered -32601.

  • Images and files in ACP prompts (internal/acp, internal/modelmeta) — harness acp advertises promptCapabilities image and embeddedContext, so a client such as Zed can attach an image, a selection, or a file. An image block or a resource block with blob is an attachment (png, jpeg, gif, webp, and pdf for a resource), checked by the runtime. A resource block with text is a text part wrapped in <resource uri="…"> and </resource>. audio, an attachment of another type, and bad base64 are -32602. Input admission refuses an image for a model that the models.dev facts list without image input with invalid_request that names the model (-32602 in ACP, with data.code kept); an unknown model passes. An image block takes only png, jpeg, gif, and webp.

  • Plain compaction summary (protocol, internal/eventlog, internal/backend/claudecode) — the summary of a compaction.applied record is the plain summary text. The new index field holds the index of the retained tool results, and the compaction banner exists only in the text that the model reads, so the model request does not change. The Claude Code adapter drops the continuation framing of the CLI from the summary. ACP clients and the HTTP readers show the plain summary. A log written before this change shows the banner twice in the model text.

  • Host tool with a built-in name (harness, sdk/embed) — an Options.Tools tool or page tool named bash, read_file, write_file, edit_file, glob, grep, or ls no longer fails New, and so no longer fails session/new with internal. In a session whose AllowedTools is a list, the host tool replaces the built-in tool, and the model sees one tool of that name with the schema of the host. In a session whose AllowedTools is nil, the built-in tool is allowed, and Create and Open fail with invalid_request that names the tool. A plugin tool, an MCP tool, and the tools read_tool_result, session_info, process, task, and model keep their rules.

  • Compaction cancel outcome (protocol, internal/session, internal/acp) — a compaction that an interrupt (Interrupt, Cancel) or CancelForEnd stops ends with the status frame compaction_canceled, not compaction_failed. A release, End(), a shutdown, and a lost owner stay compaction_failed. ACP shows it as a compaction_update with the status cancelled.

  • Effort levels xhigh and max (internal/modelref, internal/modelmeta, internal/backend, internal/provider) — an effort can now be xhigh or max, above high, in /thinking, PATCH /sessions/{id}, the task tool, and the ACP effort option. A model offers the levels that models.dev lists for it, and the live Codex model list keeps xhigh and max. A request sends the level that the model lists: an unlisted level becomes the highest listed level below it. An Anthropic model with an effort control gets output_config.effort (with adaptive thinking when it takes no thinking budget), the Responses wire gets reasoning.effort, and the Claude Code backend gets --effort. A model with only a thinking budget, a model with no facts, and every openai-compat model take at most high. The 4.6 models and Opus 4.5, which have both controls, now send output_config.effort along with their budget. Adaptive thinking raises max_tokens to a floor for the level (10000 to 40000 tokens), and a Bedrock-routed Claude id reads the facts of the model it names. /thinking names a level that it clamps, for example "max is not offered by anthropic/claude-haiku-4-5; using high".

  • Shell tool and file system handle for the browser host (sdk/embed) — createHarness returns h.fs with the wasm transport in a browser: async readFile, writeFile, readdir, stat, mkdir, rm, and rename on the file system of the module (/work, /tmp), through the message channel to the Worker. A page tool also gets it as run(input, {signal, fs}). Under Node and with subprocess, h.fs is undefined. The new export @majorcontext/harness-embed/shell has shellTool(), a page tool {command} that runs a just-bash shell over h.fs, mounted at /work and /tmp, with no network, a time limit, a command limit, and clipped output. just-bash is an optional peer dependency (Apache-2.0), loaded at the first call; a page that does not import the export loads nothing extra.

  • Live Codex model list (internal/backend, internal/provider/openai) — a provider with auth chatgpt lists the models that the ChatGPT backend serves, in place of the static codex list. The first call of Runtime.Models (the first session/new, session/load, or session/resume, or GET /models) fetches GET <base_url>/models with the headers of the login, waits at most 3 s, and keeps the result for the life of the process. A model that the backend does not show in its picker is not listed. A failed fetch, a timeout, or an empty list gives the static list and one log line, and the next call after 5 minutes tries again; a missing login, a 401, and a 403 give the static list with no log line until the stored login changes. Runtime.Models now takes a context.Context. initialize never fetches.

  • ACP compaction updates (internal/acp, protocol) — a client with the capability session.compaction gets a compaction as the entity compaction_update (in_progress, then completed, failed, or cancelled) and compaction_summary_chunk, live and in the replay of session/load, where the summary is a completed entity at its place in the conversation. A client without the capability gets no compaction message, and the replay no longer sends the summary as a user_message_chunk. protocol.Message.IsCompactionSummary tells a summary message from a user message.

  • Log in from ACP (internal/acp, internal/acp/acpauth, cmd/harness) — harness acp advertises authMethods when the user config uses a login: "Log in with ChatGPT" for a provider with auth chatgpt, and "Log in with Claude Code" for a claude-code-cli provider. authenticate runs the browser sign-in of harness login codex, or claude auth login as a child; $/cancel_request stops it. A client with the auth.terminal capability also gets terminal methods that run harness acp login codex or login claude-code. agentCapabilities.auth.logout is {} when the ChatGPT method is offered, and logout removes the ChatGPT login only. A new authenticate cancels the one in flight, and a sign-in ends after 10 minutes. A session/new or a session/prompt that needs a missing login answers the ACP error -32000 with data.code login_required. A turn that fails with the new error class login_required (a rejected ChatGPT refresh token) answers the same. The WebAssembly build offers no login.

  • Claude Code login commands (cmd/harness) — harness login claude-code [--console] [--sso] runs claude auth login, --status runs claude auth status --text, and harness logout claude-code runs claude auth logout, with the claude program of the claude-code-cli entry. Harness never reads Claude Code credentials.

Changed

  • Native API providers require credentials (config, internal/backend) — Anthropic and OpenAI are absent from the available registry without a non-empty selected key, configured auth, or a non-empty Authorization or x-api-key header. A base URL, WithProxyBase, or generic model transport alone is not a credential. Embedders whose transport supplies native auth must set auth: "injected". Create, default model use, and ACP session/new fail with model_unavailable before a turn starts; the error names the missing key variable. Model lists, settings, title calls, and goal evaluation use the same registry. An unavailable title provider logs model_unavailable and keeps the derived title without failing the caller's request. Harness infers no credential and substitutes no model. Codex and Claude Code discovery remains unchanged; their login checks stay at first use. New performs no file I/O. Explicit keyless project providers keep their behavior.

  • MCP tool loading defaults to auto with a byte budget (config, internal/tool/mcpsrc) — an unset mcp_tool_loading is now auto: the tools of the servers stay in the tools array when their schemas fit mcp_schema_bytes (default 65536), and every tool is deferred otherwise. mcp_tool_loading_threshold is removed. With eager, the tools past the budget are deferred and the system prompt says so. The tool list in the system prompt stops at 16384 bytes, and an mcp select result holds at most 65536 bytes of definitions and names the tools it left out.

  • More fields on turn_metrics (internal/turn, internal/backend/modelapi, internal/provider) — each model call line adds response_id, stop_reason, incomplete_reason, provider_input_tokens, provider_output_tokens, provider_cached_tokens, request_bytes, instructions_bytes, tools_bytes, history_bytes, max_output_tokens, and error_class. A Codex WebSocket call that refuses a chain because of tools adds chain_refusal_tool and chain_refusal_tool_part. An incomplete OpenAI response with no usage fails with a message that states the request size.

  • Cache-reusing compaction summary (internal/turn, internal/session) — the summary request of a compaction now sends the instructions, tools, settings, and whole history of the next model call, then one user message that asks for the summary, so a provider reads the cached prefix of the turns instead of the folded history at full price. The compaction still folds only the turns before the kept ones, and the summary now also covers the kept turns.

  • Instructions change offset in chain refusals (openai, internal/turn, internal/backend/modelapi) — a turn_metrics line of a call that did not chain because the instructions changed now has chain_refusal_offset, the byte offset of the first byte that differs, with chain_refusal_previous_len and chain_refusal_current_len, so an operator can tell a change in the base prompt from a change in a later section. The line never holds the instructions text.

  • Deferred MCP tools (internal/tool/mcpsrc, internal/turn, internal/tool/pluginsrc) — mcp(action="select") now returns the description and input schema of each named deferred tool, and the new mcp(action="call", tool, arguments) runs it, so a deferred tool never joins the tools array and a select no longer breaks the prompt cache of the session.

  • Cache routing headers on the ChatGPT login (openai, backend) — a request that the ChatGPT login authenticates, over HTTP and over the websocket handshake, sends the session key as the session_id and x-client-request-id headers, so the backend routes the prompt cache of a session to the same place. A request with no session key sends neither.

  • Process status as a pinned notice (internal/tool/proc, internal/selftool, internal/prompt) — the process status line moves from the system prompt to a notice that the model reads as a pin, so a process start or end no longer changes the system prompt or breaks the provider prompt cache from the first message.

  • Compaction inside a running turn (internal/session, internal/turn, internal/eventlog) — a turn on a backend without OwnsContext now checks the compaction threshold before each model call after the first, and when no earlier turn can fold, the running turn folds its older round trips (an assistant message and its tool results) instead of failing on an overflow. The model keeps the user messages of the folded part after the summary. A summary request that overflows the context window drops its oldest message after the first, with the tool results that answer it, and runs again.

  • A box replies to a question, and an answer names who gave it (protocol, internal/session, internal/turn, internal/eventlog, harness) — an input of source box (protocol.SourceBox, the reply of the agent of another box) now dismisses an open request as the input of a person does, and starts a turn; before, it waited in the queue until a person answered. The dismissal names the source_label of that input, also when the input waited in the queue before the question opened, and ACP sends the same text in the tool_call_update of the dismissed question. POST /sessions/{id}/requests/{request} and Session.Resolve take source, source_id, and source_label in protocol.Resolution, checked as for an input, and request.resolved keeps them. With a source_label, the result that the model reads names it: <label> has answered your questions: ... and <label> dismissed this question without answering. A resolution of a question may hold a response, free text in place of the answers, as in Claude Code: the model reads The user responded: <text> (or <label> responded: <text>) once, in the result of the question, and the conversation of a reader shows the response as a user message with the provenance of the resolution. GET /health lists the new capability resolution_source; an older harness refuses these fields with invalid_request.

  • ask_user_question says to ask with the tool (internal/turn) — the description of the tool no longer says not to use it to ask whether to proceed. It now says to ask with the tool, not in the reply text, when the model needs the answer of the user before it can go on, because a question in the text does not show the user that the session waits.

  • Claude Code parent reads a child report in the same turn (internal/session) — a child report is now a steer input on every backend. A Claude Code parent with a tool call in flight reads the report at the next tool result, in the turn that runs, as the CLI does for its own finished background task. Before, the report waited in the queue until the turn ended. A report that arrives when no tool call is in flight still waits, and the next turn takes every waiting report with its first input.

  • Claude Code loads the file and shell tools upfront (internal/backend/claudecode) — the harness-hosted MCP endpoint lists bash, read_file, edit_file, write_file, grep, glob, and ls with _meta {"anthropic/alwaysLoad": true}, as it does ask_user_question, so Claude Code does not defer them behind ToolSearch. Before, with tool search on, a turn first spent a ToolSearch request to load them. With the config of a box, the measured turns made no ToolSearch call, and the two read-only prompts sent about 31% fewer input tokens; the context of the run grows by about 0.9k tokens for the loaded schemas. When tool search is on, every other tool stays deferred.

  • Go 1.27.4 is the minimum (go.mod, examples/embed-server/go.mod, Dockerfile, .devcontainer/Dockerfile) — Go 1.27.3 makes crypto/x509 reject chains through eight compromised eMudhra intermediates (CVE-2026-111943), and Go 1.27.4 fixes net/http GO-2026-6859. The images build with golang:1.27.4-bookworm pinned by digest. golang.org/x/image moves to v0.45.0 for GO-2026-6222 (VP8L decode memory).

  • Embed server compresses the module (examples/embed-server) — GET /harness.wasm now sends brotli or gzip when the browser accepts it, with an ETag and Cache-Control: no-cache, in place of the raw module. The server reads the module once at startup, so a rebuilt module needs a restart.

  • One-shot model calls on a Claude Code model (harness, internal/turn, internal/backend/claudecode, docs/architecture.md) — the plugin call client/generate and any other one-shot model call now accept a model of a backend that owns its loop, so a call can bill a Claude subscription. The CLI runs with only ToolSearch, no MCP server, no web search, no resumed session, and --no-session-persistence, so the call has no tool and leaves no session. The CLI gets the instructions of the call as its whole system prompt (--system-prompt-file) and runs no hook and reads no CLAUDE.md file (--settings), and the text of all messages is one user prompt with no roles; max_tokens has no effect. The goal evaluator and the title call on a Claude Code model now get their transcript or prompt and their instructions. A title_model on a Claude Code model no longer fails New. Before, the call failed with model claude-code/... runs its own agent loop.

  • Claude Code reaches MCP servers through the harness endpoint (internal/backend/claudecode, internal/turn, docs/architecture.md) — a Claude Code turn with no AllowedTools no longer gives Config.MCPServers and the session servers to the CLI in --mcp-config. The CLI gets one MCP server for each harness MCP server, under its own name, and the harness server for the other tools, so it sees each MCP tool as mcp__<server>__<tool>. mcp_servers and session servers cannot take the name harness. The runtime keeps one client for each server, so a tree of sessions starts one server process for each harness process, not one for each CLI. Each MCP call runs through Request.Call, so the hooks see it and tool_timeout_s applies. turn.Capabilities.OwnsMCP, turn.Request.MCPServers, and turn.MCPServer are removed.

  • Workspace overflow message (internal/workspace) — a file list over 32 MiB now fails too_many_changes with the message file list exceeded its size bound. Before, the message named the time budget.

  • Breaking: the workspace seam is engine-neutral (protocol, internal/workspace, docs/architecture.md) — protocol.RevOp and protocol.EngineGit are removed, and ParseRev refuses the kind op. head_rev is the revision that the working-copy edits are relative to (git HEAD, jj @-), and it is absent when the work tree has several parents; the diff is then against their automatic merge. patch is a git-format unified diff for every engine.

  • Breaking: parent_call_id removed (protocol, internal/eventlog, internal/acp, internal/backend/claudecode, plugin) — parent_call_id is no longer a field of LogMessage in the log, of Message in the protocol, or of the messages that ACP replays, and parent_tool_use_id is no longer a field of the plugin message. The field was always empty: a Claude Code session runs with the CLI Agent tool disallowed and starts a subagent as a harness child through task, so the CLI sends no frame of a subagent thread. The adapter keeps one thread of output.

  • web_fetch through an egress proxy (internal/tool/webfetch, harness) — web_fetch takes the proxy from http.ProxyFromEnvironment and the process environment, as the other Harness clients do, and sends a request through the proxy that applies to its URL, as the other Harness clients do, so it works behind a credential-injecting egress proxy such as gatekeeper. Before, it ignored these variables and dialed directly, which failed where only the proxy has egress and skipped the egress logging and policy of the proxy. Harness adds no credential; an egress proxy may, so a fetch of a host for which the proxy holds a credential is authenticated by the proxy. With a proxy, the tool still refuses a bad scheme, a user name or password, and a literal non-public IP, and resolves a host name and refuses it when any resolved address is not public (only a not-found answer sends the name on to the proxy; any other lookup failure refuses); an unreachable proxy fails the request with no direct dial; that check is best effort, DNS rebinding protection holds only without a proxy, and the egress policy belongs to the proxy. A proxy that intercepts TLS works when its CA is in the system root pool; there is no option to skip verification. Redirects get the same checks on each hop, and every size and time limit still applies. Without a proxy, the tool dials as before. Options.WebAllowLoopback becomes the test seam Options.WebTest, which also holds a resolver, a proxy, and root CAs.

  • Breaking: workspace changes drop deprecated fields (protocol, internal/workspace, docs/architecture.md) — GET /workspace/changes no longer sends head or base.sha, and the error code not_a_git_repo is gone. A client reads head_rev and base.rev for the revisions, and not_a_repo for a directory outside a work tree. branch stays, as the optional label of the head. The not_a_repo message reads "is not a work tree of a known VCS".

  • Off level for Sonnet 5.5 (internal/modelmeta, internal/provider/anthropic) — claude-sonnet-5-5 now lists the off level, so /thinking off and the model picker offer it. An off effort sends thinking: {"type": "between_tools"} and no effort field, because the model rejects disabled and takes between_tools in its place. The model does not think before it answers, and the short updates that it writes between tool calls come back as thinking blocks, which stay in the history. The offType field of an anthropicThinkingCanBeDisabled entry in internal/modelmeta/overrides.json names the thinking type.

Fixed

  • Provider error details (internal/provider) — a model API error without a recognized error body includes a bounded excerpt of the response body.

  • Claude Code CLI login (internal/backend/claudecode, docs/architecture.md) — the CLI now runs with the harness environment minus ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN, in every run, the login probe, and turn.Ask. Before, a key in the harness environment made the CLI bill that key instead of its own login.

  • Cached prompt tokens of an OpenAI-compatible model (internal/provider/openaicompat) — the usage chunk of a chat completions stream carries prompt_tokens_details.cached_tokens. The adapter now reports it as cache_read_tokens, reports prompt_tokens minus the cached part as input_tokens, and fills provider_cached_tokens of turn_metrics. A model behind such a gateway (Fireworks, Gemini through Bifrost) reported 0 cache reads before.

  • MCP call after a select in the same run (internal/tool/mcpsrc) — mcp(action="call") of a tool that its server lists now runs it when the tools of the model call lack it. Before, a Claude Code session whose mcp(action="select") read a new tool list got no such tool available from a call of that tool later in the same run, and so did a harness-loop model call that made both calls.

  • Compaction purpose of a Claude Code session (internal/session) — a compaction of a Claude Code session now logs turn_metrics with purpose compaction, and its chat span carries the same purpose. It logged purpose turn before.

  • Cache expiry of an injected-auth ChatGPT entry (internal/backend) — an entry with auth injected and models_from chatgpt targets the ChatGPT Codex backend and now reports cache_expires_at with the 30-minute lifetime, as an entry with auth chatgpt does.

  • Open object schemas on the Codex lane (internal/provider/openai) — a free-form object field in a tool schema, one with no properties and no additionalProperties, now keeps additionalProperties: true. The deferred mcp tool forwards the arguments of a call; before, the model could send only {}.

  • Claude Code compaction usage (internal/backend/claudecode) — a /compact result carries zero usage and the call in modelUsage. The turn now reports the modelUsage token counts when usage is zero.

  • Warm-up tools match the first turn (internal/session, internal/turn) — the Codex websocket warm-up omitted ask_user_question and ignored the chat.params hook and the native web search flag, so the first turn after a create or wake refused the chain with chain_refusal_detail=tools. The warm-up now builds its request as the first turn call does.

  • Chat fixture tail deltas (harnesstest) — NewChat streams Reply.Tail after the first release and honors TailBlock until the tail release, as NewAnthropic does.

  • Side requests leave the Codex websocket chain alone (internal/provider/openai, internal/backend/modelapi) — a title, compaction summary, or goal evaluator request of a Codex session now goes over HTTP. Before, it shared the websocket entry of the session, so the next turn request could not chain with previous_response_id and was sent in full, and a title that ran during the first turn could push that turn to HTTP.

  • A model call after tools/list_changed sees the new list (internal/tool/mcpsrc) — a tool result that carried notifications/tools/list_changed could reach the next model call before the actor marked the read of the list as in flight, so that call used the old list and the added-tools notice landed one call late. The wait before a model call now goes through the actor, so it waits for that read.

  • Context overflow on the Responses API compacts (internal/provider/openai) — an HTTP error body or a stream event with the code context_length_exceeded now returns a context-overflow error, so a turn on the openai or codex provider compacts and calls the model again. Before, the turn failed with the raw provider message and never compacted.

  • harness serve stops cleanly with an idle client connection (cmd/harness) — on SIGINT or SIGTERM, serve closes each HTTP connection that has no request in flight before it waits for the HTTP server. Before, net/http counted a connection that had sent no request as active until it was 5 s old, so one such client held the stop for the whole 5 s budget, and serve exited with status 1 after it wrote a handoff report. The exit status now follows the stop: 0 when Runtime.Close returned nil and serve-stop.json was written; an HTTP request that does not finish in time is logged.

  • MCP fixture address ownership on Linux (harnesstest) — a closed fixture keeps its address reserved until test cleanup, so stale requests cannot reach another fixture that the OS puts on that port. The listener still closes normally, and a later connect is refused. This removes the fixed-port-range assumption on Linux; other platforms keep their listener behavior.

  • Claude Code loads ask_user_question upfront (internal/backend/claudecode, internal/backend/external, internal/mcp) — the harness-hosted MCP endpoint lists ask_user_question with _meta {"anthropic/alwaysLoad": true}, so Claude Code loads its schema at the start of each run and does not defer it behind ToolSearch. Before, with tool search on (mcp_tool_loading lazy, or auto with many MCP tools), the model saw only the name of the tool, never loaded it, and asked its questions in its reply text, so the session read idle and not waiting. mcp.Tool keeps the _meta of a tools/list entry.

  • Tool-call arguments keep the bytes of the model (protocol, internal/backend/modelapi, harnesstest) — a tool_call part of the log now has arguments_text, which holds the arguments as the model wrote them when the JSON encoding of arguments changes them. Before, the log kept only the encoded form, which drops whitespace and escapes <, >, and &, so a later turn sent {"dir":"."} where the Responses API wrote {"dir": "."}. The request was then no extension of the request before it, and the first Codex websocket call of each turn after a turn with a tool call sent the whole conversation again. The harnesstest Responses double now writes arguments as the recorded server does.

  • Codex chains each model call of a session with a plugin segment (internal/tool/pluginsrc, internal/turn, internal/backend/modelapi, internal/provider) — the system.transform segments of the plugins are now a pin, as the MCP notices are: a call sends a segment where it changes, and each later call sends it at the same place. Before, each request carried the segments as its last input item, and the next request did not hold that item, so a Codex websocket request never chained with previous_response_id and sent the whole conversation again on each model call (for example, a task child with 2453 input items sent all of them on each call). A segment that does not change is now sent once, a session with a plugin chains each call, a segment that a crashed plugin sent stays at its place, and a compaction keeps only the newest pin of each kind, so a segment that changes on each call does not grow the context past a compaction. provider.Request.Tail and turn.Request.Tail are gone.

  • Responses requests send the server ids of output items back (internal/provider/openai, internal/message, internal/backend/modelapi, harnesstest) — a message or function_call item of an earlier response now goes back with the id and status that the server gave it, and a message with its phase, as the Codex CLI does. The text and tool_call parts keep them in provider_data. Before, harness sent these items without them, so a full request (an HTTP request, or a websocket request that could not chain) did not match the prefix that the server had cached from its own output. The harnesstest Responses double now gives each message and function call an id and a status, and WireEvent.ItemsWithoutServerID counts the output items that a request sends back without one.

  • Each MCP server keeps its instructions on Claude Code (internal/backend/claudecode, internal/tool/mcpsrc, internal/turn) — the harness MCP endpoint now gives the instructions of each MCP server in the initialize reply of that server, and the harness server gives only the line about the resource tools. Before, the harness server gave the instructions of all servers in one text, and Claude Code cuts the instructions of one server at 4096 UTF-16 code units, so the servers after the cut lost their instructions. The MCP segment of the other backends does not change.

  • A cancelled or abandoned grep stops (internal/tool/builtin, internal/backend/external) — glob, grep, and ls now stop when the context of the call ends, grep skips named pipes, sockets, and devices, read_file, edit_file, and write_file refuse them, and the tool bridge of an external harness ends a call when the harness cancels its request with notifications/cancelled (as the Claude Code CLI does on its tool timeout) or drops the connection, so the end of the turn and an interrupt no longer wait for a search that nobody reads.

  • No hosted web search for a Responses Lite model (internal/provider/openai, internal/backend/modelapi) — a codex session with web.search on failed every turn with Hosted tool 'web_search' requires authorization and metering that are not supported, because the ChatGPT backend takes no hosted tool for a model that its model list marks use_responses_lite. Such a model now gets no hosted tool, and its turn runs without search. An entry with models_from chatgpt offers search for no model until its model list is read, and then only for a model that the list names without the flag, so harness run and a serve client that never lists models get no search on any codex model.

  • Claude Code usage limit ends the turn provider_exhausted (internal/backend/claudecode, internal/provider, internal/provider/openai, protocol) — a Claude Code run that the subscription usage limit refuses (a rate_limit_event with status rejected and no overage in use, then a failed result) ends with cause provider_exhausted, a recover_hint, and the new turn.ended field resets_at (Unix seconds), and the queue waits as after any usage limit. Before, it ended with error_class unrecovered, and the next queued input ran into the same limit. A Codex error of type usage_limit_reached is a usage limit whatever its message, and it fills resets_at from the resets_at of its error body, over HTTP and on the websocket. A transient rate limit keeps its retry rule.

  • One model list request when a session opens on an injected catalog entry (internal/injectedauth, internal/backend) — with auth: "injected" and models_from: "chatgpt", the status probe and the fetch of the catalog are the same request. The body of a probe that answers 200 stays for 30 s and the next fetch takes it, so session/new sends one request, not two.

  • A retried model call discards the item that the failed call streamed (internal/turn) — when a model call streamed text and then failed with a retryable error, the live item never closed on the wire, and a client that removes partial text only on item.discarded kept it until the turn ended. The loop now sends item.discarded with the item_id of that item before it calls the model again, as the Claude Code backend does for a reply that the CLI drops. A failed call that streamed no delta sends no frame. harness run prints [re-streaming the reply] at the discard.

  • A late subscriber gets the item that streams (internal/session, internal/acp) — a subscriber of Session.Events, Turn.Events, or the SSE stream that starts while an item streams now receives the item.started frame and the item.delta frames of that item sent so far, placed after the durable records up to their seq, and then every later frame. Before, it missed them, so the ACP client could read usage_update before agent_message_chunk, because the text came only with item.completed. The session keeps at most 256 KiB of delta data for the item that streams.

  • A retried model call keeps no stale item ID (internal/turn, internal/session) — when a model call streamed text and then failed with a retryable error, and the retry returned a tool call with no text, the tool call item completed under the ID of the discarded streamed item. It now gets a new ID, so a client never sees an item.completed with the ID of an item that never completed.

  • A question stays open when machine input arrives (internal/session, internal/eventlog) — an input that is not from a person (a source other than typed, command, or none: a child report, a goal input, a parent message, or a client source such as github, api, or box) no longer dismisses an open request. The session admits it, keeps it in queued, starts no turn from it, and stays waiting. It follows its normal delivery once the request resolves: after an answer, a steer input may join the answer turn and a queue input runs as the next turn; after a dismissal (also a settings change to a model of another provider) it runs at once. An input from a person still dismisses the request first. Before, such an input closed the question, the model read "The user dismissed this question without answering", and the answer of the user failed with request_not_pending. input.admitted is now legal while a request is open. A compaction that a person asks for still dismisses the request.

  • Claude Code unknown tool name (internal/backend/claudecode) — a turn no longer fails with "the CLI did not apply the tool restriction: tool bash ran" when the model calls a harness tool by its bare name before ToolSearch loads it. The CLI refuses an unknown name with No such tool available: <name> and no . after it, and the guard accepted only the . form that the CLI gives for a disabled built-in tool. The guard accepts both forms and still fails the turn on any other result.

  • Claude Code ToolSearch (internal/backend/claudecode, internal/backend) — the CLI gets ToolSearch in --tools again, so it defers the schemas of MCP tools and loads one when the model needs it. Without ToolSearch, the CLI loaded every MCP tool schema on every turn: with 200 large MCP tools, --tools "" wrote 534,841 tokens to the cache and --tools "ToolSearch" wrote 7,167; a box with 861 tools wrote about 600k tokens on each turn instead of about 86k. A run with harness run -model claude-code/haiku and 200 large MCP tools now writes 7,662 tokens to the cache. mcp_tool_loading sets ENABLE_TOOL_SEARCH of the CLI: eager is false, lazy is true, and auto or an unset value is auto. The turn does not fail on a ToolSearch call, and its result names the tools that it loaded.

  • Empty tool output in Claude Code (internal/mcp, internal/backend/external) — the hosted MCP endpoint now always writes the text field of a text item and the data and mimeType fields of an image or audio item, also when they are empty. A tool with no output (mkdir, touch, echo x >> file) made the Claude Code CLI reject the result with MCP server "harness" returned a malformed result that failed schema validation, and the model saw an error for a command that had worked. The fake CLI now checks each tools/call result against the MCP schema.

  • Resumed Claude Code sessions that hold built-in calls (internal/backend/claudecode) — the turn no longer fails when the CLI emits a tool_use for a built-in tool such as Bash or Read. Under --tools "" the CLI cannot run it and answers with its own refusal (No such tool available: Bash: an error result with that text in a tool_use_error, in a frame whose tool_use_result is a string), so the log records a failed tool call under the CLI name and the model then calls the Harness tool. The turn fails when such a call returns any other result, an error result of a command that ran also, because the CLI then ignored --tools; a changed refusal wording fails closed. An init frame that lists a built-in tool still fails the turn. Before, the first such tool_use failed the turn, which broke a session that resumed a history from before --tools "".

  • Durable pins (protocol, internal/session, internal/eventlog, internal/turn) — the first model call that sends a pin (an MCP notice, a skills update, a process status, or a plugin segment) appends pin.recorded with its text and its place, and a new process rebuilds its pins from the log. A session that a deploy reopens now sends a first request that starts with the bytes of its last request, so the prompt cache survives the restart. Before, each pin went back to the start of the history, and the first request after a restart wrote the whole history to the cache again. A changed pin keeps the old one in place and adds the new text after the history. The engine banner has no record.

  • Stable engine banner across processes (internal/turn, internal/session, internal/eventlog, harness) — the engine banner is [engine: harness <version> · session started <time>], where <time> is the session.created time, and it follows the first message of the history (after a compaction, the history that the compaction left). Its text and place come from the log alone, so a new process (harness run -c, an ACP reload, a wake from hibernation, a restart of the same version, a handoff, or a wasm page load) sends the same prefix as the process before it, and the first model call of that process reads the prompt cache instead of writing the history again. Before, each process pinned the banner after the newest message with its own start time, which changed the prefix after the first message. The banner is the first pin, so an MCP notice at the same place follows it.

  • Stable MCP down notice across processes (internal/session) — a restart of the same version no longer moves the down notice of an MCP server from its place in the prompt to the end of the history, so the prompt cache holds after a restart. The first model call of a process pins the notice after the banner.

  • Effort check at create (harness) — Runtime.Create and POST /sessions refuse an effort that is not off, minimal, low, medium, high, xhigh, or max with invalid_request, the same check as Session.Update, and create no session. Before, the session was created with the unknown effort stored.

  • Request id reuse in ACP (internal/acp/rpc) — a request id is free before the answer is written. A client that sends a new request with the same id on receipt of the answer was sometimes refused with -32600 "a request with this id is running".

  • Off level for Opus 5 (internal/modelmeta) — claude-opus-5 now lists the off level, so /thinking off and the model picker offer it, and an off effort sends thinking: {"type": "disabled"}. Before, models.dev listed no off level for it, so the picker had no off, and an off effort sent no thinking field, so the model kept its default adaptive thinking. Opus 5 accepts disabled at effort high or below, and off sends no effort field, so the API default high applies. The new anthropicThinkingCanBeDisabled table in internal/modelmeta/overrides.json names such models.

  • Keyless project providers (config, internal/backend, internal/provider) — a provider that only .harness.json defines now reads no API key and sends no key header of its own (the openai and openai-compat adapters), and works against an endpoint that needs no credential, such as a local model. Before, every request failed with the no-key error. A custom user-config provider without a key, auth, or a credential header still fails its first request with the no-key error. A native API-key provider without credentials fails admission with model_unavailable, before a turn starts.

  • Plain invalid_request messages (protocol, internal/server, internal/acp, internal/modelref) — the message of an invalid_request error, in the HTTP body, the ACP error, and the text of a failed typed command, is only the reason, except that an error with no reason keeps the sentinel text. It no longer starts with harness: invalid request: or holds a package name such as message: . errors.Is(err, harness.ErrInvalidRequest) still matches.

  • Effort off disables thinking (internal/provider/anthropic, internal/modelmeta) — an off effort on a model that thinks by default and lists off (Sonnet 5 and Haiku 5.5) sends thinking: {"type": "disabled"}. Before, it sent no thinking field, and the model still thought. A model with no off level is unchanged.

  • Thinking blocks of a model that thinks by default (internal/provider/anthropic, internal/modelmeta) — a request to an Anthropic model that has an effort control and no budget_tokens control (for example Haiku 5.5, Sonnet 5, Opus 5.5, and Fable 5.1) keeps the stored thinking blocks in the history when the request omits the thinking field, because the field then runs adaptive thinking. The API binds these thinking blocks to the conversation, and a block that is left out while a later block is kept, or that returns after a request without it, fails the prefix check. Opus 4.7 and 4.8 have thinking off by default, and a request with thinking off leaves the stored blocks out.

  • Process start cut by Close (harness) — a StartProcess, StopProcess, or RestartProcess that ends with no error after Close canceled the runtime fails with ErrDraining. A start that waits at the ready gate while Close kills its process no longer answers 200.

  • Send to a child whose report is in flight (internal/tree) — a send of the task tool waits for a report of the child that is in flight, from the end of the child turn until its parent records it. A send in that window used to find the child unsettled, spawn it no more, and lose the report of the second turn.

  • Project config provider keys (config, internal/backend, internal/acp) — a project .harness.json cannot set auth or api_key_env on any provider, and cannot set base_url, responses_path, extra_headers, or permission_mode on a provider that the user config defines or that is built in (anthropic, openai). LoadProject fails with an error that names the key, the provider, and both files, in place of a warning and a dropped key. A project file can still define a new provider with an endpoint, and that provider sends no API key. Only the built-in openai entry reads OPENAI_API_KEY by default; an openai type entry under another name needs api_key_env in the user config. harness acp sends the load error in data.reason of the session/new error. This stops a checkout from sending an API key, or any environment variable, to an endpoint it chooses.

  • Node exit deadlock note (sdk/embed/README.md) — a Node host of the WebAssembly module sets --no-concurrent-sparkplug, because Node 24 can deadlock in process.exit without it. No behavior changes.

  • Project config trust model (docs/architecture.md, README.md) — the spec states that a project .harness.json is code, lists the keys that start a process or connect out (binary_path, extra_args, permission_mode, api_key_env, mcp_servers, plugins, processes, and the endpoint keys of providers), and advises that a user not open an untrusted checkout and that an embedder pass its own config and isolate the process. No behavior changes.

  • Proxy base before validation (config, cmd/harness-wasm, sdk/embed) — proxy.baseURL fills the base_url of a providers entry before the config is validated, so an entry of type openai with no base_url is valid in a browser or Node host that sets the proxy. config.MergeProject takes the proxy base as its last argument. sdk/embed/README.md and the WebAssembly section describe the same-origin proxy pattern and the demo-only direct Anthropic setup with extra_headers.

  • Load answer order (internal/acp) — the event pump of a session that session/load or session/resume opens queues its updates until the answer is sent. A record that the log gains between the read and the open no longer reaches the client before the answer.

  • ACP answer order (internal/acp) — the answer to session/prompt follows every update of its turn and precedes every update of a later turn, such as a goal turn that starts at once. The event pump holds at the end of the turn until the answer is queued.

  • Native model list (internal/modelmeta) — Runtime.Models, GET /models, the model tool list, and the ACP model picker list the chat models of the anthropic and openai providers, as they list the codex and claude-code models. A dated snapshot id (for example claude-haiku-4-5-20251001) is not listed when its undated alias is in the table. A session can still use a dated id.

  • Start after Close (internal/process) — a start that waits at the ready gate while Runtime.Close cancels it fails with the canceled context. It never replies with a status, even when the cancel also ended the process.

  • Plugin package documentation (plugin) — the package documentation is a guide: how to write and run a plugin, what each hook does, when each event is sent, the chain order, the failure and deadline rules, and which hooks a backend that runs its own agent loop skips. Runnable examples show a process plugin, an in-process plugin, a plugin tool, and a manifest. Corrected statements: tool.execute.after replaces only the result text; ChatParamsResponse.Params replaces all the parameters; Client.ServeURL is empty when the host serves no HTTP API; question.asked is never sent; a process plugin must use the name of its config entry and write logs to standard error.

  • Permanent transport errors (internal/provider) — a transport error that declares itself permanent through a Permanent() bool method is not sent again, and the turn does not call the model again. The turn ends failed with error class permanent. Any other transport error keeps both retry layers.

  • Goal evaluator failure exit code (cmd/harness) — harness run -goal exits 1 and prints goal evaluator failed: <error> when the goal evaluator fails (for example, when its model has no API key), in place of goal not achieved after N turn(s) and exit 3. A paused goal after a retryable evaluator error also exits 1. Exit 3 stays for a goal that the evaluator judged not met or impossible. harness run prints session: <id> on every exit code when it saved the session. GoalView gains verdict, the last verdict of the evaluator.

Added

  • Subprocess transport (sdk/embed) — createHarness({transport: subprocess({command, args, env, cwd}), config, store, log}) spawns harness acp under Node and gives the same stream of ACP messages and the same close() as the wasm transport. config goes to the process as a temporary file named by the new HARNESS_CONFIG_FILE, which changes the file that cmd/harness reads and leaves the default place of the Codex login and the plugin cache at $HARNESS_CONFIG or ~/.harness; the project config still merges over it; and store.dir as HARNESS_SESSION_DIR. The process keeps its own tool set, with bash and process, so the default tool set of wasm does not apply. Stdout carries ACP frames only: a line that is no frame ends the stream with an error and stops the process. Each line of stderr goes to log. close() ends the input of the process and waits closeTimeout (default 5 s), then sends SIGTERM, then SIGKILL; it rejects when the process exits with a status other than 0, dies from a signal, or needed a signal. A process that exits on its own ends the stream with its exit status. A command that cannot start rejects createHarness. tools, builtinTools, proxy, and fetch reject createHarness with the name of the option, because the binary has no way to honor them. The client API tests run over both transports.

  • Default tool set of an embedded host (sdk/embed) — when createHarness gets no builtinTools of its own, it allows read_file, write_file, edit_file, ls, glob, grep, read_tool_result, session_info, and the names of the page tools, so the model of a browser or Node host is never offered bash or process, which cannot run there. defaultBuiltinTools exports the list; a host lists task, model, or goal in builtinTools to enable it, and a list it passes is used as it is.

  • Browser store (sdk/embed) — a browser Worker has a real file system: memory for /work and the origin private file system (OPFS) for the persistent store, which sdk/embed implements over sync access handles with no dependency. createHarness({store: {persist: true}}) keeps the sessions below /persist/sessions; fsync is flush(), so a record that Append acknowledged survives the end of the Worker and a reload. One page of the origin holds the store through a Web Lock that it takes before any file opens; a second page rejects with the code store_in_use. store.dir in a browser must lie below /persist with no . or .. segment. Under Node, two processes that find one stale .embed.lock no longer both replace it.

  • ChatGPT subscription login (cmd/harness, internal/codexauth, config, harnesstest) — harness login codex signs in with the Codex OAuth client: the browser flow with PKCE on localhost:1455, or --device for the device code flow. --status prints the account, the expiry, and whether a refresh token exists, and harness logout codex deletes the login. The login is auth/codex.json beside the user config (mode 0600, directory 0700, written by rename under a lock), and Harness never touches ~/.codex. A provider entry with auth: "chatgpt" (valid on an entry that builds the Responses adapter, not with api_key_env) reads the login at its first request and sends Authorization, ChatGPT-Account-ID, and originator: harness only to its own Responses URL, over HTTP and the websocket. A token that ends within 5 minutes, or a 401, refreshes once for all concurrent requests, keeps an unrotated refresh token, and writes the file back. A missing login or a rejected refresh fails the turn with the permanent error not logged in to Codex; run `harness login codex` . The user config keys codex_auth_file and codex_issuer name the file and the issuer. A refresh runs on its own context, keeps its answer in memory when the file cannot be written, and backs off after a transient failure. The client follows no redirect and reads no OPENAI_API_KEY. auth, and base_url and responses_path of an entry that sets it, are user-only. The login file must not be readable by others. harnesstest gains CodexIssuer, a scripted OAuth issuer, and OpenAIOptions.Credentials, AccountID, and OnReject.

  • Embedded harness client (sdk/embed) — createHarness({transport: wasm({module, wasmExec, worker: true}), config, proxy, fetch, tools, builtinTools, store, log}) starts the WebAssembly module in a browser Worker or a Node worker thread and returns an ACP {readable, writable} stream. A tool call of the module runs the run function of the page tool, and a cancel aborts its signal. A page fetch carries the model requests over a bridge that streams the response and passes aborts. harnessConnect({proxy: {baseURL}}) routes model traffic to a proxy but supplies no credential: native API-key entries need explicit auth: "injected" when the proxy adds auth. It sets base_url of the native anthropic and openai providers and of each provider entry that sets none. proxy.headers go only on requests to the origin of proxy.baseURL. A cancel of the stream, an abort of the writer, or a failed Worker closes the harness and releases the store directory. Under Node, store.dir is a directory that one process holds. sdk/AGENTS.md now binds sdk/typescript only, and the spec calls sdk/typescript the plugin SDK.

  • WebAssembly ACP connection (cmd/harness-wasm, internal/jshost, config, internal/acp/cwdruntimes) — the module exports harnessConnect({config, storeDir, env, tools, builtinTools, proxy, onFrame, onLog}), which opens one ACP connection and returns {send, close}. send queues one frame and never blocks the event loop; close ends the input and returns a promise that settles when the sessions are released. The module calls the global fetch through a RoundTripper whose abort stays tied to the request context until the body closes, so a cancel ends a stream that has begun. A fetch that gets no response ends the turn permanent after one attempt while navigator.onLine is true, and its error names the JavaScript error. The tools option adds JavaScript tools. cmd/harness-wasm/node/host.mjs runs the module under Node on stdio, on a DiskStore in a directory that one process holds through .embed.lock, and CI runs the ACP scenario table on it. config.Parse and config.MergeProject take a config that the caller holds, and cwdruntimes.Options takes ModelTransport and Tools. The size budget rises to 20,950,000 bytes raw and 5,200,000 bytes gzip.

  • WebAssembly build (cmd/harness-wasm, internal/wasmsize) — the runtime builds for GOOS=js GOARCH=wasm, and cmd/harness-wasm is the module entry. The Codex websocket dial is split by build tag, because a browser WebSocket cannot set request headers; on js the request goes over HTTP. CI runs go run ./internal/wasmsize, which builds the module and fails when its raw or gzip -9 size is above testdata/wasm-size-budget.txt.

  • Session MCP servers (harness) — Create and Open take SessionOption values. WithSessionMCP gives one session MCP servers beside Config.MCPServers: the runtime connects them at the first model call, retries and parks a failed server like a runtime server, and stops every stdio server at Release, End, and Close. Nothing persists, so an Open without the option has no session server. No protocol field or HTTP route carries the option, and the secrets in the specs stay out of the log.

  • ACP load, resume, list, and close (internal/acp, cmd/harness) — harness acp answers session/load, session/resume, session/list, and session/close, and initialize advertises loadSession and the list, resume, and close session capabilities. session/load reads one view of the session, sends its conversation as user_message_chunk, agent_message_chunk, agent_thought_chunk, tool_call, and tool_call_update updates, and opens the session; the event pump then starts at the end of the replay, so a record that arrives between the replay and the open reaches the client once. session/resume opens the session with no replay. session/list lists the root sessions of the store by creation order, with an optional cwd filter and a cursor. session/close cancels the prompts of a session as session/cancel does and releases it; the log stays. A session whose log names another work directory than the cwd is -32602. session/delete is not advertised, and the title of a listed session is null.

  • ACP config options, commands, and usage (internal/acp) — session/new answers the model and effort config options, and session/set_config_option changes them and answers the complete list. A change of the model or the effort, also one from /model, /thinking, or the model tool, sends a config_option_update. After the answer to session/new, the agent sends an available_commands_update with the commands that a typed line can run. A prompt that is one text block starting with / runs the slash command, and its status text is an agent_message_chunk. The agent sends usage_update when the context size or the cost changes, and a session_info_update after each turn. A client that sends the capability session.notices gets a notice when another owner takes a session.

  • ACP tool calls (internal/acp) — harness acp reports each tool call of the model as a tool_call update and its result as a tool_call_update. A call has a kind (read, edit, search, execute, fetch, think, or other) from its tool name, locations with the absolute path (and the offset of read_file as the line) for the file tools, and a diff for edit_file and write_file. The update is completed or failed, carries the result text as rawOutput, and sends each image of the result as an image content item. A call that a cancel cut short ends failed before the prompt answers cancelled.

  • ACP sessions and prompts (cmd/harness, internal/acp) — harness acp answers session/new, session/prompt, and session/cancel. It builds one runtime for each cwd that a session/new names, with the project config of that cwd, over one session store and one owner, and it reads no config before the first session/new. The mcpServers of session/new become MCP servers of that session only, and initialize now advertises mcpCapabilities.http. A prompt takes text and resource_link blocks and streams the text and the reasoning of the model as agent_message_chunk and agent_thought_chunk updates, also for a turn that no prompt started, such as a goal turn. The stop reasons are end_turn and cancelled; a failed turn is -32603 with the error class, and a session that another process took is -32603 with data.code session_not_owned. $/cancel_request for a prompt interrupts its turn and answers -32800. At the end of the input the agent releases its sessions first, so a running prompt ends at once.

  • ACP initialize (cmd/harness, internal/acp) — harness acp serves Agent Client Protocol version 1 over stdin and stdout, newline-delimited JSON-RPC 2.0. It answers initialize with the agent info, the agent capabilities, and an empty authMethods, and answers version 1 for any client version. It advertises no prompt capabilities yet. SIGINT and SIGTERM end it with status 0. A line that is not JSON gets -32700 and the connection stays open; an unknown method gets -32601; $/cancel_request cancels the named request. stdout holds ACP messages only and logs go to stderr. Every other ACP method answers -32601 until it is built.

  • Engine-neutral revisions (protocol, internal/workspace) — protocol.Rev (Kind, ID) names a revision or a change, and its text and JSON form is <kind>:<id> with the kinds branch, tag, commit, and change. ParseRev parses it. GET /workspace/changes adds engine (git), head_rev, and base.rev; head_rev and base.rev are commit revisions and are absent when the head has no commit or the scope has no base. head and base.sha keep their values and are deprecated. protocol.CodeNotARepo (not_a_repo, 409) joins the error codes as the engine-neutral name of not_a_git_repo.

  • Blocked goal (protocol, harness) — a new goal state blocked marks an active goal that nothing drives: no run, no open turn, no queued input that starts, and no turn left to judge. One check moves such a goal to blocked with reason no_driver at Open, after each run settles, after SetGoal on a held queue, after a dismissed request, and after a cancel of an idle session. The check starts no turn and calls no model. Any input, SetGoal, or AdjustGoal makes the goal active again. A blocked goal does not make a session resumable, so a host can let the session sleep.

  • Plugin failure log line (harness) — a plugin hook that fails open writes one plugin: hook failed Warn line through the runtime logger, with the plugin name, the hook, and the error text with secrets masked.

  • Guardrail example (examples/guardrail) — one plugin.Plugin value that denies a force push, rm -rf on a broad target, and a read_file call on a .env file. go run ./examples/guardrail runs it in the host process, and examples/guardrail/cmd/guardrail-plugin serves it as a plugin process.

  • TypeScript plugin SDK flags (sdk/typescript) — createPlugin takes denyOnFailure: ['toolExecuteBefore'] and hookTimeouts: { <hookKey>: ms }, and writes deny_on_failure and hook_timeouts to the manifest. It throws for a value the host would reject.

  • Hook timeouts (plugin, internal/plugin) — a plugin manifest can set the dispatch deadline of each synchronous hook in the new optional field hook_timeouts, a map from hook name to milliseconds. A hook with no entry keeps 5 s. A value must be from 1 to 600000, the hook must be in hooks, and event has no entry; any other value fails the first Create or Open, and harness.New for an in-process plugin. The spawn comparison of the live and cached manifests includes the field. In Go, plugin.Plugin.HookTimeouts takes a time.Duration for each hook.

  • In-process plugins (harness) — Options.Plugins takes *plugin.Plugin values that run in the host process, through the same host code as a process plugin, so the chain order, the deadline, and deny_on_failure are the same. They run after the config plugins, in list order. New fails on an invalid plugin, a repeated plugin name, and a plugin tool that takes the name of another tool, and Runtime.Close waits for the plugin calls that are running.

  • Go plugin package (plugin) — github.com/majorcontext/harness/plugin is the public Go API for plugins. A plugin.Plugin value holds the hooks and tools, Manifest derives the manifest from the fields that are set, and ToolBefore.DenyOnFailure sets the deny_on_failure flag. plugin.Serve runs the value as a plugin process on standard input and output, and plugin.ServeConn serves it over any stream. A hook or tool that panics gets an error response, and the connection stays up. plugin.Client offers the workspace directory, config block, HTTP headers, an http.Client that adds those headers, the harness version, SessionMessages, MCPCall, and Generate, and Plugin has a ChatMessage field that the runtime does not dispatch. The context of a hook other than Event ends at the host deadline of that hook (its HookTimeouts value, or 5 s), so a timed-out hook, and a Generate call that it made, stop; the context of a tool call and of Event ends with the connection. A hook that returns no params or message leaves the params or message of the earlier plugins as they are. The public types use a model reference as a string and plugin.Part for message content, and the wire JSON is unchanged.

  • Deny on failure (internal/plugin) — a plugin manifest can list tool.execute.before in the new optional field deny_on_failure. When that hook fails (the plugin does not start, exits, passes the deadline, returns an error, or sends an undecodable response), the host denies the tool call with denied: plugin <name> failed: <error> in place of a fail-open skip. A canceled context is an abort and records no deny. Any other hook in the field fails the first Create or Open, and harness.New for an in-process plugin. At spawn the host now compares the full live manifest (hooks, deny_on_failure, tools) with the cached one, and a difference is a start failure that denies a hook that either manifest flags. The plugin manifest cache file now carries a version; a file of another version is discarded and every plugin probes again.

  • Plugin MCP and model calls (internal/plugin, plugin) — the host serves client/mcp.call and client/generate. mcp.call calls a tool of any server in mcp_servers and returns {content, is_error}; an unknown server fails the call, and so does a server that is retrying or parked, at once and with its reason. generate makes one model request with no tools through the provider layer, resolves an empty model to the default and an alias to its model, and returns {message, usage}; the response gains the optional usage field. plugin.Client.MCPCall returns a *plugin.MCPCallResult, and plugin.Client.Generate returns a *plugin.GenerateResponse with Message and Usage. A negative max_tokens in generate fails the call before any model request. A plugin tool can return blob parts: one with inline data reaches the model as a result blob, one with only a URL becomes a text line, and a part of another type fails the call. On success the host logs one line for each generate call.

  • Merged plugins (config) — the plugins arrays of the user and project config files join, project plugins first and user plugins last, so the most trusted plugins run last. A project config no longer replaces the user plugins. A plugin name in both files fails LoadProject with an error that names the plugin and both files.

  • Turn handle (harness) — Session.Prompt admits an input and returns a *Turn, and replaces Session.Submit. Turn.Events yields the events from the admission through the end of the turn that took the input, Turn.Wait returns a TurnResult with the stop reason, cause, masked error, usage, command status, and Withdrawn, Turn.Steer sends a steer input to the running turn, and Turn.Cancel withdraws a queued input or interrupts its turn. Session.Turn(receipt) returns the Turn of an earlier receipt. A Turn is a view over the log, so it adds no event kind and no goroutine.

  • Root split (harness, harness/store, harness/httpapi, harness/httpsync) — the root package keeps Runtime, Session, Turn, View, Reader, and the Store, Owner, Sync, and Tool interfaces. DiskStore, MemStore, CheckName, and CheckRecords move to store. Runtime.Handler becomes httpapi.Handler(rt) and harness.ReadHandler becomes httpapi.ReadHandler, with ReadOptions and Queue. NewHTTPSync becomes httpsync.New and ApplySync moves to httpsync. The handler uses only exported methods, so Runtime gains Health, WorkDir, WorkspaceChanges, Logger, Processes, ProcessLogs, StartProcess, StopProcess, RestartProcess, and ErrProcessNotFound. OpenView fails with ErrInvalidRequest for a name that a Store must refuse.

  • Progress and Advance (harness, protocol) — protocol.Progress is the status, running turn, queued input IDs, open request IDs, goal, and last turn that a log folds to at a seq, as plain JSON that a reader stores with its cursor. harness.Advance(p, event) folds one durable event into it. It is the one incremental fold: State.Apply computes these fields with it, so Describe and a stored Progress agree, and a reader resumes after a stored seq in place of a replay. An event out of order fails with protocol.ErrSeq, and an ephemeral frame or an unknown kind with protocol.ErrUnknownKind. protocol.DurablePayloads lists the payload types.

  • Event schema in protocol (protocol) — the 23 durable event payloads (protocol.SessionCreated to protocol.ToolResultRetained), protocol.Kind*, protocol.EnvelopeVersion, protocol.Payload, and protocol.Event.Payload replace the schema in internal/eventlog, so an embedder decodes a record with the types that the OpenAPI and TypeScript contract now hold. The contract lists the values of each closed enum. The JSON of every record is unchanged.

  • session_sync removed (config, protocol, harness) — the config key session_sync, protocol.Health.SessionSync, and the session_sync=<mode> clause of the engine banner are gone, because no store implements the claimed durability mode. Load rejects a session_sync key as unknown, so a writer of the config drops it with this change. The banner is [engine: harness <version> · engine started <time>].

  • Tool identity (harness) — Tool.Run takes a harness.Call that adds the calling session, the root of its session tree, and the turn to the call. AloneTool and KeyedTool are exported, so a compile-time check proves the method set. Run must return when its context ends.

  • Read surface (harness) — Reader is the read interface of *Session and *View: Snapshot, Messages, Inputs, Blob, and Events. Runtime.Read returns the running Session of an ID or a View of its stored log, and acquires nothing. Session.Withdraw is public. Session.View and View.Session are Snapshot, and Blob is the attachment type. The HTTP handlers map exported methods only.

  • Getenv, Logger, and ReadOptions (harness) — Options.Getenv reads the provider API-key variables, and a nil value reads none, so an embedded runtime picks up no key from its process. Options.Logger receives every log line of the runtime, and nil is slog.Default(). ReadHandler(store, opts) takes ReadOptions{Queue, Logger}, and both handlers log the cause of each error that they mask as internal. Runtime.Commands takes a context. cmd/harness passes os.Getenv and its logger.

  • Error contract (harness, protocol) — each sentinel error is a *protocol.Error, and Error.Is matches an error with the same code, so an error decoded from a body matches the sentinel of its code. protocol.Code types the codes, protocol.CodeOf and protocol.HTTPStatus replace the status table of internal/server, and ErrUnreplayable with the code session_unreplayable (status 500) reports a log that does not replay. harness.New returns a plain wrapped error for a bad Options in place of ErrInvalidRequest.

  • Owner contract (harness) — ErrSessionHeld, which wraps ErrSessionNotOwned, is the error that Owner.Acquire returns for a held session, and CatchUp skips such a session. Ownership.Release takes a context and returns an error, which Session.Release and Runtime.Close return. A nil Lost means never lost. NewLocalOwner(epoch) and NewHTTPSync(spec) are exported. harness.New no longer reads the config keys owner_epoch and sync, and no longer refuses an Owner or Sync beside them; cmd/harness wires them. Options.RunToken without Options.ServeURL fails with a plain error.

  • Close (harness) — Runtime.Close is idempotent: a later call returns the result of the first, and each call returns by the end of its context with context.Cause, also when the context ends during model, plugin, or MCP teardown. When the context of the first call ends, it cancels every run and kills the processes without waiting for a tool that ignores its context; that session keeps its ownership until the tool returns.

  • Session lifetime (harness) — Session.ID, Session.Done, and Session.Err tell every holder of a shared handle when and why the session stopped here. Err is nil before Done and then matches ErrSessionNotOwned and one cause: ErrSessionReleased, ErrSessionEnded, or ErrOwnershipLost; a Store failure or a Sync rejection that stops the session matches ErrSessionNotOwned and that error instead. Open returns the same handle until its Done closes. Session.Events ends with Err.

  • Sessions (harness) — sessions are append-only logs of canonical messages. A session can change provider or model between turns with no history migration. Persisted sessions resume by ID.

  • Providers (internal/provider/...) — Anthropic Messages, OpenAI Responses, any OpenAI-compatible chat-completions endpoint (OpenRouter, Ollama, vLLM), and delegated turns through the Claude Code CLI.

  • CLI (cmd/harness) — harness run for one-shot prompts, -goal for evaluator-checked goals, harness serve for the HTTP+SSE session API, and harness sessions to list saved sessions.

  • Tools — built-in file and shell tools, custom Go tools through Options.Tools, subagents through the task tool, and managed long-running processes (process).

  • Plugins (internal/plugin, sdk/typescript) — a language-neutral process protocol with a published TypeScript SDK.

  • MCP (internal/mcp) — an MCP client with deferred tool loading, and a Streamable HTTP MCP server (mcp.Registry). mcp.CallMeta gives a tool handler the _meta object of its tools/call request.

  • Context management — automatic and manual compaction, project AGENTS.md instructions, and Agent Skills (internal/skill).

  • Context-window refresh (internal/modelmeta) — go generate rewrites the context-window tables from models.dev, and a daily workflow opens a pull request when they change. A new point release is recognized without a hand edit. Session creation still makes no network call.

  • Test model server (harnesstest) — a scripted model server for tests in other modules. NewAnthropic speaks the Anthropic Messages wire; NewChat speaks the OpenAI chat-completions wire, with Reply.Reasoning and Reply.ErrorCode, and fails the test on a request that a real gateway rejects. The Anthropic double also fails the test on a tool_result block that does not follow its tool_use or that repeats one, and Request.CacheBreakpoints lists the cache_control markers of an Anthropic request. Steps match requests in declaration order, Block steps wait for Release, AwaitCanceled observes a client that dropped a blocked request, replies can carry an error message and a Retry-After header, and the server fails the test on an unmatched request or a step that never matched.

  • Session runtime core (harness, protocol) — harness.New returns a Runtime that runs each session as one actor goroutine over a Store. Create, Open, List, and Close manage sessions; Session has View, Submit (idempotent by client input ID), Interrupt, Events (durable events after a seq, then live ones), and Release. An Owner grants each session; Open appends owner.acquired to fence earlier owners, ends a crashed turn and starts the next queued input on the same Open, and resumes a turn that a handoff suspended. OpenView reads a session without owning it. DiskStore fences each append with a flock of the session log, so a stale DiskStore instance on the same root, in any process, gets ErrConflict. storetest.RunInstances takes an opener of instances over one storage and checks that fence across instances. A DiskStore reader takes a shared lock, so it never scans bytes that a failed append cuts again, and a wait for a lock ends with the context of the call. A DiskStore keeps a sparse index of line offsets in memory and reads from the nearest indexed line, so a tail Read does not scan the log from its first line.

  • Session replication (harness, protocol) — Options.Sync receives every record that a Runtime appends, in seq order, as a protocol.SyncBatch. A batch carries the blob of each backend.state record in it. A failed delivery resends the same batch; a SyncAck below the batch makes the sender resend from Head+1 out of its Store. ErrStaleEpoch, or an ErrConflict for records that differ from the receiver's, stops the session without another append and releases its ownership; Session.Release returns the ErrConflict rejection. Session.Release and Runtime.Close return after the last record is acknowledged, and Session.View reports SyncedSeq. ApplySync implements the receiver rules over any Store for an embedder.

  • Events after a cursor (harness) — harness.ReadEvents(ctx, store, id, after) yields the stored events after a seq, through the head it reads first, with no ownership, no append, and no replay. On a log that replays it equals View.Events. A record whose envelope seq differs from its store seq ends the sequence with ErrSeq.

  • Sync from a box (harness, config) — the config keys owner_epoch and sync {url, token_file} make harness.New grant each session at that epoch and post every protocol.SyncBatch to sync.url with the bearer token that it reads from token_file. The receiver contract maps 409 stale_epoch to ErrStaleEpoch, 409 sync_conflict to ErrConflict, 400 invalid_request to ErrInvalidRequest, and any 413, 401, and 403 to ErrSyncRejected; each ends the session, and a 5xx or transport error resends. A batch stays under protocol.MaxSyncBatchBytes (32 MiB), and protocol.CodeStaleEpoch and protocol.CodeSyncConflict name the two 409 codes. Runtime.CatchUp replicates every stored session without opening it: Open of a session that it holds ends its catch-up, Close ends it with ErrDraining, and an unreadable session is skipped and reported. Options.ServeURL and Options.RunToken give a plugin serve_url and run_token.

  • Mid-turn delivery (harness, protocol) — an input with no delivery is steer: a prompt sent while a turn runs joins that turn at its next item boundary, on a model API backend and on Claude Code. A child report joins a running parent the same way on a model API backend, and the model reads it in the [tasks: …] segment of the engine, and not under the OPERATOR MESSAGES heading. The segment is pinned: the model reads it at the same place in each later model call, and no history that a reader sees holds it. A compaction moves a segment that it keeps to the end of the kept history, as the engine did; it moves a segment that it folds to the end of the history, so a tool call stays with its result; and a restart keeps the segment, which the engine lost. On Claude Code a child report to a busy parent is not injected in the middle of the turn: the next turn that starts reads every waiting report. A turn that a prompt starts reads the reports in the segment after the text of the prompt, after a blank line, as the engine did; a turn that only reports start reads the trigger sentence of the engine and then the segment, so the result of a child reaches the model once. The report of a child has the text of the engine: a failed child reads the classified reason, a child that a usage limit or a rate limit stopped adds the guidance not to spawn a replacement, a crashed child reads lost to restart: turn was in flight when the process last stopped, the cause is masked and cut at 500 runes and the recover hint at 120, and a result of at most 4096 bytes stays whole while a larger one shows a 4096-byte preview with a read_tool_result handle. turn.ended carries error_class, recover_hint, and error_detail for that text. The status and log actions of the task tool show the same reason for a failed child. An internal goal input and /compact stay queue.

  • Input provenance (harness, protocol) — protocol.Input takes source_id (at most 128 printable ASCII bytes) and source_label (valid UTF-8, cut at 256 bytes, with control, bidi, and zero-width characters dropped, as the engine did); a bad source_id is invalid_request and leaves no trace, also on a typed slash command. A prompt command keeps the source_id and takes the typed line as source_label, with source command. input.admitted records both, and a repeat that differs in either is input_conflict. A user message of protocol.MessagePage carries source, source_id, and source_label of the input that started its turn, also for an input that the runtime admits itself (parent, child, goal, harness). A user message that joined steer inputs carries operator_batch, one entry of id, text, source, source_id, and source_label for each input.

  • Message time (protocol) — a message of protocol.MessagePage carries created_at, the envelope time of the record that completed it, as the engine stamped CreatedAt. A reader shows it as the time of a message in history and on a live message.

  • Claude Code state chunks (harness) — a Claude Code session saves its state as a chain of backend.state records, not as one blob that grows. Each record carries the head (the CLI session ID, turn, parked call, and transcript path). The transcript entries are appended as chunk blobs of whole entries, at most 4 MiB each (an entry over 4 MiB is a chunk of its own), and each chunk has its own record, so a SyncBatch never carries the whole transcript again and a long session no longer reaches the 32 MiB bound of a batch. A chunk key holds the backend, the fence of the owner, and an index, so a fenced owner never overwrites the chunk of another owner. A save whose entries do not extend the chain, such as a new CLI session, starts a new chain and keeps none of the old entries. A record of the older form (blob_key alone) still reads, as a chain of one blob, and the next save starts a new chain. turn.Sink.State and SaveState take and return a turn.Snapshot of a head and entries.

  • Read-only handler (harness, protocol) — harness.ReadHandler(store, opts) returns an http.Handler for GET /sessions, GET /sessions/{id}, GET /sessions/{id}/inputs, GET /sessions/{id}/messages, GET /sessions/{id}/events (the page, and an SSE stream of the durable events that ends at the head), and GET /sessions/{id}/blobs/{key}. It needs no Runtime and no owner, appends nothing, and starts no turn. Bodies, limits, paging, SSE ids, and error bodies are those of Runtime.Handler for a session that the runtime does not run; a session lists no plugins. A write answers 405 in the error body. opts.Queue is an optional harness.Queue with one method, Queued(ctx, session), for inputs that wait outside the log: its inputs follow the queued inputs of the log in GET /sessions/{id}/inputs and in Session.queued, and a session with no log but with waiting inputs answers GET /sessions/{id}/inputs from the queue alone while the other routes answer session_not_found. A queue error fails only the session, session list, and inputs routes. A nil opts.Queue lists the log only. GET /sessions/{id}/blobs/{key} answers the bytes of an attachment with its media type and its recorded size as Content-Length, on both handlers: a blob part of protocol.MessagePage carries key, and a key that no blob part of an input.admitted of the session names (a backend.state or retained tool result blob included) answers 404 blob_not_found.

  • Spawn and open (harness) — Runtime.Create waits for an Open of the same ID that is in flight and creates the session when that Open finds none, so an Open that races a spawn never fails it with ErrSessionExists. harness run opens a task child only after the log of the child holds a record.

  • Session agent (protocol) — Session.agent is the agent profile name that a task child was spawned with. GET /sessions and GET /sessions/{id} report it. A root session has none.

  • Goal pauses (protocol) — GoalView.pauses is the count of pauses since the last verdict. A verdict resets it to 0.

  • Goal retry budget (harness) — a goal that has paused 6 times since its last verdict (about 31 minutes of backoff) and then fails again on a retryable error or a usage limit ends as failed with reason retries_exhausted, and does not pause again. This restores the retry cap of the engine, which tried 12 times and then parked. The goal stays failed; the session takes any input as usual, and a new goal starts with SetGoal.

  • End a session (harness) — Runtime.End and DELETE /sessions/{id} stop a session that the runtime runs and release its ownership, with no append. A session with a running turn or control command fails with ErrSessionBusy (409 session_busy), and its descendants keep running; a running compaction or evaluation that no command started stops, as Release stops it. A session that is free also stops the turn of each descendant that the runtime runs, and a session that the runtime does not run is not opened for the report of a stopped child. Each such turn ends with cause ended; the parent settles that child with no report input. A child that a direct interrupt stops still reports canceled, and a tree interrupt keeps its rule: it opens the parent and settles with no report input. A session that is busy when End starts keeps each child report. The log stays in the store, and Open runs the session again. An ID with no log fails with ErrSessionNotFound.

  • Warm-up (harness) — a session over the Codex websocket transport opens and warms its connection when it is created or woken, so the first turn chains on the warm response. The first turn waits for a warm-up that is still in flight, and never dials the connection cold. A failed warm-up costs only that speed, and a model that cannot warm costs no tool discovery or hook.

  • Codex backend (harness) — Options.Config configures model providers, and the provider/model ref of CreateSession selects one. An empty model is Config.Model, or config.DefaultModel. A type: openai provider runs turns on the OpenAI Responses API, the ChatGPT Codex lane included, over HTTP or the websocket transport. Options.ModelTransport supplies the HTTP transport of each provider, for each HTTP request and each websocket dial. The transport may supply credentials; native API-key providers then require auth: "injected" on their entry. A model that no configured provider serves fails Create with ErrModelUnavailable, and a ref with no provider fails with ErrInvalidRequest. A retryable model error runs the turn again with backoff, up to stream_max_retries times, when the turn has recorded no item. Runtime.Close closes the pooled websocket connections, also after a timed-out close. A reasoning item replays with its provider data. The model sees the session history from the newest compaction summary on.

  • Model API backends (harness, harnesstest) — a type: openai-compat provider, such as Bifrost, and the anthropic provider with no type run Runtime turns on the chat-completions and Anthropic Messages wires, through the one backend that also runs type: openai. Options.ModelTransport supplies the HTTP transport of each, and may supply credentials. A native API-key provider then requires auth: "injected" on its entry. Each request sends a baseline response cap of 8192 tokens, which a reasoning request can raise. A response with no tool call that the output cap did not cut off ends the turn as completed, as in the Codex CLI, and the turn records the items that the response had; a response with no text and no tool call is neither an error nor a retry. harnesstest.Request.MaxTokens reports the cap that a request sends, on each wire.

  • Embedder tools (harness, protocol) — Options.Tools takes Tool values that the model can call. After a model call that asks for tools, the turn runs each call in order, records its result, and calls the model again, until a call asks for no tool. A tool error, or a call to a tool that the session does not allow, is an error result that the model sees. CreateSession.AllowedTools restricts the tools that the model sees and may call; nil allows every tool. An interrupt stops a running tool, and the call gets an interrupted result. A handoff lets a running tool finish and starts no new tool. ToolCall.ID is the model's call ID.

  • Claude Code backend (harness) — a type: claude-code-cli provider runs each turn of a Runtime session as one --resume run of the Claude Code CLI over stream-json. The CLI runs its own tools and compacts its own context. Its messages are recorded as items, its compaction as compaction.applied with by_backend, and its usage and context window as turn usage and context.measured. The result frame of each turn gives the context gauge, which is the prompt size of the newest call of the main thread, or the usage of the frame when no call carried usage, and its total_cost_usd, which adds to session_cost_usd of subscription_usage. A turn whose CLI fails, with an error result frame or with no result, runs the CLI once, with no stream_max_retries run, and its error keeps its retryable class, so a goal pauses on it. A result frame sets the reading also when it carries no prompt tokens; a compact_boundary with positive post_tokens sets it until a later main-thread assistant frame reports usage. A steer input reaches the CLI on stdin while a tool runs. Session.Interrupt and a handoff send SIGINT to the process group of the CLI. Every item that the CLI wrote before it exits is recorded, and a tool call with no result gets an interrupted result, or a cut-off result before turn.suspended on a handoff. A stopped turn whose CLI still writes a success result completes. A stopped turn whose CLI exits with no result ends with the stop, never as a retryable failure. A turn that resumes after a handoff sends a fixed continuation message instead of its input when the resumed CLI session already holds that input. The message says that the previous turn was interrupted, and names no cause. The external session ID is saved in backend.state records, and with session_mirror: true the state also holds the transcript that --session-mirror reports, so a session opened on another runtime resumes it. A mirrored session with no saved transcript starts a new CLI session. Embedder tools reach the CLI through a loopback MCP server named harness that each turn serves while it runs, given to the CLI with --mcp-config and allowed with --allowedTools mcp__harness. A call runs Tool.Run with the CLI tool use ID as ToolCall.ID, and a call with no tool use ID is an error result. Items record the call by the embedder tool name. A call that an interrupt or a handoff stops gets no reply, so it gets an interrupted or cut-off result. CreateSession.AllowedTools names built-in tools of the CLI and embedder tools. The built-in names map to --tools with --strict-mcp-config, and the MCP server offers only the allowed embedder tools and the allowed tools of Config.MCPServers. An unrestricted session gives each server of Config.MCPServers to the CLI in the same --mcp-config file, by its config name, as the engine does: a stdio server as command, args, and env, an HTTP server as type: http, url, and headers. The CLI connects them itself, the runtime does not, and --strict-mcp-config hides every other MCP config of the CLI. Any other name fails Create with ErrInvalidRequest, and so does an embedder tool with the name of a built-in tool of the CLI. An init frame that shows another tool fails the turn. The runtime records a tool call when its frame arrives, so a running tool shows in View.Messages and the event stream before its result. The parallel calls of one response are separate items in wire order, where the engine grouped them in one journal message.

  • Live frames (harness, protocol) — Session.Events also yields the ephemeral frames of a running turn to a live reader: item.started and item.delta (protocol.ItemFrame) for the text and reasoning deltas of the Codex backend, and status (protocol.StatusFrame) while a turn waits to retry. The Claude Code backend sends the text and reasoning deltas as the CLI streams them (--include-partial-messages), and the whole block as one delta when the CLI streams none. An item that a failed attempt started never completes, and the next attempt starts a new item. When the Claude Code CLI drops a reply and retries it, the backend sends an item.discarded frame (protocol.ItemFrame, with the item_id of the dropped item) before the first delta of the retried reply, and a client removes that live item. The store never holds them. Each frame has Ephemeral set and the last durable seq, and its item_id is the item_id of the item.completed record that ends the item. A reader that resumes after a seq gets the durable events of the gap, then live frames. A slow reader can miss any frame, never a durable event, so the deltas of an item can have holes; its item.completed holds the whole item. View.Events yields durable events only.

  • Compaction status frames (harness, protocol) — a compaction that runs between turns, automatic or from Compact, sends an ephemeral status frame with compacting when it starts, then idle when the summary is appended or compaction_failed when it is not, as the engine did. The frames carry the compaction ID in turn_id, and the session stays idle while the compaction runs. A Claude Code turn sends compacting when the CLI reports that it compacts, then running when the summary is appended, or compaction_failed when the CLI reports a failed compact result or ends the turn with the compaction unsettled.

  • Model list (harness, internal/modelmeta, protocol) — Runtime.Models returns the models that the configured providers serve, sorted by ID, each with its provider and context window (0 when the backend reports it during a turn, as Claude Code does). It does no I/O. modelmeta.Models lists the models of a provider: the ChatGPT subscription models for codex and the CLI aliases for claude-code. Other providers list no models.

  • Session settings (harness, protocol) — Session.Update takes a protocol.SettingsPatch that changes the model, the effort, or the service tier, appends settings.changed for the values that differ, and returns the view. A running turn uses the new settings from its next model call. A model that no configured provider serves, or that modelmeta does not know, fails with ErrModelUnavailable, and an unknown effort with ErrInvalidRequest. A session can move between Responses providers, such as codex and openai, and the next provider gets the whole history. A turn that a handoff resumes uses the settings at its resume. A backend that has no service tier ignores it.

  • HTTP API (harness, protocol) — Runtime.Handler serves the session API over HTTP: POST /sessions, GET /sessions?after=&limit=, GET and PATCH /sessions/{id}, POST /sessions/{id}/inputs, POST /sessions/{id}/interrupt, GET /sessions/{id}/events, GET /models, and GET /health. A route that names a session opens it through Runtime.Open. A new input answers 201 and a repeat of its ID answers 200 with the original receipt; Session.Admit is Submit with that verdict. An Accept header selects SSE only when it lists text/event-stream with a quality above 0. GET /sessions/{id}/events?after=&limit= returns a protocol.EventPage of durable events; with Accept: text/event-stream it streams the durable events after after, or after Last-Event-ID when it is set, then the live ones with the ephemeral frames between them. A durable frame carries its seq as the SSE id, and an ephemeral frame has no id. An error is a protocol.ErrorBody with a code from the protocol.Code constants, mapped from the sentinel errors; an unmapped error is internal with a fixed message, and a path or method that no route serves answers 404 or 405 with invalid_request. A body above 8 MiB fails with payload_too_large. GET /sessions/{id}/inputs returns the queued input IDs without opening the session, and DELETE /sessions/{id}/inputs/{input} opens it, withdraws the input when it is still queued, and answers 204 either way. The handler has no authentication; the embedder wraps it.

  • Runtime compaction (harness, protocol) — Session.Compact and POST /sessions/{id}/compact fold the turns before the newest compaction_keep_turns (default 2) into a summary that the session model writes with the compaction prompt of the engine, and append compaction.applied with by_backend: false. The next model call reads the summary first. A session with too few turns appends nothing. A Claude Code session runs /compact as a turn of the CLI, which logs compaction.applied with by_backend: true. Session.Compact and the route take keep_turns, which replaces compaction_keep_turns for one call; below 1, or for a Claude Code session, it is invalid_request. Compact returns when the compaction ends, and fails with ErrSessionBusy (session_busy, 409) while a turn runs or inputs wait. Before a queued input starts a turn, a session whose newest context.measured reading is at or above compaction_threshold (default 0.8) of its window compacts first. A failed summary appends nothing, and the turn starts on the full history. A handoff stops a running compaction, and the next owner runs the input that waited for it. Open starts the next queued input when no turn is open. The Codex backend records the prompt size of each model call that reports prompt tokens, and the model window, as context.measured. A compaction_threshold or compaction_keep_turns at or below 0 is the default.

  • System prompt (harness) — Options.WorkDir names the directory of a coding agent. Each session reads its system prompt once, when it is created or opened: the base prompt, append_system_prompt, the AGENTS.md chain from the git root down to WorkDir cut at instructions_max_bytes (default 64 KiB; a negative value keeps the whole file) with a marker, and the skill list. A file that cannot be used is skipped with a WARN log line. With no WorkDir, the prompt is append_system_prompt alone and no file is read. The log never holds the prompt. A Claude Code session gets append_system_prompt as one --append-system-prompt value, and the CLI runs in WorkDir.

  • Processes (harness) — with Options.WorkDir, the runtime runs Config.Processes through the process tool: start, stop, restart, status, logs, list, declare, and undeclare. Each turn sends a status line inside <harness-engine-context> tags after the system prompt that names each started process, its state, its ports, the instant of its last change, and its log path. Runtime.Close stops every process, also when its ctx ends first. When its ctx ends first, Close cancels the turns and waits for them to end before it returns, as the engine Drain does. With no WorkDir, no process runs and the model sees no process tool. declare runs any argv, so a WorkDir grants command execution.

  • Box routes (harness, protocol) — Runtime.Handler serves the process manager of the WorkDir: GET /processes, POST /processes/{name}/start, stop, and restart, and GET /processes/{name}/logs?tail=. An unknown process is process_not_found (404). After Runtime.Close starts, a start, stop, or restart fails with draining (503), and Close waits for one that runs. With a WorkDir, GET /workspace/changes?scope=&dir= returns the git diff of the work tree as a protocol.WorkspaceChanges, by the rules of GET /git/changes, with the errors not_a_repo, no_base, and too_many_changes (409).

  • Slash commands (harness, protocol) — Session.Admit resolves a typed input (source: typed) as a slash command by the rules of harness serve. A control command records command.recorded with accepted, runs through the Go API after Admit returns, and records succeeded, failed, refused, or interrupted; a panic of the operation records failed. /compact [keep_turns] passes keep_turns, and its result is the from_seq and to_seq of the compaction, or by_backend: true; bad arguments fail at once, and a frontend command is unsupported. A command that needs an idle session is refused while a turn runs. The receipt carries the status in command, and a repeat of the input ID returns it. Open records interrupted for a command that an earlier owner never finished. An unknown name is text, //x is /x, and a prompt command under commands_dirs is its expanded text with source command. Runtime.Commands and GET /commands return the menu with serve_support.

  • MCP tools (harness) — a Runtime session gets the tools of Config.MCPServers as mcp__<server>__<tool>. The first model call of a turn that the runtime serves the MCP tools for connects every server once for each runtime; an unrestricted Claude Code turn connects none, because the CLI does. A server that fails stays down until the model calls mcp(action="connect"). With mcp_tool_loading lazy, or auto with tool schemas over mcp_schema_bytes, or a server tool_loading of lazy, the system prompt lists the deferred tools, and the model loads one with mcp(action="select") or finds one with mcp(action="search"). A loaded tool is callable on the next request of the turn, and a call of a deferred tool runs it. The history decides which tools are loaded, so a replay loads the same tools. The instructions of the servers that the first connect reached join the system prompt in <mcp_instructions>. A server that serves resources adds list_mcp_resources and read_mcp_resource. An image, audio item, or binary resource of a result is a blob for the model, and an error that is not the server's own RPC error never names the endpoint URL or a response body. Runtime.Close closes every connection. With mcp_servers, an embedder tool with an MCP tool name fails New. The base prompt of a Runtime session says that the harness appends the process status to the system prompt.

  • Model call recovery (harness) — a Runtime session recovers from a failed model call by its class. A context overflow compacts the session while the turn runs and calls the model again; when no turn can fold, the turn fails. A provider usage limit, such as a spent quota, ends the turn failed with cause provider_exhausted. A model call that reports no wire activity for stream_idle_timeout_s (default 300; a negative value turns it off) stops and runs again as a retryable error; tool arguments that still stream count as activity. A response cut off at max_tokens is retried like a truncated stream (see Changed). Any other error fails the turn. A Claude Code session has no stall limit.

  • Goals (harness, protocol) — Session.SetGoal and Session.ClearGoal, and PUT and DELETE /sessions/{id}/goal, run a Runtime session goal as Claude Code /goal does. On a session with no running turn and no queued input, the condition is the input of the first turn, with source: goal; otherwise the next turn that ends is the first one judged. SetGoal needs goal_evaluator_model. After each turn that completes or is interrupted while the goal stays active, that model judges the history; a reply that starts with markdown marks still counts,. The verdict: met achieves the goal, impossible fails it, and not_met admits its guidance as the next input until max_turns (0 is unlimited) exhausts the goal. A retryable error or a usage limit pauses the goal, which runs again after a backoff from 30 s to 30 min, or at the next input; any other error fails it. A verdict, a pause, or a failure withdraws the queued goal input. ClearGoal stops a goal turn with cause goal_cleared. An interrupt while the goal is active ends the goal, during a goal turn, a judgment, or a compaction: the goal becomes cleared with reason interrupted, its queued input is withdrawn, and no goal turn starts. The engine left the goal active after an abort, and the runtime has no parked goal. A goal has one retry timer, and any change of the goal stops it. ClearGoal starts an input that a paused goal left queued. Open judges the last turn of an active goal and keeps the retry time of a paused goal. protocol.Session.Goal reports the condition, state, judged turns, reason, and retry time. There is no deferred goal.

  • Plugins (harness) — a Runtime session gets the tools and hooks of Config.Plugins. The first Create or Open of a runtime reads the manifest of each plugin with one probe, bounded at 30 s. A probe that fails, a manifest of another name, or a plugin tool with the name of another tool or of a built-in tool of the model backend fails that call, and the next call tries again; a call after Close returns ErrDraining. A plugin process starts on its first hook or tool call. tool.execute.before can rewrite or deny each tool call, and tool.execute.after can rewrite its result, also for a call that a backend that owns the loop makes. The system.transform segments of each model call, which get the model of the call, follow the MCP segment. The event hook gets session.status and session.error from the appended turn records, tool.execute.start and tool.execute.end around each call that runs, and file.edited, with an absolute path, after a write_file or edit_file call that succeeds. client/session.messages reads the session from the store, with each attachment as a blob part and its bytes. The runtime does not dispatch chat.params, chat.message, or shell.env, and fails client/mcp.call. Runtime.Close stops every plugin process.

  • Config rules (config) — Config.Validate is the one rule set for a hand-built or loaded Config, and never changes it. Defaults returns the built-in value of every defaulted key. Config.ApplyEnv sets each top-level string, number, or bool key from a non-empty HARNESS_<KEY> variable, and a parse error names the variable but not the value. ProcessSpec.Validate is the process entry rule that process.Declare also uses. The package imports only the standard library.

  • Built-in tools (harness) — with Options.WorkDir, each Runtime session of the harness loop gets the built-in tools of the engine, with their behavior, limits, and text: read_file, write_file, edit_file, glob, grep, ls, bash, and read_tool_result. An embedder or plugin tool with one of these names fails. Each session has its own write_file guard. session_info takes no argument and reports the session, the system prompt and the tools that its newest model call sent, the instructions files and skills that the session read when it started, and the plugin inventory to the model. read_file, edit_file, and the write_file guard fail on a file above 20 MiB. A tool result above 16384 bytes has its secrets masked, goes to a blob, and the history holds a preview with a trh_N handle that read_tool_result reads back; a tool_result.retained record names the blob, and Sync carries the blob. A result that would take the session above 4 MiB of retained results keeps only its preview. The runtime does not read tool_result_inline_bytes or tool_result_retained_bytes. Retention runs after the plugin hooks. Each compaction summary ends with an index of the newest retained results. read_file reads an image as a summary line and the image. A backend that owns the loop, such as Claude Code, gets none of these tools. With no WorkDir, a session has none of them except session_info.

  • Documentation — package docs on pkg.go.dev and runnable programs in examples/.

  • Children (harness, config) — with a WorkDir, each Runtime session has a task tool, {agent, prompt}, that starts a child session in the background and returns its ID at once. The child is a session with parent_id; its first turn runs the prompt. When a turn of the child ends, the parent records child.settled and gets a report input with source: child: the outcome (done, failed, or canceled), the error, and the last assistant text of the child. A parent that opens after a crash settles each child that ended and opens each child that did not. Agent profiles load from <workdir>/.agents/*.md in the agent format of Claude Code (name, description, tools, model, and a prompt body) beside the built-in general-purpose, explore, and plan, and set the allowed tools, model, and prompt of the child. explore and plan allow only the read-only file tools. max_task_depth (default 3) and max_concurrent_tasks (default 20) bound each session tree.

  • Goal tool (harness) — with goal_evaluator_model, each Runtime session that is not a child has the goal tool of the engine: status reports whether a goal is active and its condition, set starts a goal with no turn limit and fails while one is active; the condition runs as a turn of its own after the current turn, and the goal judges the turns after it, and adjust replaces the condition of the active goal and keeps its turn count and max_turns. A turn of a backend that owns its loop, such as Claude Code, gets no goal tool. There is no clear action. goal.set gains turns.

  • Task actions and tree interrupt (harness, config, protocol) — the task tool takes the engine actions cancel, status, send, and log on a session_id that the caller spawned, directly or transitively; action defaults to spawn. send runs a settled child again, and the child reports the new turn. cancel withdraws the queued inputs of the target and its descendants and stops their turns. protocol.Interrupt.Tree and POST /sessions/{id}/interrupt {"tree": true} also withdraw the queued inputs and stop the turn of each descendant, which settles canceled with no report input. max_tree_tokens (HARNESS_MAX_TREE_TOKENS; default 0, no limit) stops a spawn once a session tree has used that many tokens.

  • Steering for every backend (harness) — a steer input, and a send of the task tool, joins a running Runtime turn of a model API backend (Codex, Anthropic, Bifrost) at the next item boundary: after the tool results of a response, before the next model call. The model reads the inputs that join together as one OPERATOR MESSAGES (address these, then continue the task): message with a numbered list, as the engine writes its injected prompts. A response that ends the turn at its max_tokens stop takes no steer input, so that input runs as the next turn. A queue input still waits for the next turn.

  • Session telemetry (harness, protocol) — protocol.Session has context (tokens, window), last_turn (turn_id, stop_reason, error), compaction_count, and subscription_usage, the newest subscription limit snapshot of the Codex and Claude Code lanes (provider, plan, windows, overage, captured_at). usage sums every model call of the session, the summary calls included and the goal evaluator calls not, as in the engine. Each model call that measures anything records one context.measured record with its usage, and a summary call adds usage to its compaction.applied record, so a handoff, a crash, and a restart keep the usage. turn.ended has no usage. The actor masks and bounds the error text of a failed turn and of a goal stop (turn.ended error, goal.changed reason) as the engine did: recognized credential shapes redacted (best effort: a free-form text can hold a shape that the fixed patterns miss), and a text longer than 256 runes keeps its first 256 runes and ends with ...[truncated].

  • Compaction result (harness, protocol) — Session.Compact returns a protocol.Compacted with from_seq, to_seq, by_backend, and folded, and POST /sessions/{id}/compact answers 200 with it. folded is false when the session has too few turns.

  • Engine banner (harness) — with Options.Version, each model call of a harness-loop turn sends the status line [engine: harness <version> · engine started <time>] as engine context, as harness serve does. The first request of a session pins it after the newest message of the history, and each later request keeps it there until a compaction applies, which moves it to the end of the history that it leaves, so a kept tool call stays paired with its result. A turn of a backend that owns its loop, such as Claude Code, gets none. Empty: no banner.

  • Crash marker (harness) — Open ends a crashed turn with the assistant item [harness: this turn was interrupted by a process restart and could not complete] before turn.ended, as the engine did, so the next user message no longer joins the crashed one on the wire.

  • MCP connect reasons (harness) — mcp(action="connect") names the class of a failed connect, as the engine did: initialize timed out, initialize cancelled, connection refused, connection failed, or initialize failed. It never names the endpoint URL or a response body.

  • MCP retry, down notice, and status (harness) — an MCP server that fails its first connect retries in the background, as the engine did: the first wait is about 1 s, it doubles for each failure, and half of it is random. After 3 failed retries the server is parked until mcp(action="connect") connects it. While a server is down, the model reads [mcp: unavailable — <server> (<reason>; retrying). Tools from these servers are temporarily absent and may return later in this session.], and a parked server reads use the mcp tool action "connect" to retry. The notice is a message of the conversation, in <harness-engine-context> tags, pinned at the first model call that sees a new text and kept at that place by each later call until a compaction moves it to the end of the history, so the system prompt never changes and a kept tool call stays paired with its result. The tools of a server that connects appear at the next model call, and the last server to connect adds [mcp: every configured server is connected again.] the same way. mcp(action="status") reports {name, connected, attempts, parked, reason} for every configured server.

  • MCP prompt bounds and compaction guards (harness) — the MCP prompt segment is bounded as the engine bounded it: the instructions of one server are cut at 4000 runes with … [truncated], its tool names stop before 2048 bytes with names truncated at byte budget, and the deferred catalog lists the first 200 tools and ends with ... and N more tools; use mcp(action="search", query="...") to find them. Automatic compaction estimates the context from the history (1 token for each 4 bytes, 1600 for each image) when a turn has ended and the newest turn recorded no reading, and after an automatic compaction applies, or its summary comes back empty, it waits until the context falls below the threshold once before it runs again; a model change that moves the window ends the wait.

  • Plugin inventory (harness, protocol) — protocol.Session.Plugins lists each configured plugin of the runtime with its name, its state (not-spawned, running, or errored), its tool names, and its hook names, as the harness serve session view did. Session.View and Runtime.List read the state live; a session log does not hold it.

  • Model tool (harness) — with a WorkDir, each session has the model tool, as the engine had it: status, list, and set, with a billing of subscription or api for each provider. The providers are the available registry: credentialed native anthropic and openai entries, subscription entries within the host limits, and configured entries. Native API-key entries without credentials are absent. set calls Session.Update. A backend that owns its loop gets list alone. model_tool: false turns it off, and New reads the key again.

  • Model and effort of task spawn (harness) — a spawn takes model (a provider/model ref that a provider of the registry serves) and effort, and checks both before it starts the child. A child with no effort has the provider default, as the engine did, and no longer takes the effort of its parent.

  • Subagent frames (harness) — a Claude Code session runs the CLI with --forward-subagent-text, as the engine did, and records the text, the tool calls, and the tool results of a subagent as items. eventlog.Message.ParentCallID (parent_call_id in the log) names the tool call that started the subagent, and is empty for an item of the session itself, so a client can nest the subagent work under its call. The model never reads it, and the wire order of the main thread and a subagent thread stays.

  • History bridge (harness) — a session can move between Claude Code and a model API in either direction. A turn of a backend that owns its loop, such as Claude Code, gets the tool get_conversation_history, which reads the live history of the session page by page (offset, limit) as the engine tool did, and which no allow list hides. When the history holds a message that another provider recorded after the last turn of this one, the turn adds one line to --append-system-prompt that tells the CLI to call that tool before it answers. The next turn of the same provider adds none. A turn belongs to the provider of its model at its start, so a model change in the middle of a turn loses no history, and a turn that recorded no item, such as one whose CLI never started, shows its backend nothing. eventlog.State.Foreign derives that from the log; nothing is stored. A turn that is running moves to a model of another kind of backend at its next turn, not at its next model call.

  • Questions (harness, protocol) — with Options.AskUserQuestion, a Claude Code turn may ask the user an AskUserQuestion question, as harness serve -ask-user-question did. The CLI runs with --permission-prompt-tool stdio and a hook that defers the call, EnterPlanMode and ExitPlanMode are off, and the turn ends awaiting_input after a request.opened record (kind question, the call ID as the request ID, and the tool input as the payload). The session reads waiting. Session.Resolve and POST /sessions/{id}/requests/{request} take {answer} or {dismiss: true}; a question takes a map of each question to the chosen label or free text. An answer appends request.resolved and runs a turn with no input, which resumes the CLI and answers the call over the control channel. The call stays open until that turn records the result of the CLI for it; a turn that records none gives the call a cut-off result. A question takes only a non-empty map of text, and any other answer fails with ErrInvalidRequest. A dismissal runs no turn. An input that is admitted, or queued before the question, dismisses it first: the next run of the backend then denies the parked call in a run of its own, with an interrupt, before the prompt. A request that is not open fails with ErrRequestNotPending (request_not_pending, 409). A child session and a session with an active goal never ask. A request that nothing resolves keeps the session waiting; a crash dismisses it.

  • Tool-result images (harness, protocol) — a tool result can carry blobs: protocol.ToolResult has Blobs, each a media type and its bytes. read_file of an image and an MCP result with image, audio, or resource-blob content return them, as the engine did, so the model sees the image. A turn stores each blob with Store.PutBlob under toolblob-<sha256> before it appends the item.completed whose tool_result part holds blobs (media_type, blob_key, bytes). Sync carries the blobs of that record, a replay or Open sends the same image, retention counts the text only, and GET /sessions/{id}/blobs/{key} still serves attachments only. When the Store lacks the bytes of a blob, the model API backend logs a WARN and sends the text of the result without the image, so one lost blob does not fail every later turn.

  • Prompt attachments (harness, protocol) — an input can hold a blob part, {type: "blob", media_type, data}, as the engine took: a png, jpeg, gif, webp, or pdf of at most 20 MiB whose bytes are the type that it claims. The runtime stores the bytes with Store.PutBlob, and input.admitted holds a blob part with media_type, blob_key, and bytes. Sync carries the blob in the batch of its record. modelapi sends it to the model, and claudecode sends an image or document content block. The inputs route takes a body of 32 MiB, and every other route 8 MiB.

  • Agent profile dirs (harness) — agent_defs_dirs selects the dirs of the agent profiles of a Runtime. A relative path joins WorkDir, and the default is <WorkDir>/.agents.

  • Engine parity of the runtime (harness, protocol) — Runtime.List and GET /sessions list in creation order, and after is the ID of the last session of the page before it; an after that names no session fails with invalid_request. POST /sessions/{id}/requests/{request} replies 202 {seq, status} for an answer, and Session.Resolve returns a protocol.Resolved. The [continuation: …] message of a max_tokens turn is in <harness-engine-context> tags. A settings change to a model of another kind of backend fails the running turn at its next model call. A name that two agent definition files repeat, in one directory or across agent_defs_dirs, fails the spawn and names both files.

  • Model call log lines (harness, cmd/harness) — a Runtime writes one turn_metrics line through slog for each completed model call, and one startup_prewarm line for each state of a Codex warm-up, with the keys of the engine. turn_metrics has session_id, model, purpose, ttft_ms, stream_ms, input_tokens, output_tokens, cache_read_tokens, cache_write_tokens, system_len, tools_count, and retry; purpose names turn, compaction, judge, title, or generate. Generated calls have no session, so session_id is empty. One-shot judge, title, compaction, and plugin generate calls now emit turn_metrics lines. request_mode and its item counts, service_tier, effort, and the chain_refusal keys appear only when they apply. startup_prewarm has session_id, status (started, ready, consumed, stale, failed, timed_out, or cancelled), duration_ms, and age_ms. harness run makes its JSON logger the default logger, so these lines are JSON on stderr there as on harness serve.

Changed

  • Model names, descriptions, and efforts (internal/modelmeta, protocol, internal/acp) — protocol.Model has the optional fields provider_name, name, description, and efforts, which Runtime.Models and GET /models fill from models.dev. The list holds no deprecated model and no model without tool calls, though a configured model of this kind keeps its context window and runs. The list is in the order of the provider name, then newest first. The codex list holds the models that the ChatGPT backend serves now, and the context-window tables follow the current models.dev catalog. The ACP model option groups its values by provider, shows the model name with the reference and the first sentence of the description, and the effort option offers Default and the levels of the current model. A model that the list does not hold offers every level. A change of the model sends the effort list again.
  • Breaking: no built-in openrouter provider (config, internal/backend) — Harness has native candidates anthropic, openai, codex, and claude-code; API-key entries need credentials to become available. A model ref openrouter/... fails with model_unavailable until the config has a providers.openrouter entry with type openai-compat and base_url https://openrouter.ai/api/v1. Set api_key_env (for example OPENROUTER_API_KEY) unless the transport supplies credentials; a missing key fails at the first model call. An entry that names only api_key_env or extra_headers under a key other than anthropic and openai fails config validation. config.Config.ResolvedProviders is removed.
  • Not-a-repository error code (internal/server, protocol) — GET /workspace/changes answers not_a_repo (409) for a directory outside a repository. not_a_git_repo stays in the code enum, protocol.HTTPStatus, and the spec as a deprecated name that the server never sends.
  • Examples report a failed turn (examples) — prompt, custom-tool, switch-model, and guardrail call Turn.Wait after the event stream and exit 1 with the turn error when the turn fails. switch-model printed empty replies and exited 0 when a turn failed, for example with no API key.
  • Session takeover error (harness, cmd/harness) — a run that another process fenced by opening the same session now fails with harness: session not owned: another process took over session <id> in place of the append-conflict text, and still matches ErrOwnershipLost, ErrSessionNotOwned, and ErrConflict. cmd/harness prints the prefix harness: once, so an error that starts with it no longer shows harness: harness:.
  • CLI help (cmd/harness) — -h and --help on every command, and help at the top level and after plugin, print the usage to stdout and exit 0, with no flag: help requested line. A flag error, an unknown command, and a positional argument that a command does not take (for example harness serve help, which started the server) print the usage to stderr and exit 2. A bare plugin, an unknown plugin subcommand, and a flag error on run, serve, sessions, and plugin probe exited 1 and now exit 2. The top-level usage names harness <command> -h.
  • Breaking: run -c scope (cmd/harness, harness, protocol) — harness run -c continues the newest root session that was created in the current directory, where it continued the newest session of every directory. It fails with no sessions to continue in <dir> when the directory has none. A runtime with a WorkDir records it as the new work_dir field of session.created, and protocol.Session carries it; a session created before this field exists has none and -c never chooses it.
  • Claude Code steer (claudecode) — a steer input that arrives while the CLI streams a text-only reply is no longer lost, except when a tool result that the CLI wrote before it read the steer line counts as delivery; the CLI then runs the input as a next turn that the backend does not record. The backend writes a steer input to stdin only while a tool call waits for its result, as the CLI takes a queued message at the next tool result; at any other time the input stays queued, and it is delivered when a tool call starts in the same turn or else the next turn carries it. When the CLI still runs a written steer input as a second turn after its result, the backend reads on to the second result and records it in the same turn, in place of closing stdin and killing the CLI. The second result adds only the cost that the first did not report, and a CLI that exits before it answers the steer input fails the turn.
  • Breaking: TypeScript ctx.generate result (sdk/typescript) — ctx.generate resolves with {message, usage}, where it resolved with the message alone. A plugin that reads the text of the reply reads result.message now.
  • Session tools package (internal/selftool) — the goal, model, and session_info tools move out of the root package into internal/selftool, which reaches the runtime through its own Sessions interface. The tool names, schemas, descriptions, and results do not change, and the public API does not change.
  • Missing API key error (internal/backend, internal/provider) — a native API-key provider without credentials fails admission with model_unavailable before a turn starts; the error names its missing key variable. A custom user-config provider without credentials fails its first model call with the reason: Options.Getenv is nil, so <api_key_env> is unread, <api_key_env> is empty, or the providers entry sets no api_key_env.
  • Typed enums (protocol) — protocol.Status, Delivery, StopReason, Cause, ErrorClass, ResolutionKind, GoalState, Verdict, and Outcome replace bare strings in Session, LastTurn, GoalView, Input, QueuedInput, and StatusFrame. protocol.StatusIdle and the other status and delivery constants are typed, so a string assignment from one of them no longer compiles. The JSON is unchanged.
  • Retry budgets and incomplete reasons match Codex (config, internal/provider, internal/backend/modelapi, internal/turn, harness, harnesstest) — the config key prompt_retries is gone, and a config that sets it fails to load (the variable HARNESS_PROMPT_RETRIES is ignored). Two keys replace it, as in the Codex CLI. request_max_retries (default 4; HARNESS_REQUEST_MAX_RETRIES) sends a model request again after a 5xx status or a transport error, and not after a 429 or a 5xx with a Retry-After header. stream_max_retries (default 5, was 2; HARNESS_STREAM_MAX_RETRIES) calls the model again after a retryable error of a call that recorded no item: a 429 with a Retry-After header (a 429 without one fails the turn), a 5xx that outlasted the request retries, a transport error, a truncated stream, a content filter. Both are at most 100. A compaction summary and a goal evaluation retry the same way. A wait is the Retry-After of the provider, else 200 ms that doubles with each retry, with up to 10% jitter (it was 1 s that doubled up to 8 s). A transport error is now retryable with error_class connection_failed. A Responses response.incomplete event with the reason content_filter, the Anthropic stop reason refusal, and the chat-completions finish reason content_filter fail the call as the retryable class content_filter. A response.incomplete event with any other reason except interrupted, or with none, fails the call as stream_truncated; it ended the turn as complete before. harnesstest adds Reply.Hangup, CodexReply.Incomplete, and HTTPStatus and Hangup replies on the Responses server.
  • Response cut off at max_tokens (internal/backend/modelapi, internal/turn, config, harness) — a model response that the output cap cut off is an incomplete response, as in the Codex CLI, not a step that continues. It records no item and runs no tool call, and the call fails as a retryable stream_truncated error: the turn waits, calls the model again on the same history, up to stream_max_retries times, and then fails with error_class stream_truncated (a goal pauses on it). The model is never asked to continue. The config key max_tokens_continuations and config.Config.MaxTokensContinuationsValue are gone, and a config that sets the key fails to load (the variable HARNESS_MAX_TOKENS_CONTINUATIONS is ignored). A compaction summary and a goal evaluation still take a cut-off response as their answer.
  • Events stream reader and test double names (protocol, harnesstest) — protocol.DecodeSSE reads an events stream as iter.Seq2[Event, error]; an error frame yields a *protocol.Error, which now implements error. harnesstest.New is NewAnthropic, and RateLimits.BengalfoxPrimary is RateLimits.Extra, a map of window by limit name.
  • Store name and record checks (harness, protocol) — harness.CheckName and harness.CheckRecords are the rules that every Store applies to a session ID, a blob key, and a record; MemStore and DiskStore call them, and an invalid name now fails with harness: invalid name "<name>". protocol.Resolution.Validate reports a resolution that holds both an answer and a dismissal, or neither, or an answer that is not valid JSON; null, {}, and "" count as no answer.
  • Config API (config, harness, cmd/harness) — config.LoadProject takes the user config path, so the package reads no environment variable; cmd/harness resolves $HARNESS_CONFIG. Path, LoadProjectWithInfo, LoadInfo, EnsureProviderDefaults, and the three ...Values functions leave the public API; Config.ResolvedProviders replaces EnsureProviderDefaults. max_tokens (HARNESS_MAX_TOKENS, harness run -max-tokens) replaces Options.MaxTokens, and a negative value fails Validate.
  • Serve reports the bound address (cmd/harness) — harness serve binds -addr before it builds the runtime, and takes Options.ServeURL (the plugin serve_url), the addr field of the serve start log line, and the unauthenticated warning from the bound listener address. -addr 127.0.0.1:0 serves on a free port, and a caller reads the port from the addr field of the serve start line, for example {"level":"INFO","msg":"serve start","addr":"127.0.0.1:41873","version":"..."}.
  • Small engine points (internal/session, internal/prompt, internal/skill) — the transcript that the goal evaluator reads shows a reasoning part as [reasoning] <text> and a blob part as [blob <media type>], ends a part over 4096 bytes with …[truncated], and opens with the engine omission notice when it leaves out earlier messages. An agent profile with an unknown key and another error fails the load with the other error, as the engine did, and a profile with an unknown key alone is still skipped. A prompt command with an unknown key and another error still lists the unknown key as its reason. An interrupt of the first turn while it waits for the Codex warm-up cancels the warm-up, which logs startup_prewarm with status cancelled.
  • Engine text of children, goals, and agent profiles (harness, internal/session, internal/tree, internal/prompt, internal/backend/claudecode) — a child report to an idle parent starts its turn with the trigger sentence of the engine and the pinned [tasks: …] segment, and the history holds the sentence alone. The task tool answers a spawn with the engine note, refuses an unknown agent as unknown agent "x" (available: …), and refuses a spawn past max_concurrent_tasks or max_tree_tokens with engine: tree concurrency limit reached and engine: task tree token budget exceeded. A session at max_task_depth has no task tool. The goal evaluator reads a tool call as [tool call <name>] <arguments> and a result as [tool result] <text>, the goal tool refuses with the engine wording, and an adjust while the condition of a set still waits replaces it, so the turn of its own runs the adjusted condition. An agent profile file with no name or no description fails the load and the error names the file; a file with an unknown key is still skipped. A Claude Code result with no turns and no text ends the turn when the run already recorded an assistant item, with the usage of that result, as the engine ended it.
  • Cancel reports its canceled descendants (internal/tree, internal/session) — cancel of the task tool settles each canceled descendant of the target in its own parent with no report input, and reports it to the nearest ancestor of the target that is not terminal, as the engine did: the parent of the target when that parent works, else the session that called cancel. The report of the target goes to that ancestor too, chosen when the report is delivered, so a target whose parent is done reports to the session that called cancel. A parent that opens while that report is delivered leaves the target to that delivery, so the report reaches one session. The turn.ended of a turn that cancel stops carries task_cancel (cause stays stopped), so after a crash the parent that opens routes the report again to the nearest live ancestor, else the root, in either opening order, relays it when that is not the parent, and settles with no report input. A relay is kept once for each child and turn, so a crash between the relay and the settle does not report twice. A goal adjust takes effect on the turn that calls it: the turn is judged on the new condition, with no stale verdict and no spent turn.
  • Engine parity of agent profiles and the evaluator budget (internal/skill, internal/session) — an agent profile with an unknown key and a list or a block of text under it fails the load, as the engine did, where the runtime skipped the file; an unknown key with an inline value, a mapping, or block text that holds a colon still skips it. The goal evaluator reads a transcript of half the window of the evaluator model less 2048 tokens, at 4 bytes for each token, where it read a fixed 128 KiB; a model whose window the backend only estimates is sized with a 16000-token window in that formula, as in the engine.
  • Plugin shell.env (internal/tool/builtin, internal/tool/pluginsrc) — a plugin that subscribes to shell.env adds environment variables to each bash command, as the engine did.
  • Plugin chat.params (internal/turn, internal/tool/pluginsrc) — a plugin that subscribes to chat.params runs before each model call and may set the model, max_tokens, temperature, and top_p of that call, as the old engine did. An empty model keeps the session model.
  • Plugin manifest cache (internal/tool/pluginsrc, config, cmd/harness) — the first Create or Open reads the manifest of a plugin from the cache file when the plugin has not changed (the executable and each script argument, by size and mtime, then by content hash), as the engine did, so it no longer waits for a probe of each plugin. The cache file is the config key plugin_cache (HARNESS_PLUGIN_CACHE), which only the user config sets. harness serve, run, and plugin probe default it to plugin_cache.json beside the user config. harness plugin probe probes every plugin again and refreshes the file. The Go API has no default and probes at each start.
  • Oversize instructions (internal/prompt, config) — an AGENTS.md over instructions_max_bytes keeps the sections that fit whole and gets an outline of the rest, each line with the read_file range that reads the section, as the engine did. A first section over the cap, or a file with fewer than two sections, gets the truncation marker. instructions_mode: "full" or HARNESS_INSTRUCTIONS_MODE=full keeps the head and the marker for every file. A chain over four times instructions_max_bytes loses its middle files, nearest the root first.
  • Read-only subagents (internal/prompt) — the built-in explore and plan profiles allow session_info beside the read-only file tools, as the engine's allow-list had it.
  • Tool batching (internal/prompt) — with a work directory, the system prompt of a session on a model API backend tells the model to put independent tool calls in one message, after the append_system_prompt entries and before the AGENTS.md chain, word for word as the engine did.
  • Parallel tool calls (internal/turn, internal/tool/builtin) — the tool calls of one model response run at the same time, up to 8, as the engine ran them. Results reach the log in call order. goal, model, and mcp run alone; read_file, write_file, and edit_file on one path, process on one name, and task on one session run in call order. An interrupt cancels every running call. A budget of 64 MiB for each session bounds the file bytes that concurrent file calls hold, beside the 20 MiB cap of one file.
  • Adjacent assistant messages on the chat-completions wire (internal/provider/openaicompat) — a run of assistant messages in the history becomes one wire message with their text joined and their tool_calls concatenated, as the Anthropic adapter merges a run. The tool calls of a Claude Code response, recorded as one item each, thus stay valid for a chat-completions model after a model switch.
  • Claude Code failure text (harness) — a Claude Code result frame with subtype error_during_execution reports its failure in errors and carries no result text. The backend now reads errors, joined with ; , when result is empty. The error of the turn names the failure, and a credential refusal in errors fails a goal instead of pausing it, as a refusal in result already did.
  • Command directory under a symlink (internal/command) — a prompt command directory is refused only when the directory itself is a symlink. A symlinked ancestor, such as /tmp or /var on macOS, no longer hides the commands of a work dir.
  • Unknown model window (harness, config, protocol) — a model that the built-in context-window table does not know no longer fails with model_unavailable. It runs with a window of 128000 tokens, logs one WARN per process and model, and sets context.window_estimated on the session gauge. A configured context_window_tokens always wins, and an overflow error does not change the window: the overflow compacts and calls the model again as before. A model that no configured provider serves still fails with model_unavailable. The config key context_window_required is deleted, and config.Load rejects a file that sets it as an unknown key. This is a deliberate break (Andy, 2026-10-07).
  • Engine and server deleted (engine, server, provider/claudecode) — the packages engine, server, and provider/claudecode are gone, with harnesstest.SinkReceiver, prompt.EngineBase, message.PartVariants, the typeid package, provider.Registry, skill.Discover, plugin.NewTestSpec, message.CommandRecord, message.ResolveOrphanToolCalls, the message.Origin* constants, message.OperatorBatchEntry, message.PromptSource, and 17 fakeclaude modes that only the engine tests used. harness.New is the one Go API and Runtime.Handler serves the one set of routes. The depguard rules no longer allow cmd or harnesstest to import a provider wire.
  • Engine docs deleted (docs) — docs/engine-request-cycle.md, docs/goal-loop.md, docs/session-storage-and-queue.md, docs/models-and-providers.md, and docs/mcp-tool-loading.md described the deleted engine and server packages, and are gone, with the Historical section of docs/README.md. docs/architecture.md and the source describe harness.Runtime.
  • MCP server merged into mcp (internal/mcp) — the package mcpserver is gone. mcp.Registry, mcp.NewRegistry, mcp.ToolHandler, and mcp.CallMeta replace the same names in mcpserver.
  • Leaf packages moved to internal/ (internal/message, internal/modelmeta, internal/mcp, internal/plugin, internal/skill, internal/command, internal/process, internal/imageclamp, internal/provider) — the packages message, modelmeta, mcp, plugin, skill, command, process, imageclamp, and provider (with provider/anthropic, provider/openai, and provider/openaicompat) move under internal/ with no change to their code, so another module can no longer import github.com/majorcontext/harness/message or the others. The public Go API is harness, harness/config, harness/protocol, harness/storetest, and harness/harnesstest. A caller reads model metadata through Runtime.Models and GET /models. go generate ./internal/modelmeta/ rewrites the context-window tables. The harnesstest MCP stub (MCPTool, MCPResource) now takes its own types (MCPResult, MCPContent, MCPError) instead of the mcp package types.
  • Fresh-session cutover (harness) — the repository has no old-format converter. harness/migrate and cmd/harness-migrate are deleted, and the runtime reads no engine journal, index, snapshot, or events.jsonl. A box keeps its workspace and starts a new session on the runtime; its old journals stay on disk unread.
  • Queued inputs (harness, protocol) — GET /sessions/{id}/inputs answers each queued input, oldest first, as protocol.QueuedInput (id, parts, delivery, source, source_id, source_label) in place of an ID list. A text part carries its text; an attachment is {type: blob, media_type, bytes, key} and never its data. Session.queued stays the ID list.
  • harness serve on the runtime (cmd/harness) — harness serve runs one harness.Runtime over a DiskStore in the session dir, and serves Runtime.Handler with no version prefix: the /sessions routes, /models, /commands, /processes, /workspace/changes, and /health. No old route answers. It reads the config with config.LoadProject, applies the HARNESS_<KEY> variables with Config.ApplyEnv and then its flags, passes the working directory as WorkDir, the build version for the engine banner, and ServeURL and RunToken for the plugins, and refuses the config keys that the runtime does not read (instructions_mode, event_sink, snapshot_every_records, tool_result_inline_bytes, tool_result_retained_bytes). HARNESS_MODEL now sets the default model through ApplyEnv, so boxes must check the variables that it exports before the cutover. The HARNESS_RUN_TOKEN bearer check, -unauthenticated, HARNESS_UNAUTHENTICATED, --ask-user-question, -cors-origin, -no-instructions, -skills-dir, -agent-def-dir, the config summary log line, and the GC pause watcher stay. The store of serve logs a slow store operation, a store operation that stays in flight, a created session, and a spawned task, in place of the engine hooks. After the listener is up, serve calls Runtime.CatchUp and opens each stored session that has work to resume (View.Resumable): a session with none stays closed and gets no owner.acquired, and a log that does not replay is skipped and logged. SIGINT and SIGTERM close the runtime and the HTTP server under one 5 s deadline, then write serve-stop.json in the session dir as one line, {"stop":"handoff"|"crashed","sync":"synced"|"unsynced"}, for boxinit; serve deletes the file at start, so a run that ends with no report reads as crashed and unsynced. A Sync that rejects a batch for good during the run (Runtime.SyncStopped) makes the report unsynced, and Runtime.Close does not fail for that session. Runtime.List skips a log that does not replay and logs it. Serve no longer has -pprof.
  • harness run, sessions, and plugin probe on the runtime (cmd/harness, harness) — the three commands run on harness.Runtime, and cmd/harness imports neither engine nor server. run creates or opens a session (-r, -c, -no-save on a MemStore), submits the prompt as a typed input, streams the text, the tool calls, and a retry of the session and of each task child, or each event of the session and of each task child as a JSON line with -json that holds the session_id, and exits 1 for a failed turn (also under -goal) or command, with or without -json, and 3 for a goal that a verdict did not achieve. run ends only when its session is idle and each task child of its session has settled, so the output of a running child and the turn of its report print. run -max-tokens sets Options.MaxTokens, the output cap of each model call, as before. sessions lists the sessions of the store with their message counts. plugin probe calls the new Runtime.ProbePlugins and prints each plugin with its hooks; the manifest cache is gone, and the runtime probes at its first Create or Open. run and sessions write and read the event log; they cannot read an engine journal.
  • Message page (harness, protocol) — GET /sessions/{id}/messages?before=&limit= and View.Messages answer a protocol.MessagePage as the engine page: messages, first_seq, last_seq, total, has_more, and commands, numbered from 1 in the order of the conversation. A compaction keeps the messages it folded, and its summary cmpsum_<seq> stands between them and the kept messages. A limit above 1000, and a before or limit that is negative, not an integer, empty, or repeated, is invalid_request. The engine bootstrap form has no counterpart. The route reads a session without opening it.
  • Typed process, logs, and health bodies (harness, protocol) — protocol.ProcessInfo, ProcessStatus, ProcessLogs, and Health type the /processes and /health bodies, and the generated contract names them. GET /health answers version, vcs_revision, vcs_time, session_sync, started_at, and capabilities (delta_row_identity), as the engine did.
  • Resumable sessions (harness) — View.Resumable reports whether Open would resume a turn, a queued input, a goal, an unfinished command, or an unsettled child.
  • README and examples — the README and the programs in examples/ use harness.New, Runtime.Create, Session.Submit, and Session.Events.
  • Generated HTTP contract (protocol) — go generate ./protocol writes protocol/openapi.json and protocol/protocol.ts from the Go types of protocol and the route table of internal/server, and CI fails on a diff. The hand-written server/openapi.yaml is deleted. The contract holds each success status of a route (a repeated input ID answers 200, an answer to a request 202), marks each request body optional, and refuses unknown fields in a request-only type.
  • Error codes in the contract (protocol, internal/server) — Error.code in protocol/openapi.json and protocol/protocol.ts is an enum of the error codes of the API, generated from the status map of internal/server, which now holds unauthorized and internal. A test fails when the protocol Code constants, the status map, the Errors table of the spec, and the enum differ.
  • Provider tool deferral deleted (internal/provider, internal/provider/anthropic, internal/modelmeta) — provider.ToolDef.DeferLoading, the server-side tool search tool of the Anthropic adapter, and modelmeta.SupportsToolSearch are gone: nothing set the field, and internal/tool/mcpsrc defers MCP tools for every provider, as the spec says. A gate in internal/gates fails a Go file that names a deleted package path, in code or in a comment.
  • Model resolution (config) — Config.ResolveModel returns the resolved ref string and does not parse it. A caller parses it with message.ParseModelRef.
  • Runtime config check (harness) — harness.New returns ErrInvalidRequest for an Options.Config that fails Config.Validate, so a bad provider, plugin, MCP server, or process entry fails at New, not at the first model call or process start.
  • Credentials from the HTTP client (internal/provider/anthropic, internal/provider/openaicompat) — a Client with an HTTPClient and no APIKey sends no key header, so the client can supply the credentials, as provider/openai does. A Client with neither still fails with no API key.
  • Failed turn and the queue (harness) — a Runtime session starts the next queued input after a failed turn, as after a completed turn, and Open does the same. Only a turn that ended provider_exhausted leaves its queued inputs waiting for the next input, live and after a restart.
  • Turn end cause (harness, protocol) — turn.ended has a typed cause (stopped, ended, goal_cleared, crashed, provider_exhausted), and error holds only the message of a failure. protocol.LastTurn has cause. A turn that a usage limit failed keeps the provider message in error, with the recovery time of the provider when the message lacks it, where it held the text provider_exhausted. A turn that ended by its cause alone has no error; the report of a child and the status of a task show the cause then. Every reader branches on cause and never on the text of error.
  • Evaluator and summary calls (harness) — the goal evaluator request pins effort off and a response cap of 256 tokens, and a summary request caps its response at 1024 tokens, as the engine does. A retry waits 1 s, doubling to 8 s. The compaction threshold and the context gauge use the window of the session model, or the window of the reading when the model reports none, so a model switch changes the window. The evaluator transcript has no trailing newline.
  • Tool names across backends (harness) — one rule decides whether a session has a tool: an embedder, runtime, plugin, or MCP tool, a file tool of the WorkDir, or a built-in tool of its model. The tools list of a child profile keeps its plugin tools. A backend that owns the loop, such as Claude Code, runs no plugin system.transform, because it reads no system prompt of the harness. The tool hooks of every source run around each tool call, in order.
  • One read of a child profile (harness) — a spawn reads the agent profile once, and the child takes its model, tools, and prompt from that read, where the child read its prompt again at its first turn.
  • Reads without ownership (harness) — GET /sessions/{id} and the page form of GET /sessions/{id}/events answer from the view of a session that the Runtime runs, and replay the log of any other session, as OpenView does. They never acquire a session, append owner.acquired, or start a turn. The SSE stream of GET /sessions/{id}/events and each route that changes a session still open it. After a restart the embedder opens each session that has work to resume.
  • Reads of a running session (harness) — a plugin client/session.messages call, task status and log, the tree interrupt, and the tree budget read a running session from its actor, with no replay of its log.
  • Child limits from the logs (harness) — max_concurrent_tasks counts the unsettled children in the views of the sessions of a tree that the Runtime runs, with no separate ledger, so a parent that opens after a restart counts its unsettled children at once. A lock for each tree makes the count and the child.spawned append one step.
  • Engine-only config keys deleted (config) — Config has no field for instructions_mode, event_sink, snapshot_every_records, tool_result_inline_bytes, or tool_result_retained_bytes, and Defaults has no entry for them. config.EventSinkSpec and the accessors SnapshotEveryRecordsValue, ToolResultInlineBytesValue, and ToolResultRetainedBytesValue are gone. Load rejects any of these keys as an unknown field and names it. harness.New no longer has a separate check for them. config/config.go is split into config.go, specs.go, provider.go, load.go, and merge.go.
  • Owner refusals (harness) — a failure of Owner.Acquire is ErrSessionNotOwned that wraps the cause, so the HTTP handler answers session_not_owned; a call that waits for ownership when Runtime.Close starts fails with ErrDraining (draining, 503). ErrBusy is no longer exported. Runtime.Commands returns the op of each command and no route, and GET /commands names each route.
  • One submit (harness, protocol) — Session.Admit is gone. Session.Submit returns protocol.Admitted, and Admitted.Repeat (not on the wire) is true when the session had admitted the input before.
  • Window before the first measurement (harness, internal/modelmeta) — OpenView, ReadHandler, harness sessions, and harness run have no backend, so they read the context window only from the log. A session that they read reports window 0 until its first context.measured event, whatever its model. A live Claude Code session also reports window 0 before its first turn, because its backend reports the window during a turn. Separately, modelmeta.ContextWindow no longer answers for a claude-code ref: a model API provider that is keyed claude-code gets the default window of 128000, marked as an estimate, instead of window 0.

Fixed

  • Ended child goal (internal/session) — CancelForEnd ends the goal of the session with state cleared and reason ended, for an active, paused, or blocked goal, whether the session runs a turn, an evaluation, or a compaction, or is idle, so an ended child starts no further goal turn.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.