Commit Graph
69 Commits
Author SHA1 Message Date
8d26dbd374 feat(models): add reasoning support for meta/muse-spark-1.3 and 1.3-contributor (#80)
Muse Spark 1.3 and 1.3-contributor are discoverable via the Provider API
but Pi showed "Current model does not support thinking" because the
generated catalog had no reasoning flag or selectable efforts.

Reuse the existing Muse Spark manual override mechanism:
- add reasoning flags and image modalities for both ids to the generated
  catalog (CLI 1.40.1 snapshot follows the same pattern as 1.1/1.2)
- add a manual effort override of [minimal, low, medium, high, xhigh]
  in src/commandcode-catalog-overrides.ts, merged over the generated
  catalog at load time (same set as 1.1/1.2/1.2-contributor, no max)

Pi selected thinking levels now map to reasoning_effort via the
existing generic thinkingMetadataForModel / mappedReasoningEffort path;
no model-specific transport logic is needed.

Tests: typecheck, test-models (override merge + thinking metadata),
test-model-metadata-check, test-pure-functions, test-pricing, test-cost,
test-stream (reasoning_effort mapping), test-runtime, test-transport all pass.
No live Command Code API test was performed.

Co-authored-by: heie54 <14918606+heie54@user.noreply.gitee.com>
Co-authored-by: Patrick Wozniak <email@patwoz.de>
2026-09-03 13:30:09 +02:00
f9879a20ee chore(models): sync Command Code catalog (#81)
Co-authored-by: patlux <4481570+patlux@users.noreply.github.com>
2026-09-03 13:27:02 +02:00
9296d3dc31 fix(auth): stop the API key placeholder from shadowing Oh My Pi /login credentials (#78)
Oh My Pi kept the unresolved $COMMAND_CODE_API_KEY placeholder as a literal config API key that shadowed its /login credential store and was sent as the Bearer token (401). The placeholder is now registered only on pi, where it keeps the API-key auth method and --api-key working next to OAuth; on OMP the provider omits apiKey unless a real key is configured. Host-supplied placeholders are resolved or stripped on every stream path, and the legacy generate transport uses the same rule.

Stored /login OAuth and API-key credentials, --api-key, and env keys are now covered end to end on both pi and Oh My Pi, and CI runs the pi suite against a real binary.

Co-authored-by: ebreen <ebreen@users.noreply.github.com>
2026-09-02 22:43:23 +02:00
Patrick Wozniak d3c9832d28 feat(models): move manual reasoning efforts into a catalog override
PR #69 added efforts for meta/muse-spark-* directly to the generated
catalog, which the drift check flags and the daily sync job reverts.

Keep src/commandcode-catalog.ts byte-identical to upstream and merge a
separate src/commandcode-catalog-overrides.ts over it at load time. A
test fails as soon as upstream publishes efforts for an overridden model
so the override gets removed instead of shadowing the CLI catalog.

Verified against the live endpoint: pi --thinking xhigh sends
reasoning_effort="xhigh" for meta/muse-spark-1.2-contributor and the
request succeeds; --thinking off sends none.

Closes #69
2026-09-02 00:03:45 +02:00
Patrick Wozniak df4f4a6eef Merge pull request #69 from hjshin-ubob/fix/muse-spark-thinking-levels
feat(catalog): add reasoning efforts for meta/muse-spark-1.1/1.2/contributor

# Conflicts:
#	src/commandcode-catalog.ts
2026-09-01 23:43:29 +02:00
Patrick Wozniak 59322e4ffa perf(models): start from the cached catalog and refresh in the background
Every host start awaited a full catalog request before the provider
registered, costing one HTTPS round-trip (up to the discovery timeout on a
hanging connection) even when a cache written seconds earlier was on disk.

Register the cached catalog immediately and run the live refresh in the
background; the live result re-registers the provider when it arrives. A
first start without a cache still awaits the live catalog. The background
refresh is aborted on session_shutdown so print mode does not wait for it.

Closes #63

(cherry picked from commit 142191f9420fe90460cdc3cbae70e26d0c000860)
2026-09-01 23:29:33 +02:00
Patrick Wozniak f17cec0eee fix(pricing): refresh catalog pricing snapshot
Verify display pricing against the official pricing page and the live
provider model list:

- add claude-fable-5-1 and deepseek/deepseek-v4-flash-fast
- remove minimax/minimax-m3-free and minimax/minimax-m2.7-free, which the
  provider no longer lists
- end the claude-sonnet-5 introductory window; the listed rate is unchanged
- google/gemini-3.7-flash returns to list price after the promotion ended
2026-09-01 23:29:16 +02:00
Patrick Wozniak b6e0e07c01 feat(models): sync model catalog with command-code@1.40.1
Add claude-fable-5-1, deepseek/deepseek-v4-flash-fast, and
tencent/hy4-preview with their reasoning efforts, add moonshotai/Kimi-K3
efforts, and drop minimax/minimax-m3-free, which the CLI no longer lists.
2026-09-01 23:29:16 +02:00
Patrick Wozniak 090d5e5310 Merge pull request #65 from ThomasByr/main
feat(models): add GLM5.3-Flash and Qwen3.8-Flash

# Conflicts:
#	CHANGELOG.md
2026-09-01 23:27:37 +02:00
Patrick Wozniak 711b342ddd Merge pull request #48 from warc0s/fix/omp-developer-messages
fix(core): preserve developer messages
2026-09-01 23:27:26 +02:00
hjshin-ubob 37cfd9fef8 feat(catalog): add reasoning efforts for meta/muse-spark-1.1/1.2/contributor
Maps the three Muse Spark models to [minimal, low, medium, high, xhigh]
so pi-ai can surface graded thinking levels instead of off-only.

These ids are already MODEL_REASONING=true; without MODEL_EFFORTS,
thinkingMetadataForModel() returns an empty map and the footer stays
:off with no cycle via /thinking or Shift+Tab.

Upstream command-code@1.32.2 lists these models as Efforts: — (none);
this commit intentionally adds a pi-side policy mapping aligned with
the opencode/opencode-go provider catalogs (which ship
muse-spark@ minimal..xhigh). The catalog header notes it is normally
generated by sync:commandcode-catalog — happy to move this to a
separate override layer if maintainers prefer.
2026-08-31 11:19:52 +09:00
Thomas Byr 21a2c05185 feat(pricing): refresh catalog pricing snapshot
Add the free minimax/minimax-m3-free and minimax/minimax-m2.7-free
promotional variants (free through September 5, 2026) and
tencent/hy4-preview, drop the retired stealth/ox-alpha, and refresh the
model-id and pricing snapshots to the current 62-model catalog verified
on 2026-08-28.
2026-08-28 16:41:15 +02:00
Thomas Byr b267241e33 feat(pricing): add display pricing for Qwen 3.8 Flash and GLM 5.3 Flash
Qwen/Qwen3.8-Flash lists $0.16 input, $0.47 output, and $0.016 cache read
per million tokens, and z-ai/glm-5.3-flash lists $0.15, $0.50, and $0.03;
the official pricing page documents no cache-write rate for either model.
2026-08-28 16:40:49 +02:00
Thomas Byr 5ac0dbeedd feat(models): add Qwen 3.8 Flash and GLM 5.3 Flash
Synchronize the static model catalog with command-code@1.36.0, which adds
Qwen/Qwen3.8-Flash (reasoning efforts low, medium, xhigh) and
z-ai/glm-5.3-flash (low, high, max), the free minimax/minimax-m3-free
model, and the glm-5.3-flash output limit, and drops the retired
stealth/ox-alpha.
2026-08-28 16:38:25 +02:00
José Antonio Galiano Sandoval d60934ebdc feat(core): display quota renewal date
Render subscription renewal dates and countdowns in quota output, normalize numeric period-end timestamps, and cover UTC and edge-case behavior.
2026-08-26 09:50:18 -06:00
warc0s 08a7e38089 merge main (0.6.0) into fix/omp-developer-messages
Align the developer-message fix with the Provider API transport router.
The fix stays scoped to the legacy /alpha/generate converter, and the
OMP advisory compat test now forces the upgrade_required fallback so the
advisory is asserted on the generate request body.
2026-08-25 22:52:02 +02:00
Patrick Wozniak 45281d693e fix(core): omit historical images for text models 2026-08-25 17:46:41 +02:00
Patrick Wozniak 98ed83fc9c merge main into fix/tool-call-streaming 2026-08-25 17:18:02 +02:00
Patrick Wozniak a624643d90 fix(stream): forward incremental tool-call arguments 2026-08-25 16:58:29 +02:00
Patrick Wozniak ad307c93fd fix(stream): remove redundant completion guard 2026-08-25 16:56:19 +02:00
Patrick Wozniak 6a7a71e206 fix(auth): support official Command Code environment names 2026-08-25 15:54:29 +02:00
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 3d8758fe3b feat(models): generate Command Code catalog snapshot 2026-08-25 15:08:22 +02:00
Patrick Wozniak 003d571b5e fix(models): refresh Command Code capabilities 2026-08-25 14:12:00 +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 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 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 864538e146 fix(ci): satisfy provider audit checks 2026-08-18 11:01:12 +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
warc0s 16eb5a8dda fix(core): preserve developer messages
OMP converts custom and hook messages (advisor notes, todo reminders,
retry nudges) to role "developer" before calling the provider.
messagesToCC() only handled user, assistant, and toolResult, so those
messages were dropped before params.messages was sent to
/alpha/generate. Steering still interrupted pending tools, but the
model never saw the message content.

/alpha/generate has no developer role: the official command-code CLI
(0.32.3) only emits user, assistant, and tool messages plus a separate
params.system. Forward developer messages as user messages with
identical content in the same chronological position. Hoisting them
into params.system would turn a mid-conversation note into a global
top-priority instruction.
2026-08-17 09:03:32 +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 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 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 947915df55 fix(models): refresh model pricing 2026-08-04 13:46:26 +02:00
Patrick Wozniak 1579bfd4be fix(deps): use host-provided pi core packages 2026-08-04 02:13:06 +02:00
IfkumRfnl 69ba0da305 fix(stream): correct cached input accounting 2026-08-03 05:49:31 +00: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