Repository navigation
Description
Out of scope
The real upstream executor, provider credentials, egress routing, data-routing/taint/budget admission and subscription login (sibling slices of #2765). Persisting results across executor restart or resume (#2766), fork inheritance (#2767). No public plugin or transport seam: the host-side executor boundary is internal, with one production implementation (the trusted-executor slice) and test doubles.
Context
Part of #2765. Read that epic for the 2026-10-15 rulings, and docs/plans/host-owned-web-search.md, "Common bridge and governance design", items 1, 2, 5, 6 and 7.
The worker RPC schema has a bounded, grant-checked bridge but no web method (piWorkerMessage, packages/ui-backend-pi/src/worker-protocol.ts:71-87). The host dispatches worker RPCs in createPiWorkerRpcDispatcher (packages/ui-backend-pi/src/worker-rpc.ts:273). Curated tools are built in createBrainTools (packages/ui-backend-pi/src/tools.ts:224). web_search and fetch_content are still auto-allowed by name for the retired extension (DEFAULT_PI_ALLOWED_TOOLS, packages/ui-backend-pi/src/tools.ts:203-205). Managed workers refuse every loaded extension (unqualifiedResources, packages/ui-backend-pi/src/native-session-runtime.ts:134-137), so the forwarding tools must be curated tools whose results pass the input-safety collector (installPiToolSafety, packages/ui-backend-pi/src/tool-safety.ts:27) before the model receives them.
Scope
- Curated forwarding tools
web_search,fetch_content,get_search_contentandsource_checkin ordinary governed and strict workers only. Restricted autonomous turns get none. - One additive worker-to-host bridge message for those four calls. The host binds each call to the admitted principal, session, turn, tool-call grant, profile, policy revision and cancellation signal; worker fields cannot choose them. Narrow per-tool schemas refuse unknown fields, endpoints, proxies, commands, local paths and providers outside the admitted subset.
- An internal host executor boundary, driven in this slice by a fixture executor. Answer mode, automatic summaries, image/video processing, curator/review and browser/credential-command modes return an explicit unsupported result.
- Server-owned opaque result handles scoped to session and principal for the executor's lifetime. An upstream ID is never an authorization.
- Request/response byte, fan-out, concurrency, queue and deadline bounds. Cancel and drain on cancellation, deadline or executor death, with no late cross-turn result.
Acceptance criteria
- The four tools are present in governed and strict workers and absent from restricted autonomous workers, and the curated roster is otherwise unchanged (provider-history guard passes).
- Each forwarded result passes the input-safety collector's
begin/resultbefore the model receives it, proven with a real collector double and a mutation that skips recording. - Bridge tests cover forged identities, unknown fields, out-of-subset providers, and guessed and replayed handles across two concurrent sessions, plus cancellation, deadline and executor death with child exit and cleanup receipts.
- Deferred workflows and excluded credential modes return an explicit unsupported result through the bridge.
- Named forwarding, authority and cancellation mutations each fail their intended test and are restored, recorded in the PR.
Verification
bun run test packages/ui-backend-pi packages/ui-server packages/ui-sdk
bun run typecheck && bun run lint
bun run check:pr --base origin/mainKeyless, offline, fictional Odysseus inputs. Native worker tests need hosted proof.
Contract impact
The new worker/server wire message is additive: CONTRACT: prefix, integration contract updated in the same commit, contract label and a minor changeset.
Activity
chore(tracker): track epic #2765 under Hardening
chore(tracker): track epic #2765 under Hardening
chore(tracker): track epic #2765 under Hardening
chore(tracker): track epic #2765 under Hardening
chore(tracker): track epic #2765 under Hardening
CONTRACT: fix(backends): run Pi on curated tools by default and refus…
2 remaining items
schlessera commentedon Nov 9, 2026
Readiness review, 2026-11-09: the citations in the body pointed a few lines off after recent merges, so I corrected them.
createBrainToolsis nowtools.ts:224, the old auto-allowed web names are attools.ts:203-205, andunqualifiedResourcesis atnative-session-runtime.ts:134-137. The other citations still hold atfb999b8ba. No scope or ruling changed.CONTRACT: feat(ui-sdk): define the host-owned web tool contracts and …
CONTRACT: feat(ui-server): broker host-owned web calls to a per-sessi…
CONTRACT: feat(backends): forward Pi's four web tools over the worker…
CONTRACT: feat(ui-sdk): define the host-owned web tool contracts and …
CONTRACT: feat(ui-server): broker host-owned web calls to a per-sessi…
CONTRACT: feat(backends): forward Pi's four web tools over the worker…
CONTRACT: feat(ui-sdk): define the host-owned web tool contracts and …
CONTRACT: feat(ui-server): broker host-owned web calls to a per-sessi…
CONTRACT: feat(backends): forward Pi's four web tools over the worker…
CONTRACT: feat(backends): forward Pi's four web tools over a constrai…
schlessera commentedon Nov 9, 2026
Delivered by #3775, squash
297f6a7d1onmain(milestone 0.45.0). Candidate proof run 42666085561 passed every selected category at headf26cc5e96on base22a2a387e. The automatic main run for the squash was still in progress at closure.What landed:
parseWebToolInput,WebToolEnvelope,handleWebToolandBackendBridge.webAccess.get_search_contentandsource_checknow taint a session.The PR records the tests and the named mutation receipts.
Open, by design: no host configures an executor until #3686, so the tools are listed and refused before they run. The bounds are provisional; #3687 owns the measured admission policy, egress and budgets.