Patch Changes
-
90983d7: feat(harness-pi): add configurable writable sandbox roots for Pi's native file tools
-
d10fa3e: feat(harness-pi): pass the harness session to extension factories
Each
extensionFactoriesentry now receives a second argument, aPiHarnessExtensionSessionwith the restrictedsandboxSession, thesessionWorkDirand aninstructions()getter for the current turn's instructions. An extension can now run work against the session's sandbox with the session's instructions, such as a tool that delegates to a child Pi session. Existing(pi) => voidfactories keep working unchanged. -
9323fdb: feat(harness-pi): serve mcpServers with Pi's native MCP and tool_search
mcpServersis now served by Pi's built-in MCP extension and itstool_searchtool instead ofpi-mcp-adapter, which is no longer a dependency. Each entry is Pi'sMcpServerConfig: stdio{ command, args, env, cwd }or streamable HTTP{ url, headers, timeout }, plusexposure,toolExposure,enabledanddescription. The setting stays typed asRecord<string, unknown>like the other harnesses; type entries with the exportedPiMcpServerConfig. Fields that only the adapter understood, such aslifecycle, are no longer supported.Tool names are always
mcp__<server>__<tool>, with-in either name replaced by_, so a server namedbrand-ainow yieldsmcp__brand_ai__<tool>.exposuredefaults todirect, which declares a server's tools to the model.deferredtools stay undeclared until the model loads them throughtool_searchand then calls them by name. Pi's own default,codemode, is not supported because the harness does not load Pi's codemode extension; an entry that asks for it fails session start, as does an entry Pi rejects.mcpSettings.toolPrefixandmcpSettings.outputGuardare deprecated. AtoolPrefixother than'mcp'oroutputGuard: falsenow fails session start, since native MCP cannot honor either. Pi truncates text results over 20 KB and writes the full text to a file in the host temp directory.The harness has no sign-in flow, so an HTTP server that requires authentication must carry an
Authorizationheader orauth.provider; with the header, OAuth never runs. The harness reads nomcp.jsonand neither reads nor writesmcp.logormcp-auth.json, so a sign-in stored by the Pi CLI is never sent.@earendil-works/pi-aiis no longer a direct dependency. -
286e0c7: fix(harness-pi): return images from the read tool as image blocks
The
readtool decoded every file as UTF-8, so the model received an image as unreadable text. The tool now runs Pi's owncreateReadToolDefinitionover the sandbox: PNG, JPEG, GIF, WebP and BMP files come back as image blocks that Pi resizes, and text reads keep Pi's truncation and paging notices. The tool still takesfile_path, and path mapping andfileToolPathPolicyapply as before. -
8ae0804: fix(harness-pi): judge a turn by its last attempt and keep suspend errors out of the stream
A turn that Pi recovered by retrying a failed request (rate limit, overload, context overflow after compaction) ended with an
errorpart, because the first terminal error seen was kept for the whole turn. The last assistant message now decides the outcome, so a recovered turn ends withfinish.Once
doSuspendTurnhas begun, every terminal or thrown error of the turn being cut belongs to the suspend and no longer emits anerrorpart. Before, only errors that looked like an abort were kept silent, and a request Pi started on an already-aborted signal reportsstopReason: 'error'("This operation was aborted") while a provider can also fail during the cut. Reporting such an error ended the slice as failed with the unfinished turn nested in its resume state, and a session built from that state refused every later prompt. -
Updated dependencies [2e89fa4]
- @ai-sdk/provider-utils@5.0.60
- @ai-sdk/harness@1.0.152