OMP rewrites @earendil-works/pi-ai/compat to a bundle without
registerApiProvider, which broke static import at install/load.
Probe the export at runtime; stock pi still registers qoder-api for
global streamSimple, while OMP relies on registerProvider(streamSimple).
Pi 0.84+ no longer registers custom APIs from registerProvider.streamSimple,
so a later agent-loop path threw No API provider registered for api: qoder-api.
Older Cosy-Version / cosyVersion values cause the model catalog and
gateway to treat the client as a stale qodercli and return a reduced
list. Align QoderIDEVersion with current CLI 1.1.38.
Leave PAT exchange and userinfo Cosy-Version at 1.0.1: those openapi
endpoints do not use a COSY signature, and I could not verify that
official qodercli 1.1.38 changed them.
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
@earendil-works/pi-coding-agent, pi-ai and the undici they pull in all
declare engines node >=22.19.0, so CI's Node 20 was below the floor: the
newly added test step failed loading pi-coding-agent with
"webidl.util.markAsUncloneable is not a function". Release already
publishes on Node 24.
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
CI linted, typechecked and built but never ran vitest, so the suite could
break on main without anyone noticing.
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
The npm tarball ships only dist/ and README.md, so the pi.extensions
"./src/index.ts" that shipped in 0.3.0 left Pi listing the package as
installed while never loading the provider. main already points at
./dist/index.js (6d9635e), but nothing stopped it regressing again -- it
had already flipped once in 1b110a6.
Assert the entry is ./dist/index.js and, more generally, that every
pi.extensions path falls inside the published files set.
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
auto, efficient and lite carried a 180K contextWindow, so pi showed >100%
context usage and auto-compacted early. Live testing in #13 drove global
lite to 1,000K tokens successfully, so the 180K value was a stale
max_input_tokens floor rather than a real limit.
Introduce DEFAULT_CONTEXT_WINDOW (1M) and use it for the global static
models, including gm51model. Apply it as the catalog fallback too, but only
when /model/list advertises no context_config: models that do advertise a
smaller window (kmodel at 256K, CN GLM-5.2 and MiniMax at 200K) keep it
rather than being inflated to 1M. CN Auto stays at 200K since only global
lite was verified at 1M.
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
Several suites read and write ~/.pi/agent/{auth,qoder-models-cache}.json.
Vitest runs files in parallel, so one file could truncate a file another
was reading, and a run also clobbered the developer's own ~/.pi state.
Give each test file its own HOME.
Isolation exposed a latent coupling in the stream suite: with no resolved
identity on disk, streamQoder fetches /userinfo first and consumes the
single mocked Response, so the chat read failed on a locked stream. The
suite only passed because another file left credentials behind. Stub the
identity so the mock only ever serves the chat request.
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
pi-coding-agent 0.84 no longer exports AuthStorage, so the named import
failed to compile even though the call site already guarded for its
absence. Read it off the module namespace instead, keeping the auth-file
fallback when the export is missing.
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
CI was red at the lint step: an unused providerID parameter in
createQoderOAuth, an unused getCachedCredentials import in stream.ts,
plus unsorted imports and stale formatting in stream.ts and pat.ts.
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>