Replace the previous implementation with one that registers the Provider API
catalog through pi's own provider layer instead of shipping a custom transport,
cache file, and hand-maintained pricing table.
- models: derive the catalog from the published command-code CLI package
(context windows, reasoning efforts, image input, output limits, rates) and
keep it as the offline baseline; scripts/sync-catalog.mjs regenerates it and
supports --check
- refresh: use refreshModels plus context.publish so pi persists the live
/provider/v1/models listing in models-store.json and restores it offline
- auth: /login browser transfer through a localhost callback server with a
pasted-key fallback; $COMMAND_CODE_API_KEY, --api-key and auth.json keep
working
- streaming: pi's native openai-completions and anthropic-messages adapters;
the generate-transport fallback and Oh My Pi branches are gone
- keep the context-overflow rewrite that enables pi's compaction retry and the
/commandcode-quota command
- tests: 51 cases under tests/<module>/ covering models, catalog sync, auth,
the callback server, overflow handling, quota, and the extension factory
Verified against the live API: chat, tool round trip, image input and
--thinking max on deepseek/deepseek-v4.1-flash, quota output, and catalog
persistence in an interactive session.
Align the developer-message fix with the Provider API transport router.
The fix stays scoped to the legacy /alpha/generate converter, and the
OMP advisory compat test now forces the upgrade_required fallback so the
advisory is asserted on the generate request body.
Add retry mechanism driven by pi settings.json retry.provider config
(timeoutMs, maxRetries, maxRetryDelayMs).
HTTP-level retries handle 429/5xx with exponential backoff and jitter,
respecting Retry-After headers (seconds and HTTP-date formats).
Stream-level retries handle cases where the API returns 200 OK but
sends an error event in the stream body. Retries only when no content
has been emitted yet.
Per-attempt timeout via AbortController with automatic retry. Clean
abort propagation through the retry loop.
pi 0.75.5 renamed the npm namespace from @mariozechner/ to @earendil-works/.
Importing from the old namespace causes 'fetch failed' errors at startup.
Changes:
- index.ts: @mariozechner/pi-ai → @earendil-works/pi-ai
- index.ts: @mariozechner/pi-coding-agent → @earendil-works/pi-coding-agent
- package.json: bump deps from 0.72.0 to 0.75.5
- package-lock.json: regenerated with new packages (242 deps)
- tsc --noEmit: zero errors
Add tests/test-pricing.ts to assert that known models have non-zero
pricing, promotional deals are documented in comments, and Claude models
include cache pricing. Fix test-pi-local to match against combined
stdout+stderr since pi may output model listing to either stream.