Commit Graph

3879 Commits

Author SHA1 Message Date
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
Mario Zechner
fc3cbedc6c fix(ai): track DeepSeek prompt cache hits
closes #3880
2026-04-29 16:37:39 +02:00
Mario Zechner
fe1381389d Add [Unreleased] section for next cycle 2026-04-28 19:34:40 +02:00
Mario Zechner
6b48e4ac6b Release v0.70.6 2026-04-28 19:33:29 +02:00
Mario Zechner
8732e28a37 docs: audit unreleased changelogs 2026-04-28 19:32:15 +02:00
Armin Ronacher
3edb8b5cb7 fix(agent): support fdfind as fd fallback 2026-04-28 17:52:14 +02:00
Armin Ronacher
c745efc0d0 feat: Update check against pi.dev (#3877) 2026-04-28 12:48:27 +02:00
Armin Ronacher
4166cfa921 docs(coding-agent): reorganize session docs 2026-04-28 12:06:21 +02:00
Armin Ronacher
f5477a4ff3 docs(coding-agent): add quickstart guide 2026-04-28 12:06:21 +02:00
Justin Barnett
57787b6557 fix(coding-agent): escape exported session metadata (#3883) 2026-04-28 11:46:42 +02:00
Armin Ronacher
ed4bc73080 fix(ai): normalize Bedrock model names for profiles 2026-04-28 11:23:31 +02:00
Armin Ronacher
9848b3145a fix(coding-agent): fix Windows self-update
Fixes #3857
2026-04-28 10:03:00 +02:00
Yves Jutard
946bee1946 doc(README): update "quick start" (#3740) 2026-04-28 08:48:21 +02:00
George Hilliard
c241c6d6d0 fix(coding-agent): use alternate logic to find Bun's node_modules (#3861)
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 check for the Bun runtime using the logic already used elsewhere,
and build the relative path starting from Bun's bin directory.
2026-04-28 08:28:37 +02:00
Mario Zechner
fbb5eed191 fix: honor telemetry for Cloudflare attribution headers 2026-04-27 23:49:14 +02:00
MC
d6e08b3da0 feat(ai): add Cloudflare Workers AI as a provider (#3851)
* feat(ai): add Cloudflare Workers AI as a provider

Cloudflare Workers AI hosts open-weight LLMs (Kimi K2.6, GPT-OSS,
GLM-4.7, Llama 4, Gemma 4, Nemotron 3) on Cloudflare's GPU network with
an OpenAI-compatible endpoint. Reuses the openai-completions API
protocol; the per-account URL contains a {CLOUDFLARE_ACCOUNT_ID}
placeholder resolved at request time by a small helper.

Pi automatically sets x-session-affinity for prefix caching:
https://developers.cloudflare.com/workers-ai/features/prompt-caching/

Auth: CLOUDFLARE_API_KEY (matches pi's *_API_KEY convention) +
CLOUDFLARE_ACCOUNT_ID. The User-Agent identifies traffic as
'pi-coding-agent' in Cloudflare analytics.

Verified end-to-end against a real Cloudflare account: 17 e2e tests
pass across stream/empty/tokens/unicode/tool-call-without-result/
total-tokens against @cf/moonshotai/kimi-k2.6.

Cloudflare AI Gateway is a separate, larger change (it requires routing
through provider-specific subpaths with the matching API protocol per
upstream) and will land in a follow-up PR.

* refactor(ai): move Cloudflare User-Agent and session-affinity flag to per-model metadata

Instead of conditionally setting them in openai-completions.ts based on
provider detection, declare them as model-level fields in the catalog
(headers + compat). This is consistent with how the github-copilot and
kimi-coding entries already declare their static headers.

  packages/ai/scripts/generate-models.ts: emit headers and compat fields
  on each cloudflare-workers-ai entry (CLOUDFLARE_STATIC_HEADERS).
  packages/ai/src/providers/openai-completions.ts: drop the
  isCloudflareProvider conditional that injected User-Agent and the
  isCloudflareWorkersAI override of sendSessionAffinityHeaders.
  packages/ai/src/models.generated.ts: re-spliced 8 cloudflare-workers-ai
  entries with headers + compat.

Behavior is unchanged - verified via fetch interceptor that User-Agent
and x-session-affinity / session_id / x-client-request-id are still sent
on outbound requests. 5/5 e2e tests pass.
2026-04-27 23:41:54 +02:00
github-actions[bot]
31b48dec23 chore: approve contributor mchenco 2026-04-27 21:23:54 +00:00
Justin Barnett
7617c1ad92 fix(coding-agent): escape exported image data (#3819)
Fixes #3811
2026-04-27 23:22:06 +02:00
Aliou Diallo
13610d3893 fix(coding-agent): show item count instead of line count in config scroll indicator (#3820) 2026-04-27 23:21:32 +02:00
Mario Zechner
084aa2b54d Add [Unreleased] section for next cycle 2026-04-27 21:51:29 +02:00