Repository navigation
fix(pi): the model catalog counts stored credentials as configured from the start - #323
Merged
Merged
Conversation
…om the start (#291) createPiModelCatalog builds pi's runtime without the availability refresh, so pi's snapshot of stored providers stayed empty and a key or login in auth.json read configured: false until refresh(). The catalog now reads the stored providers from auth.json at create and after each refresh, without resolving any credential. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Merged
xxchan
added a commit
that referenced
this pull request
Oct 10, 2026
Release OAR and CLI 0.54.0. This PR changes only the two package version fields. **Added: session lineage is in the records** (#312, #320) - New event `session_linked { parent, child, via: "tool_call" }`, carried by the native frame that names the relationship: codex collaboration items, ACP lineage notifications (grok) and OpenCode v2 child attribution. A host that folds the records now gets the same session graph and the same `usage().withChildren` as a live `Session`. - `graphOf(records)` is exported (root, observe and browser entries). `Session.graph()` is the same fold, kept as each record is appended. A live graph starts with its root id; `graphOf` learns the root from its first record. An edge reported many times is in the graph once. - `usageOf(records, sessionId)` derives lineage from the records by default and still takes an explicit graph. Old records without `session_linked` have no edges and no `withChildren`. - grok child ledgers stay native-only, as before: the root's prompt ledger already includes a foreground child's spend. A background child's spend (grok's default) and the root turn grok runs after it are not in `usage()` yet (#325). **Added: a tool phase says when claude is still writing its arguments** (#314, #317) - `RunningPhase` `{ tool, callId }` gains `writing?: true` while a call's arguments stream (`tool_call_input_delta`); the complete input or the call's result clears it. - `phaseLabel(phase, runtimeId?)` names the action when given the runtime: "Preparing command", "Preparing file edit", "Running command", "Reading file". MCP and unclassified tools read "Writing <name> arguments" and "Running <name>". Without `runtimeId` it reads "Running <tool>" as before, or "Writing <tool> arguments". - `toolActionLabel` takes a `"writing"` state. **Added: page fetches and subagent calls are classified** (#321, #322) - New `ToolActionKind` `fetch`: claude `WebFetch` and cursor `webFetch`, worded "Fetching page" and "fetched 2 pages". They were `web`, worded as web searches. `web` now means a web search only. - New `ToolActionKind` `subagent`: claude `Agent` (and its alias `Task`, under which a call is recorded as `Task`) and opencode `subagent`, worded "Running subagent" and "ran 2 subagents", with the subagent's task (`description`) as `detail` and `description`. **Fixed** - `groupToolActivity` no longer parses every call's input on each grouping: a call's kind depends only on its runtime and tool name (#318, #319). A host that groups a live turn on every record pays far less: 400 calls went from 2,160 ms to about 300 ms. - pi: the model catalog's `providers()[].configured` is true from the start for a provider with a key or login in `auth.json`, not only after `refresh()` (#291, #323). An environment key still counts only after `refresh()`. As in pi itself, `configured` means the provider has an entry, not that its key works. **Behavior changes** - New event kind `session_linked`, and new `ToolActionKind`s `fetch` and `subagent`. Hosts with an exhaustive `switch` or `Record` need the new cases. - Counts that grouped page fetches under `web` now show them as `fetch`; claude `Agent`/`Task` and opencode `subagent` calls count as `subagent`, not `other`. - An incremental `SessionView` checkpoint must keep `sessionGraph` and `usageBySession`; replay the raw records when upgrading an older checkpoint. - Adapter authors: put the event `kernel.link(edge)` returns in the source frame's events. `kernel.node()` is removed. Validation: every PR passed all 17 checks on its final head. #317 differed from its CI tree only in the version fields from the 0.53.0 release, and #320's merged tree equals its CI tree. #319, #323 and #322 each merged after typecheck, lint and the full test suite passed locally on top of the PRs merged before them, and each merged tree equals that verified tree. Lookout verified each with no account: #320 against real codex 0.162.0 and grok 1.0.50 with a mock provider and OpenCode v2 2.0.26 on a free model (the live graph equals `graphOf` of the records after every one of 222 records, and replayed usage equals live); #317 and #322 against the real claude CLI 2.1.292 with a mock provider, including `WebFetch`, `Agent` and `Task`; #319 with identical groups to 0.53.0 on recordings of 1,487 and 4,917 records; #323 with temporary `auth.json` files and the network blocked. After this PR passes CI and merges, tag its exact squash commit as `v0.54.0` to trigger npm trusted publishing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: exe.dev user <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #291.
createPiModelCatalog()builds pi'sModelRuntimewithout its availability refresh (refreshOnCreate: false).providers()[].configuredreads pi'sgetProviderAuthStatus, whose "stored" answer comes from that refresh's snapshot. So a provider with a key or OAuth login inauth.jsonreadconfigured: falseuntil the host calledrefresh().createPiProviderAuthwith the same file saidconfigured: true.Change: the catalog reads which providers
auth.jsonholds (ModelRuntime.listCredentials()) when it is created and again after eachrefresh(), and counts them as configured. That read touches the file only: no credential is resolved or refreshed, so no network, andproviders()stays synchronous. Pi counts a stored credential the same way once its snapshot exists. Re-reading after a refresh means a removed key stops counting.Unchanged: a key in the environment still counts only after
refresh()(checked:DEEPSEEK_API_KEYreadsfalsebefore andtrueafter). Resolving ambient credentials is where pi may reach the network, for example AWS's credential chain for Bedrock, so it stays behind the refresh the host asks for.docs/runtimes/pi.mdsays both.Tests:
tests/providers/pi-catalog-stored.test.ts(a stored key is configured before and after a refresh, and not after it is removed; it fails without the change). The pi provider tests, lint and typecheck pass.🤖 Generated with Claude Code