Commit Graph
32 Commits
Author SHA1 Message Date
Cursor Agent a238e428fe fix: load registerApiProvider dynamically for OMP
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).
2026-09-06 12:53:03 +00:00
Cursor Agent ab80759fe0 chore: bump version to 0.4.3 2026-09-06 12:37:37 +00:00
Cursor Agent dfe7308674 chore: refresh package dependencies 2026-09-06 12:36:23 +00:00
Cursor Agent b854aa4685 chore: bump version to 0.4.2 2026-09-06 09:51:20 +00:00
Cursor Agent bd3d020cee fix: register qoder-api for pi global 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.
2026-08-31 17:51:46 +00:00
Cursor AgentandSimon Shi 09bd3bcf07 chore: bump version to 0.4.0
Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
2026-08-31 17:23: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
Simon ShiandGitHub ab378b44e2 Merge pull request #16 from simonsmh/dependabot/npm_and_yarn/npm_and_yarn-0e29347d1a
build(deps): bump undici from 8.5.0 to 8.9.0 in the npm_and_yarn group across 1 directory
2026-08-31 23:44:05 +08:00
xing.huang 443e4ad6a7 fix: qoder-cn chat identity, content normalization, and Windows build
- Resolve the real Qoder identity (userID/email/name/machineID) from the
  job token at request time. OMP keeps login credentials in its own
  agent.db, not in ~/.pi/agent/auth.json, so a cache miss sent uid
  "qoder-user" and Qoder CN rejected it with "Login expired" (105).
- Normalize the system prompt to a plain string. OMP supplies it as a
  single-element content array which Qoder's MessagesInputDto#content
  (String) rejects with 400 "Execution failed: set property" on qwen models.
- Drop the modifyModels hook. OMP (Bun) structuredClones the whole model
  catalog before invoking it, and its bundled catalog is not cloneable,
  which removed qoder from `omp models`.
- Make the build script cross-platform: use esbuild on PATH instead of a
  Unix-style ./node_modules path that fails on Windows cmd.exe.
2026-08-18 12:22:47 +08:00
dependabot[bot]andGitHub b3afbfce2b build(deps): bump undici in the npm_and_yarn group across 1 directory
Bumps the npm_and_yarn group with 1 update in the / directory: [undici](https://github.com/nodejs/undici).


Updates `undici` from 8.5.0 to 8.9.0
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v8.5.0...v8.9.0)

---
updated-dependencies:
- dependency-name: undici
  dependency-version: 8.9.0
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-08 03:41:21 +00:00
Loongphy 6d9635e52c fix: pi.extensions path should point to dist/index.js instead of src/index.ts
The "files" field in package.json only includes "dist" and "README.md",
so src/index.ts is not available in the published npm package.

This was introduced in commit 1b110a6 ("fix index") which changed
the path from the correct "./dist/index.js" to "./src/index.ts".
2026-07-31 06:37:45 +08:00
Simon Shi c97e372d08 chore: bump version to 0.3.0 2026-07-30 19:16:29 +08:00
liyanan 1b110a6291 fix index 2026-07-28 15:46:08 +08:00
liyanan 273368fc0e fix: prevent provider_error 400 on dmodel/ultimate by using content placeholder
When assistant messages contain only tool_calls (no text/thinking), transform.ts
was setting content to null. Qoder's gateway drops these null-content assistant
messages, orphaning the following tool_result and causing upstream rejections:
- dmodel (OpenAI): 'tool must follow a message with tool_calls'
- ultimate (Anthropic): 'unexpected tool_use_id in tool_result blocks'

Analysis of 28 historical sessions showed 100% failure rate on dmodel and 75%
on ultimate for this pattern, while auto/GLM5.2 (GLM upstream) tolerated it.

Fix: inject a single-space placeholder when tool_calls are present but content
is empty, so the gateway preserves the assistant message and tool pairing stays
valid.

