Commit Graph
63 Commits
Author SHA1 Message Date
Patrick Wozniak c51a790530 fix(stream): match Command Code CLI transport behavior 2026-08-25 15:54:18 +02:00
Patrick Wozniak 349e50f829 fix(models): align Command Code catalog metadata 2026-08-25 15:54:09 +02:00
Patrick Wozniak 41e98a1d67 fix(models): keep generated sync scope reviewable 2026-08-25 15:09:54 +02:00
Patrick Wozniak 3d8758fe3b feat(models): generate Command Code catalog snapshot 2026-08-25 15:08:22 +02:00
Patrick Wozniak f23863d326 ci(models): check Command Code metadata daily 2026-08-25 14:14:44 +02:00
Patrick Wozniak 003d571b5e fix(models): refresh Command Code capabilities 2026-08-25 14:12:00 +02:00
Patrick Wozniak f5e2fece8c test(models): fix DeepSeek vision regressions 2026-08-25 13:54:33 +02:00
Patrick Wozniak d149c1f790 Merge remote-tracking branch 'origin/main' into review/pr-56 2026-08-25 13:53:48 +02:00
laijxa d14c2f0feb fix(models): add image support for deepseek-v4-flash-vision-exp
deepseek/deepseek-v4-flash-vision-exp is served by the Provider API but was
missing from the hardcoded MODEL_INPUT_MODALITIES allowlist, so pi rejected
any conversation containing an image block. Notably this also rejected images
returned by the read tool via toolResult:

  Error: Selected Command Code model does not support image content in tool results

Adding the allowlist entry lets modelSupportsImageInput() return true and the
converters forward images using the current Command Code wire format.

Coverage:
- regression test for modelSupportsImageInput("deepseek/deepseek-v4-flash-vision-exp")
- end-to-end stream test for a tool-result image forwarded as a following user
  image (the concrete read reproduction), not only a user-attached image
- end-to-end stream test asserting a text-only model still rejects tool-result
  images before any network access

Refs: https://github.com/patlux/pi-commandcode-provider/issues/54
2026-08-25 19:42:10 +08:00
Patrick Wozniak 96356698fa fix(quota): harden dashboard integration 2026-08-25 13:34:54 +02:00
Patrick Wozniak 63dd92da09 Merge remote-tracking branch 'origin/main' into review/pr-52
# Conflicts:
#	CHANGELOG.md
2026-08-25 13:33:55 +02:00
Thomas Byr d637a73e06 fix(docs): update Command Code version to 1.32.1 2026-08-22 23:25:06 +02:00
Thomas Byr 45565a883f feat(models): add GLM-5.3 pricing and reasoning levels 2026-08-22 23:24:49 +02:00
José Galliano 307714b051 feat(quota): add live commandcode-quota dashboard and OMP auth fix
Fetches live account quota from Command Code alpha usage endpoints
(whoami, billing/credits, billing/subscriptions, usage/summary) and
renders a plain-text dashboard via ui.notify.

- Graceful degradation: optional endpoint transport/timeout/parse
  failures degrade to null sections instead of aborting; only 401/403
  are hard failures. 429 is transient, not fatal.
- Overall deadline bounds the whole command to QUOTA_TIMEOUT_MS
  (per-request controllers are chained; post-deadline phases fail fast).
- OMP auth: filter unresolved $COMMANDCODE_API_KEY placeholder and fall
  back to the host resolver via pickCommandCodeApiKey.
- ZDR privacy header respected on quota requests.
- Redaction reuses redactCommandCodeErrorText plus JSON-quoted
  credential fields; outer-catch errors are redacted too.
