Commit Graph

3898 Commits

Author SHA1 Message Date
Mario Zechner
f4efeb2ba5 Release v0.71.0 2026-05-01 01:03:02 +02:00
Mario Zechner
8db0d28389 chore(coding-agent): remove Qwen CLI extension example 2026-05-01 01:01:54 +02:00
Mario Zechner
879e46a995 docs(coding-agent): add Cloudflare gateway feature changelog
Closes #3856
2026-05-01 00:58:33 +02:00
Mario Zechner
a45577bd00 fix(ai): finalize cloudflare gateway provider support 2026-05-01 00:56:05 +02:00
MC
24fb6b833b feat(ai): add Cloudflare AI Gateway as a provider (#3856)
* feat(ai): add Cloudflare AI Gateway as a provider

Routes through Cloudflare's Unified API (`/compat`) for Workers AI and
Anthropic models, and through the provider-specific `/openai` subpath
for OpenAI models so reasoning models (gpt-5.x, o-series) can hit
`/v1/responses` natively. Once `/compat` adds Responses-API support,
the OpenAI subpath can be folded back in.

Catalog layout:
  workers-ai/@cf/...  -> openai-completions, gateway/.../compat
  anthropic/...       -> openai-completions, gateway/.../compat
  <native-id>         -> openai-responses,   gateway/.../openai
                         (gpt-5.1, claude-... no, sorry: gpt-5.x and o-series only;
                          prefix stripped because the OpenAI SDK posts native ids)

Touches:
  packages/ai/src/types.ts                       add cloudflare-ai-gateway to KnownProvider
  packages/ai/src/env-api-keys.ts                map to CLOUDFLARE_API_KEY
  packages/ai/src/providers/cloudflare.ts        add CLOUDFLARE_AI_GATEWAY_COMPAT_BASE_URL
                                                 and CLOUDFLARE_AI_GATEWAY_OPENAI_BASE_URL
  packages/ai/src/providers/openai-responses.ts  one-line dispatch through resolveCloudflareBaseUrl
                                                 (matches what openai-completions.ts already does)
  packages/ai/scripts/generate-models.ts         branch openai/* vs workers-ai/anthropic/*
  packages/ai/src/models.generated.ts            spliced 34 entries
  packages/ai/test/stream.test.ts                3 e2e blocks (one per upstream)
  packages/coding-agent/*                        defaultModelPerProvider, login, env docs,
                                                 README, providers.md

Verified end-to-end against a real Cloudflare account with unified
billing: 9/9 e2e tests pass across all three upstreams (Workers AI
Kimi K2.6, OpenAI gpt-5.1 reasoning, Anthropic claude-sonnet-4-5).

* refactor(ai): move AI Gateway User-Agent and per-route session-affinity flag to catalog

Mirrors the same per-model metadata refactor done for Workers AI in the
parent branch. All cloudflare-ai-gateway entries get the User-Agent
header. Only workers-ai/* gateway entries set
`compat.sendSessionAffinityHeaders: true` because the gateway
forwards that header to the underlying Workers AI runtime; anthropic/*
upstream and openai/* (openai-responses) don't use it.

  packages/ai/scripts/generate-models.ts: emit headers (always) and
  per-upstream compat (workers-ai only) on each cloudflare-ai-gateway
  entry.
  packages/ai/src/models.generated.ts: re-spliced 35 entries with
  headers + conditional compat.

Behavior unchanged - 9/9 e2e tests pass across all three upstream
families.

* fix(ai): align AI Gateway with telemetry-aware UA helper

Adapts to badlogic/pi-mono#3851's follow-up fix ("honor telemetry for
Cloudflare attribution headers", fbb5eed) which moved the
'User-Agent: pi-coding-agent' header out of per-model catalog metadata
and into a centralized telemetry-honoring helper
(coding-agent/src/core/sdk.ts:getAttributionHeaders).

- packages/coding-agent/src/core/sdk.ts: extend the cloudflare branch of
  getAttributionHeaders to also match cloudflare-ai-gateway and
  gateway.ai.cloudflare.com.

- packages/ai/scripts/generate-models.ts and src/models.generated.ts:
  drop 'headers' from the 35 cloudflare-ai-gateway entries (constant
  CLOUDFLARE_STATIC_HEADERS no longer exists). Per-route
  compat.sendSessionAffinityHeaders is unchanged.

End-to-end behavior unchanged: 9/9 tests still pass across all three
upstream families (Workers AI, Anthropic, OpenAI Responses).

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-30 23:29:37 +02:00
Mario Zechner
c9ddca1968 docs: note removed Google provider support as breaking 2026-04-30 23:29:12 +02:00
Mario Zechner
bd429f7c7d test(coding-agent): update stale expectations 2026-04-30 23:17:32 +02:00
Mario Zechner
23fce57ec6 fix(ci): install sandbox extension dependency 2026-04-30 23:10:08 +02:00
Mario Zechner
0b8452c32f fix(coding-agent): fix WSL clipboard image paste
closes #2469
2026-04-30 23:08:51 +02:00
Mario Zechner
04527355c5 docs: audit unreleased changelogs 2026-04-30 23:02:40 +02:00
Mario Zechner
0ed0d43439 remove mom and pods packages
People should check out pi-chat (earendil-works/pi-chat on GitHub), or use an older commit for mom and fork.
2026-04-30 23:01:19 +02:00
Mario Zechner
3ffc2b4306 fix(coding-agent): avoid duplicate blocked edit output
closes #3830
2026-04-30 22:50:40 +02:00
Mario Zechner
95ae590279 fix(coding-agent): refresh thinking border from extensions
closes #3888
2026-04-30 22:50:00 +02:00
Mario Zechner
f7df474084 fix google vertex unsigned tool call replay closes #4032 2026-04-30 21:59:21 +02:00
Mario Zechner
9600a0c030 chore: add session usage stats script 2026-04-30 21:47:51 +02:00
Mario Zechner
8191d59c17 feat(coding-agent): support session dir env
closes #4027
2026-04-30 21:37:53 +02:00
Mario Zechner
8632e1b948 fix(coding-agent): update agent package readme link
closes #4023
2026-04-30 21:32:53 +02:00
Mario Zechner
3d43d2e175 fix(coding-agent): stop tool argument injection
closes #4018
2026-04-30 21:31:43 +02:00
Mario Zechner
fe66edd943 remove gemini cli and antigravity support 2026-04-30 21:24:36 +02:00
Mario Zechner
40c6eabb8f feat(coding-agent): allow message_end replacements
closes #3982
2026-04-30 21:24:36 +02:00
pica
24dec9fcd5 fix(coding-agent): remove detached: true on Windows to fix pwsh.exe stdio (#4013)
On Windows, spawn(..., { detached: true }) prevents pwsh.exe (PowerShell) from
producing any stdout/stderr through pipe streams. This is because detached creates
a new process group which breaks pwsh's console host communication.

bash.exe and other cygwin/msys2 shells are unaffected by detached: true, but
they don't need it either -- on Windows, killProcessTree() already uses
taskkill /F /T /PID which kills the process tree by PID regardless of
whether the process was spawned detached.

The detached flag only matters on Unix, where kill(-pid, SIGKILL) requires a
process group that is only created via detached: true.

Fixes #4012
2026-04-30 20:59:02 +02:00
Armin Ronacher
7dc1bed478 feat(ai): add Moonshot AI provider model support 2026-04-30 17:21:03 +02:00
Mario Zechner
ebdf3cf451 Adjusts #3955, better error message 2026-04-30 12:33:02 +02:00
Ramiz Wachtler
43ee9b77ed fix(coding-agent): report edit access failures correctly (#3955)
* fix(coding-agent): report edit access failures correctly closes #3894

- classify edit and edit-preview access errors by errno
- add regressions for missing, permission, and fallback cases
- document the fix in the coding-agent changelog

* chore: get rid of CHANGELOG.md entry

* refactor(coding-agent): apply review suggestions - use single error msg

* refactor(coding-agent): clean up test cases
2026-04-30 12:31:29 +02:00
George Hilliard
0dd11898ad fix(coding-agent): redo Bun package manager node_modules handling (#3998)
* Revert "fix(coding-agent): use alternate logic to find Bun's node_modules (#3861)"

This reverts commit c241c6d6d0.  The logic
is faulty: the original strategy of looking for node_modules by asking
the package manager is not incorrect even on bun. Instead, it should
learn a different method of asking the package manager for node_modules
when the *package manager* is bun, not the *runtime*.

* feat(coding-agent): detect bun as package manager and use alternate root query

When `"npmCommand": ["bun"]` is configured in settings.json, pi fails to
start because it invokes `bun root -g`, which doesn't exist:

    error: Failed to run bun root -g: error: Script not found "root"

Add a (simple) check for Bun being used as package manager, and instead
build the relative path starting from Bun's bin directory.
2026-04-30 12:27:50 +02:00
Johannes Ebeling
779d0ef39d feat(ai): add Mistral Medium 3.5 model (#4009) 2026-04-30 12:18:17 +02:00
Armin Ronacher
904b843fee docs(coding-agent): clarify telemetry update checks 2026-04-30 11:04:20 +02:00
Mario Zechner
eb522d6c3c fix(ai): bump anthropic sdk for audit
closes #3992
2026-04-30 10:29:42 +02:00
Mario Zechner
32f7fc6aa5 fix(tui): respect environment terminal dimensions
closes #4004
2026-04-30 10:29:42 +02:00
Julien Chaumond
ab7dbd3091 docs: render logo in black on light-mode READMEs (#3812)
Use a <picture> element with prefers-color-scheme so the white logo on
pi.dev stays visible in dark mode and a black variant is shown in light
mode. GitHub's HTML sanitizer strips style attributes and inline SVG, so
the two-file pattern is the only reliable theme-aware approach.

Co-authored-by: julien-agent <Agents+cyolo@huggingface.co>
2026-04-30 10:18:23 +02:00
Mario Zechner
e91a303c59 fix(coding-agent): update clipboard dependency
closes #3946
2026-04-30 10:03:44 +02:00
github-actions[bot]
156a9052bc chore: approve contributor technocidal 2026-04-29 22:31:18 +00:00
github-actions[bot]
96015d984a chore: approve contributor louis030195 2026-04-29 22:28:21 +00:00
Alejandro
e354c521f4 feat(ai): expose routed model on openai-completions (#3968)
Adds `AssistantMessage.responseModel` on the openai-completions path:
surfaces the concrete `chunk.model` when it differs from the requested
id (e.g. OpenRouter `auto` -> `anthropic/...`).
2026-04-30 00:16:12 +02:00
Mario Zechner
cf5ec23240 feat(coding-agent): add provider display names
closes #3956
2026-04-30 00:10:38 +02:00
Mario Zechner
b79e7f8058 fix(coding-agent): support uppercase context files closes #3949 2026-04-29 23:47:04 +02:00
Mario Zechner
2fa7c2ef2f fix(coding-agent): use compacted context for handoff
closes #3945
2026-04-29 23:38:47 +02:00
Mario Zechner
d23cf31634 fix(ai): enable xhigh for DeepSeek V4 Flash
closes #3944
2026-04-29 23:32:02 +02:00
Mario Zechner
83592bb2df fix(ai): detect incomplete Anthropic streams
closes #3936
2026-04-29 23:30:29 +02:00
Mario Zechner
d698647b12 feat(coding-agent): add composable editor factory access
closes #3935
2026-04-29 23:26:25 +02:00
Mario Zechner
c1dd6082ee fix(ai): apply DeepSeek V4 reasoning compat
closes #3940
2026-04-29 23:25:03 +02:00
Mario Zechner
39146f3296 fix(coding-agent): clear idle follow-up submissions
closes #3926
2026-04-29 23:16:09 +02:00
Mario Zechner
20ca45d574 fix(tui): skip Thai AM normalization when absent
closes #3904
2026-04-29 23:04:46 +02:00
Mario Zechner
338ce3a365 fix(tui): normalize Thai AM terminal output
closes #3904
2026-04-29 23:01:04 +02:00
Mario Zechner
84b3aa5efc Updated model defs 2026-04-29 22:58:56 +02:00
Mario Zechner
bc668826ed fix(tui): handle Thai Sara Am width
closes #3904
2026-04-29 22:58:19 +02:00
Mario Zechner
ae81deb4c3 fix(ai): correct DeepSeek V4 pricing metadata
closes #3910
2026-04-29 22:58:19 +02:00
github-actions[bot]
43848e74ff chore: approve contributor Phoen1xCode 2026-04-29 20:54:27 +00:00
Mario Zechner
c84cfc77e6 fix(coding-agent): update sandbox lodash lockfile
closes #3901
2026-04-29 22:52:01 +02:00
Mario Zechner
d935a0f4f8 Closes #3900 2026-04-29 22:44:02 +02:00