Also fixes pre-existing lint formatting in stream.ts and package.json.
Adds regression test for the full assistant+toolResult pairing scenario.
2026-07-26 15:26:13 +08:00
Simon Shi 077e651fc7 fix: expose full Qoder model catalog 2026-07-22 20:06:05 +09:00
Simon Shi ef672a5461 fix: refresh Qoder models before startup 2026-07-22 19:54:46 +09:00
Simon Shi 55e87cbdef fix: stop adding auto as Qoder model fallback 2026-07-22 19:42:46 +09:00
Simon Shi 1c44a09141 fix: safely handle missing AuthStorage export and bump version to 0.2.6 2026-07-22 13:03:48 +08:00
Simon Shi 5ce99b0261 fix: publish 0.2.5 from npm registry 2026-07-20 22:29:18 +09:00
Simon Shi e1cfff3ecf fix: release 0.2.4 with Node 24 2026-07-20 22:27:15 +09:00
Simon Shi ab34573e82 chore: bump version to 0.2.3 2026-07-20 20:56:14 +08:00
Simon Shi c83fa0b8f3 test: add unit tests and remove dead code
- Add vitest with 98 tests across 6 test files covering:
  - cosy.ts: URL builders, mode detection, model name mapping
  - thinking-parser.ts: ThinkingTagParser with all tag variants and chunked streaming
  - transform.ts: getContentText, transformTools, transformMessagesForQoder
  - pat.ts: isPatRefresh, encodePatRefresh/decodePatRefresh roundtrip
  - qoder-encoding.ts: custom encoding correctness and edge cases
  - models.ts: static model definitions integrity checks

- Remove dead code:
  - QODER_CN_DIRECT_BASE_URL (unused export in cosy.ts)
  - THINKING_START_TAG / THINKING_END_TAG (unused constants in thinking-parser.ts)

- Add test/test:watch scripts to package.json
2026-06-27 20:03:05 +08:00
Simon Shi 2d6e1c660b chore: bump dependencies for security fixes 2026-06-26 14:50:39 +08:00
dependabot[bot]andGitHub 00be927ed5 build(deps-dev): bump esbuild
Bumps the npm_and_yarn group with 1 update in the / directory: [esbuild](https://github.com/evanw/esbuild).


Updates `esbuild` from 0.25.12 to 0.28.1
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2025.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.12...v0.28.1)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.28.1
  dependency-type: direct:development
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-16 05:40:33 +00:00
Simon Shi 26be3e0e17 refactor: optimize model cache updates by moving to session_start hook & bump to 0.2.1 2026-06-16 13:39:24 +08:00
Simon Shi 8fb093bac0 release: v0.2.0 2026-06-16 13:39:20 +08:00
Simon Shi bcaa66091e fix: route PAT login through pi LoginDialog callbacks
The custom ctx.ui.custom login menu stole focus from pi's built-in
LoginDialog, so onPrompt never received keystrokes and PAT login
silently failed with 'No API key found'. Drive login via the provided
onPrompt/onAuth/onProgress callbacks instead, and drop login-ui.ts and
the now-unused pi-tui dependency. Also clears remaining lint warnings
by removing any-casts in models/oauth/stream/transform.
2026-06-16 13:39:16 +08:00
Simon Shi 0a4a0ddd97 release: v0.1.2 2026-06-16 13:39:09 +08:00
Simon Shi da9677e68e fix: add repository metadata required for npm provenance 2026-06-16 13:39:06 +08:00
Simon Shi fdbc00fdcc release: v0.1.1 2026-06-16 13:39:03 +08:00
Simon Shi 032cf51904 refactor: drop redundant credentials cache and unused deps
- stream: passively rebuild stale/missing models cache on request
- oauth: read identity from pi's auth.json instead of self-managed cache
- deps: remove unused js-tiktoken; move esbuild to devDependencies
2026-06-16 13:38:55 +08:00
Simon Shi dd8c313984 feat: init pi-provider-qoder plugin with oauth, signature and WAF bypass 2026-06-16 13:38:48 +08:00