Servers that return their result only as structuredContent (no TextContent
block) reached the agent as an empty result. Serialize StructuredContent to
JSON in that case; when text is present it still wins, since the MCP spec
has tools send the same data as text.
ExaSearchTool (tools/web) calls POST https://api.exa.ai/search with
query-relevant highlights, optional category, domain and published-date
filters, and the shared SSRF-safe search client.
Add tools/stagehand, a browser tool built on the Stagehand Go SDK
(act/observe/extract/navigate/get_text/screenshot) with persistent named
sessions. Runs on local Chrome by default or Browserbase when an API key
is configured. Stagehand's internal inference is routed through the
harness LLMProvider via NewGenerateFunc, so it shares the agent's
provider, usage observers and admission guards.
The Stagehand SDK requires Go 1.26, so the module now declares go 1.26.0.
Reuses llm.ImageContent/session.ImageData with MimeType
"application/pdf" rather than adding a new field: images already flow
tool result -> session entry -> reload -> provider end to end, so a
MIME check at the provider edge is the smallest change.
- Anthropic provider emits a document block (source.type=base64,
media_type=application/pdf) for a PDF attachment in a tool result or
a user message; images are unaffected. Cache control now also
applies to document blocks.
- OpenAI provider replaces a PDF attachment with a text placeholder
instead of an invalid image_url data URI; images still emitted.
Gemini already accepts application/pdf inline and needs no change.
MaxOutputLength was 50,000 chars, truncating fetched pages to a few
paragraphs well before hitting any model's context window. Match Sonnet
5's 1M-token context using this codebase's 4-chars/token estimate
(session.Session.EstimateTokens), and raise the raw HTTP read cap
(maxFetchSize) to 8MB so plain-text/JSON responses that don't shrink
during HTML->markdown conversion aren't cut short before the output cap
even applies.
Both "Status" mentions were still pinned at v0.3.6 (three releases
behind). Also documents Runtime.DynamicIdentityHint in the components
table — added this session, previously undocumented outside code
comments.
Ollama is one local-model server among several (LM Studio, llama.cpp's
server, vLLM, ...) that all speak the same OpenAI-compatible shape —
naming the package (and provider name downstream) after one of them
was misleading. Same constructor, same default endpoint (Ollama's,
being the most common), just generically named: NewLocalProvider.
This renames a package published minutes ago in v0.3.8 with no other
known consumers yet, so no compatibility shim is kept.
Thin constructor over the existing OpenAI-compatible path, same shape
as litellm/openrouter: NewOllamaProvider(baseURL) defaults to Ollama's
local endpoint (http://localhost:11434/v1) and needs no API key, since
Ollama doesn't authenticate requests. Also covers other local servers
that share Ollama's OpenAI-compatible endpoint shape (LM Studio,
llama.cpp's server, vLLM).
Verifies, at the Runtime.Run level, that mutating Model and
DynamicIdentityHint between two Run calls in the same session (exactly
what hand's tui.Controller.SwitchModel does) actually changes the
ChatRequest.Model sent on the next call, not just the system prompt
text. If this ever regressed, a caller-side "/model" fix would look
correct in its own unit tests while the model actually being queried
silently stayed the old one.
Runtime.StaticSystemPrompt is cached and reused verbatim every turn —
right for anything that doesn't change mid-conversation, wrong for a
fact a caller needs to update live (e.g. after a runtime model switch)
and have the model actually notice. A model tends to just repeat what
it already told the user earlier in the same conversation over a
background instruction it read once near the top of a large cached
block, so updating only the static prompt after a switch left the
model insisting it was still whatever it started as.
DynamicIdentityHint rides the same per-turn (uncached) system prompt
slot Run/RunTurn already use for the date line and KG hint, so setting
it takes effect on the very next turn with the same recency the model
grants its own last statement.
Adding one bespoke provider package per vendor doesn't scale. LiteLLM
proxy and OpenRouter both speak the OpenAI chat-completions wire
format and each front dozens-to-hundreds of underlying models, so
supporting them once gets that whole catalog instead of one more
one-off integration — providers/qwen turns out to have been exactly
that pattern hand-rolled a second time (its own copy of the
OpenAI-compatible translation, just pointed at DashScope's base URL).
providers/litellm and providers/openrouter are both thin constructors
over the OpenAI provider's existing NewOpenAIProviderWithKind(apiKey,
baseURL, "openai-compatible") — no new request/stream-translation code.
OpenRouter defaults to its public endpoint when baseURL is empty;
LiteLLM has none (self-hosted), so callers must supply one.
Context-window detection (tokens.ContextWindow) already keys off the
model ID's family rather than the provider prefix, specifically so a
model exposed under a custom/proxy provider name still gets the right
window — so litellm/openrouter models need zero changes there.
windowByModelFamily matched Gemini models by exact version substring
("gemini-1.5-pro", "gemini-1.5-flash", "gemini-2"), so any newer
generation (3.x and beyond) fell through to defaultRemoteUnknownWindow
(128k) purely because this table hadn't been updated yet — observed
via hand's status line showing a >100% context gauge for a
"gemini-3.8-flash"-family model whose real window is far larger, and
which made harness's own preventive compaction unreachable (the
threshold check never fires against a window this far off).
Match on tier (Pro vs. everything else) instead of enumerating every
version: every Pro-tier Gemini release so far ships 2M, everything
else at least 1M, and both hold for a model this table has never seen
the exact version string of.
- Runtime.Run rejects concurrent invocations instead of racing on shared state; panics in tools, hooks, and permission checkers are recovered and surfaced as errors/denials instead of crashing the loop
- AgentSpec.Loop now actually overrides RuntimeDeps.AgentLoop per-agent, as documented
- session.Store validates agent ID / session key as single path components, preventing traversal outside the session directory
- ValidatePathInWorkDir resolves symlinks on the target itself, not just its parent, closing a workspace-escape gap
- bash tool now fails closed on an unrecognized ExecPolicy.Level instead of allowing everything
- browser tool rejects unknown actions instead of silently no-op'ing
Bump README to v0.3.4 and document the AgentSpec.Loop override semantics.
Anthropic: add claude-opus-5 and claude-sonnet-5 to the adaptive-thinking-only
model list. These models also think by default when the thinking param is
omitted (unlike Fable 5/Mythos/Opus 4.7/4.8), so ReasoningOff now sends an
explicit {type:"disabled"} on them instead of relying on omission.
Gemini: replace the empty-FunctionCall.ID fallback (function name) with a
synthetic toolu_-shaped random ID. The name-based fallback wasn't unique —
repeated calls to the same tool in one conversation collided on one ID,
which produced duplicate tool_use ids if that history was later replayed to
a different (Anthropic) model on a routing switch, rejected with a 400.
Runtime.Run now accumulates token usage across all turns (summing all four
llm.Usage fields via a pure addUsage helper) and emits the run total on the
terminal EventDone, instead of only the last turn. Fixes multi-turn undercount
for consumers metering AgentEvent.Usage. RunTurn unchanged (one turn per call).
Run accumulated only the last turn's usage into the terminal EventDone, so
multi-turn runs under-reported tokens to consumers metering AgentEvent.Usage.
Sum all four usage fields across turns; RunTurn is unchanged (one turn/call).
Fix the CRITICAL allowlist-confinement escape: the metacharacter guard
checked the two-byte literal "\\n" instead of a real newline, so a
newline in the command ran subsequent lines unchecked via bash -c. Also
treat background & as a command separator and reject output redirection
(>) in allowlist mode.