Skip to content

fix(pi): the model catalog counts stored credentials as configured from the start - #323

Merged
xxchan merged 2 commits into
mainfrom
fix/pi-catalog-stored-configured
Oct 10, 2026
Merged

xxchan merged 2 commits into
mainfrom
fix/pi-catalog-stored-configured

Conversation

@xxchan

@xxchan xxchan commented Oct 10, 2026

Copy link
Copy Markdown
Member

Closes #291.

createPiModelCatalog() builds pi's ModelRuntime without its availability refresh (refreshOnCreate: false). providers()[].configured reads pi's getProviderAuthStatus, whose "stored" answer comes from that refresh's snapshot. So a provider with a key or OAuth login in auth.json read configured: false until the host called refresh(). createPiProviderAuth with the same file said configured: true.

Change: the catalog reads which providers auth.json holds (ModelRuntime.listCredentials()) when it is created and again after each refresh(), and counts them as configured. That read touches the file only: no credential is resolved or refreshed, so no network, and providers() 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_KEY reads false before and true after). 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.md says 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

exe.dev user and others added 2 commits October 10, 2026 08:08
…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]>
@xxchan
xxchan merged commit 8045b19 into main Oct 10, 2026
17 checks passed
@xxchan
xxchan deleted the fix/pi-catalog-stored-configured branch October 10, 2026 08:52
@xxchan xxchan mentioned this pull request Oct 10, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pi model catalog: providers()[].configured is false for stored credentials

1 participant