Commit Graph
29 Commits
Author SHA1 Message Date
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
Fei Yan 93864879b2 docs: add 0.2.0 changelog entry and pricing section to README
Document the incremental reasoning-delta streaming, live display pricing,
and dynamic model fetch in CHANGELOG.md. Add a Pricing section to
README.md explaining the MODEL_COSTS overlay and how to update prices.
2026-05-27 07:32:50 +08:00
Fei Yan e8f7410a0a test(pricing): verify MODEL_COSTS entries and promotional notes
Add tests/test-pricing.ts to assert that known models have non-zero
pricing, promotional deals are documented in comments, and Claude models
include cache pricing. Fix test-pi-local to match against combined
stdout+stderr since pi may output model listing to either stream.
2026-05-27 07:32:50 +08:00
Patrick Wozniak cc05faa526 Release 0.1.1 2026-05-26 23:05:21 +02:00
Patrick Wozniak 5714e3863a Test dynamic Command Code model discovery 2026-05-26 21:51:54 +02:00
Patrick Wozniak b8853ab0d6 Add Command Code browser login fallback 2026-05-05 14:48:06 +02:00
Patrick Wozniak af2b316d84 style: configure prettier (no semicolons, trailing commas) 2026-05-05 14:02:41 +02:00
Patrick Wozniak e9853eb4a4 chore: add CI workflow (typecheck + prettier format check), tsconfig, and prettier formatting 2026-05-05 13:56:41 +02:00
Patrick Wozniak 3630b85298 Add pi CLI coverage with DeepSeek 2026-05-05 13:22:15 +02:00
Patrick Wozniak 145e2678b6 Test real Command Code core behavior 2026-05-05 13:22:05 +02:00
Patrick Wozniak 38deb03c6c test: add comprehensive stream integration tests (35+ cases) 2025-05-05 10:05:00 +02:00
Patrick Wozniak a4f7d5fda0 chore: add smoke test script for print + RPC mode validation 2025-05-04 20:00:00 +02:00
Patrick Wozniak b13da480fa test: add abort integration tests with mock HTTP server 2025-05-04 19:45:00 +02:00
Patrick Wozniak 2af822e79f test: add pure function unit tests (toJsonSchema, messagesToCC, toolsToJson, textContent) 2025-05-04 19:10:00 +02:00