Commit Graph
11 Commits
Author SHA1 Message Date
Cursor AgentandSimon Shi ca17a95270 test: correct fixture and abort harness
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
2026-08-31 16:28:09 +00:00
Cursor AgentandSimon Shi 3d7df5d1e4 test: cover provider adapter scenarios
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
2026-08-31 16:27:32 +00:00
Cursor AgentandSimon Shi 6d5cdfd171 test: add redacted Qoder protocol recorder and replays
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
2026-08-31 16:14:37 +00:00
Cursor AgentandSimon Shi 1eee02455c fix: bump COSY client identity to qodercli 1.1.38
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>
2026-08-31 16:07:41 +00:00
Cursor AgentandSimon Shi e7b5990e5c ci: build and test on Node 24
@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>
2026-08-31 15:59:37 +00:00
Cursor AgentandSimon Shi 2d9e31ea4a ci: run the test suite
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>
2026-08-31 15:58:00 +00:00
Cursor AgentandSimon Shi 52f7752717 test: guard the published pi.extensions entry (#18, #21)
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>
2026-08-31 15:57:56 +00:00
Cursor AgentandSimon Shi 1e44cde685 fix(models): use the 1M context window Qoder actually supports (#13)
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>
2026-08-31 15:57:49 +00:00
Cursor AgentandSimon Shi 1dd1b0988b test: isolate suites from the real ~/.pi and from each other
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>
2026-08-31 15:57:41 +00:00
Cursor AgentandSimon Shi e98526a8cd fix(types): restore npm run check
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>
2026-08-31 15:57:26 +00:00
Cursor AgentandSimon Shi 70fba627e6 fix(lint): clear biome errors breaking CI on main
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>
2026-08-31 15:57:20 +00:00