The Pi adapter returns the shared executor's isError: true object unchanged. Pi records a returned value as success, so failed archive reads become toolResult.isError: false. The error text survives, but the failure status does not.
Reproduction on archives 0.5.4, commit 37d69db, with Pi 0.85.1:
- Capture
archives_content from the real extension factory. Mock ofetch to reject with Error('fixture CDX 503').
- Call its execute callback with
{target: 'https://example.com/old', provider: 'wayback', cache: false, retries: 0}. The returned object has isError: true.
- Run the same registered tool through the installed pi-agent-core
runAgentLoop, with a synthetic assistant stream that calls it once. The resulting tool message has isError: false. Replacing execute with a throwing callback gives isError: true. No model or network is needed.
packages/pi/extensions/archives.ts directly returns contentArchives(params, signal). Pi's documented contract requires throwing from execute to signal failure. The existing pi-extension test asserts the returned object's flag, not the runtime message.
Expected: translate failed shared results at the Pi boundary, preserve their diagnostic text, and test the recorded runtime flag. Keep MCP's returned isError contract unchanged. This affects retry decisions and failure accounting.
Verification: both deterministic audit fixtures passed, including the throwing control. Existing content, Pi extension and MCP suites also passed, 127 tests. No production fix is included. Checked open and closed issues and PRs. No matching Pi failure-status report found.
The Pi adapter returns the shared executor's
isError: trueobject unchanged. Pi records a returned value as success, so failed archive reads becometoolResult.isError: false. The error text survives, but the failure status does not.Reproduction on archives 0.5.4, commit 37d69db, with Pi 0.85.1:
archives_contentfrom the real extension factory. Mock ofetch to reject withError('fixture CDX 503').{target: 'https://example.com/old', provider: 'wayback', cache: false, retries: 0}. The returned object hasisError: true.runAgentLoop, with a synthetic assistant stream that calls it once. The resulting tool message hasisError: false. Replacing execute with a throwing callback givesisError: true. No model or network is needed.packages/pi/extensions/archives.tsdirectly returnscontentArchives(params, signal). Pi's documented contract requires throwing from execute to signal failure. The existing pi-extension test asserts the returned object's flag, not the runtime message.Expected: translate failed shared results at the Pi boundary, preserve their diagnostic text, and test the recorded runtime flag. Keep MCP's returned isError contract unchanged. This affects retry decisions and failure accounting.
Verification: both deterministic audit fixtures passed, including the throwing control. Existing content, Pi extension and MCP suites also passed, 127 tests. No production fix is included. Checked open and closed issues and PRs. No matching Pi failure-status report found.