- resetAt parsed from seconds, ms, numeric string, or ISO string.
- 21 hermetic unit tests wired into npm test (test:quota).
2026-08-21 11:21:25 -06:00
Patrick Wozniak f6f0ab274d fix(models): refresh DeepSeek V4 pricing 2026-08-20 00:13:56 +02:00
Patrick Wozniak ed29c59f31 fix(models): use adaptive thinking for Claude 2026-08-20 00:13:56 +02:00
Patrick Wozniak 4f91a9b00b fix(stream): isolate transport state by credential 2026-08-20 00:13:56 +02:00
Patrick Wozniak 75552ef4b9 test(e2e): add live account profiles 2026-08-18 17:20:44 +02:00
Patrick Wozniak 89dc21bed2 feat(api): fall back for go plan accounts 2026-08-18 12:11:47 +02:00
Patrick Wozniak 7af77ddf58 fix(models): refresh expired display pricing 2026-08-18 10:56:11 +02:00
Patrick Wozniak 84a802d91d feat(api): use official provider endpoints 2026-08-18 10:56:06 +02:00
Patrick Wozniak 0603291396 feat(auth): support direct api key login 2026-08-18 10:55:58 +02:00
Patrick WozniakandGitHub a367aed63c feat(models): add vision input capabilities (#43) 2026-08-11 00:28:03 +02:00
Patrick Wozniak ea55ead662 fix(stream): omit prior reasoning from request history 2026-08-07 16:39:18 +02:00
Patrick Wozniak 024a79dc44 Merge branch 'feat/request-fidelity' into test/provider-hardening-e2e 2026-08-07 14:37:42 +02:00
Patrick Wozniak 8541fe109a Merge branch 'feat/model-catalog-runtime' into feat/request-fidelity 2026-08-07 14:37:19 +02:00
Patrick Wozniak c0d126cb73 fix(models): sync reasoning efforts with command code cli 2026-08-07 14:37:04 +02:00
Patrick Wozniak af2a4d1759 test(tests): add provider hardening end-to-end coverage 2026-08-07 14:06:36 +02:00
Patrick Wozniak 7efca20d16 fix(core): preserve request fidelity and provider errors 2026-08-07 14:05:03 +02:00
Patrick Wozniak 7e9ecc563a feat(models): add model-aware runtime metadata 2026-08-07 14:03:24 +02:00
Patrick Wozniak 62e51ee9f5 Merge main into feat/isolated-pi-launcher 2026-08-07 10:02:22 +02:00
Patrick Wozniak b100d553c1 feat(tests): add isolated pi launchers 2026-08-07 09:55:02 +02:00
Patrick Wozniak 947915df55 fix(models): refresh model pricing 2026-08-04 13:46:26 +02:00
Patrick Wozniak 0e91395d7f test(deps): forbid pi core development copies 2026-08-04 02:13:06 +02:00
Patrick Wozniak 877a3003b1 perf(deps): remove local pi-ai runtime copy 2026-08-04 02:13:06 +02:00
Patrick Wozniak fb864f3d8e test(deps): prevent bundled pi core runtimes 2026-08-04 02:13:06 +02:00
Patrick Wozniak 9cff90340c test(stream): cover cached input fallbacks 2026-08-04 01:41:22 +02:00
IfkumRfnl 69ba0da305 fix(stream): correct cached input accounting 2026-08-03 05:49:31 +00:00
Patrick Wozniak e20953d890 test(models): cover recovery after empty offline start
Assert the empty catalog path recovers live models and writes a cache once discovery is available again, including the real pi extension entrypoint used by /reload.
2026-08-02 10:42:31 +02:00
Patrick Wozniak b1a60da6b4 fix(models): store cache in agent directory
Resolve the Command Code model cache through the host's getAgentDir helper so pi, OMP, and PI_CODING_AGENT_DIR use their own agent state directory instead of the official Command Code client directory.
2026-08-02 01:37:34 +02:00
Patrick Wozniak 070ef3c07a fix(models): cache catalog for offline startup
Persist the last valid Command Code model catalog and use it when live model discovery fails. Keep first-time offline startup non-fatal, surface clear warnings, and cover cached model selection with unit and pi integration regression tests.
2026-08-02 01:16:39 +02:00
Patrick WozniakandGitHub e123e84116 fix(omp): avoid unsupported calculateCost import
Fix OMP installation by removing the unsupported calculateCost runtime import from pi-ai.
2026-07-05 03:10:02 +02:00
Patrick Wozniak 221677b5ba fix(core): report retry timeouts clearly 2026-06-02 10:30:32 +02:00
jizhejiang 57bcdc7396 fix(core): address PR review on retry defaults and timeouts
Align provider maxRetries default with pi (0), treat maxRetryDelayMs 0 as
no cap, keep per-attempt timeout through stream reads, and fix gitleaks
test fixtures.
2026-06-02 16:15:19 +08:00
jizhejiang c3107dbc1c feat(core): add retry for transient HTTP and stream-level errors
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.
2026-06-02 11:38:10 +08:00
Patrick Wozniak 17175abd28 Bump CLI version header to 0.29.0 for API parity 2026-05-28 22:50:54 +02:00
Patrick Wozniak fe49146892 Merge remote-tracking branch 'origin/main' into fix/pr-7-review
# Conflicts:
#	index.ts
#	package.json
#	tests/test-pi-local.mjs
2026-05-28 22:07:51 +02:00
Patrick Wozniak 3fba807abf fix(stream): close thinking block before text or tool output
If upstream omits reasoning-end and starts emitting text-delta or
tool-call events, the thinking block remained open causing
thinking_start -> thinking_delta -> text_start -> ... -> thinking_end
ordering. Now endThinking() is called at the start of text-delta and
tool-call handlers so thinking_end always precedes text_start or
toolcall_start.

Adds 2 regression tests for the missing reasoning-end edge case.
2026-05-28 22:05:01 +02:00
wh.huajieyu e78875f532 refactor: clean up code formatting and update package dependencies
- Removed unnecessary blank lines and improved formatting for better readability in index.ts and converters.ts.
- Updated package-lock.json to downgrade several dependencies for compatibility, including @protobufjs/eventemitter, @protobufjs/fetch, and others.
- Enhanced error message in core.ts to clarify configuration options for the Command Code API key.
- Added a test to ensure the correct handling of environment variable values in test-stream.ts.
2026-05-28 06:23:28 -04:00
AlexVagrantandwh.huajieyu c2497ed098 feat: add OMP (Oh My Pi) provider compatibility
Support OMP as a host alongside pi:
- Convert OMP's array-format system prompts to string via systemPromptToText
- Guard against OMP passing the literal env-var name as the API key value
- Add ~/.omp/agent/auth.json to default auth path lookup
- Fix --list-models output to check both stdout and stderr
- Add OMP compatibility smoke test with isolated temp HOME and mock server
- Deduplicate usage section in README, add OMP install and usage docs
2026-05-28 04:12:35 -04:00