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.
- 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.
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".
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.
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.