Upgrade the Pi SDK and refresh its model catalog - #867
Conversation
|
Live testing exposed one bundle-only OAuth failure: Pi’s lazy OAuth loader resolved Proof: the regression test failed before the change and passes after it; all 803 agent-runtime tests pass; the tarball smoke passes; and a bundled |
5e157ef to
9b352a3
Compare
|
Rebased onto
Two things that may make the Node floor less of a decision than it looks:
Happy to split this differently if you'd rather review the namespace migration and the runtime unification separately — say the word and I'll restructure. |
listPiBridgeModels called modelRuntime.refresh({ allowNetwork: true }) on
every invocation, so each model list fanned out one network request per
configured provider to pi.dev. It runs on every picker render and on
thread-detail bootstrap, and nothing caches the result between the browser
and the bridge. When a provider endpoint stalls the call burns the full 5s
abort budget before returning.
Measured cost of one listPiBridgeModels call: ~8-9ms warm, 274-375ms cold,
and 5,010ms on 2 of 6 cold runs.
Attempt the network refresh at most once per bridge process. The bridge is
long-lived, so later calls resolve from the persisted store plus the bundled
static catalog and return the same model set.
Also stop memoizing a rejected ModelRuntime.create(): a single transient
failure was otherwise cached for the life of the process, leaving every
model list and session start broken until the bridge restarted.
|
CI caught a real defect in the previous push — fixed and force-pushed. The Node 20 cleanup had removed the Verified locally on the pushed commit, replicating the CI shard:
|
9b352a3 to
9ce7023
Compare
|
Resolved the The owning invariant is now consistent end to end: Pi's model catalog, server provider policy, and daemon bridge all accept Proof on
The full local host-daemon suite still has the previously documented environment-only failure because this machine's Codex 0.101.0 is below bb's 0.136.0 minimum; the protocol-focused host-daemon test passes and GitHub CI is running on the pushed commit. |
|
Hey @amadad I think how I'm going to solve this is:
Does that make sense to you? |
|
Yeah @SawyerHood. Unbundling deletes the class of problems this PR works around (static Auth loaders, jiti/static, per-call catalog refresh all exist because F ships inside bb). FWIW, bb already works this way with Codex, and I hit Codex 0.101.0 is too old for this bb version twice on this branch, reproducing on a clean origin/main It surfaces late and reads like a bb bug rather than "update Codex" - worth getting the version handshake right for Pi from the start. Happy to close this. The max reasoning fix (PI_SERVER_CAPABILITIES + protocol 66) is server-side and survives unbundling - it closes #875 - so I can send it standalone if useful. |
|
I think I will end up going with your approach for now since it more or less keeps the status quo. I just dug into the pi acp adapter and it has some issues. I'll take a pass to do some deeper review and testing today |
Summary
@mariozechner/pi-*0.70.5 to@earendil-works/pi-*0.82.0.ModelRuntimefor model resolution, authentication, session creation, and catalog refresh. The picker now reflects each model's supported reasoning levels, includingmax.agent_end.willRetry.jiti/staticdependency and register Pi's static OAuth loaders so the standalone bridge can authenticate without filesystem-only dynamic imports.Why
BB was pinned to Pi 0.70.5 under the retired package namespace. Its static model APIs could not expose models added through Pi's current catalog. The new runtime API keeps session and catalog behavior under one owner while preserving BB's existing bridge protocol.
The server pins
@opentelemetry/apito the workspace version so Pi AI and Drizzle resolve one shared type identity.Compatibility
Verification
pnpm install --frozen-lockfilepnpm exec turbo run build typecheck lint --concurrency=1 --force(68 tasks)bb-app: 2 files, 47 testspnpm exec turbo run smoke:tarball --filter=bb-app --forceopenai-codexcredentials resolve inside the single-file bridgemax