Commit Graph

2583 Commits

Author SHA1 Message Date
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
Armin Ronacher
904b843fee docs(coding-agent): clarify telemetry update checks 2026-04-30 11:04:20 +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
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
d698647b12 feat(coding-agent): add composable editor factory access
closes #3935
2026-04-29 23:26:25 +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
c84cfc77e6 fix(coding-agent): update sandbox lodash lockfile
closes #3901
2026-04-29 22:52:01 +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
9848b3145a fix(coding-agent): fix Windows self-update
Fixes #3857
2026-04-28 10:03:00 +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
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
Mario Zechner
3e40429b09 Release v0.70.5 2026-04-27 21:50:31 +02:00
Mario Zechner
01e2536879 fix(coding-agent): prevent wrapped padding in HTML export 2026-04-27 21:49:46 +02:00
Mario Zechner
2dd6399b71 Add [Unreleased] section for next cycle 2026-04-27 21:45:48 +02:00
Mario Zechner
0ec122f5da Release v0.70.4 2026-04-27 21:44:48 +02:00
Mario Zechner
2c08775ee7 fix(coding-agent): fix packaged session selector import 2026-04-27 21:44:00 +02:00
Mario Zechner
bd55c7a728 Add [Unreleased] section for next cycle 2026-04-27 21:29:40 +02:00
Mario Zechner
24321b47c9 Release v0.70.3 2026-04-27 21:27:16 +02:00
Mario Zechner
69206f5390 chore: audit unreleased changelogs 2026-04-27 21:25:57 +02:00
Mario Zechner
b8238a77a5 fix(coding-agent): tighten HTML export tool spacing 2026-04-27 21:18:34 +02:00
Mario Zechner
ea90a6783d fix(coding-agent): disable undici body/headers idle timeouts on global dispatcher
Long local-LLM SSE streams (e.g. vLLM buffering large tool calls) exceeded
undici's default 300s bodyTimeout and aborted with UND_ERR_BODY_TIMEOUT.
retry.provider.timeoutMs cannot lift this cap because it controls the
provider SDK's AbortController deadline, not undici's per-socket idle timer.

Pass { bodyTimeout: 0, headersTimeout: 0 } to EnvHttpProxyAgent. Provider
SDKs still enforce their own timeouts via retry.provider.timeoutMs.

closes #3715
2026-04-27 20:42:37 +02:00
Mario Zechner
aefb0fedfe feat(coding-agent): add warnings.anthropicExtraUsage opt-out
closes #3808
2026-04-27 20:36:00 +02:00
Mario Zechner
e4f847ff68 fix(coding-agent): close bash executor temp streams
closes #3786
2026-04-27 20:36:00 +02:00
marcbloech
9dcde1e3fa add cognitive services implementation (#3799) 2026-04-27 18:38:03 +02:00
mdsjip
5b8deef2f9 fix(coding-agent,ai): fallback to /proc/self/environ in Bun sandbox (#3801)
Bun compiled binaries have an empty process.env when running inside
sandbox environments (e.g. nono on Linux/macOS). This broke API key
detection and model discovery because all process.env.* lookups returned
undefined.

- Add restoreSandboxEnv() helper that reads /proc/self/environ when Bun
  is detected and process.env is empty, populating process.env before
  any other code runs (coding-agent/src/bun/cli.ts entry point)
- Add getProcEnv() fallback in env-api-keys.ts for direct @mariozechner/pi-ai
  consumers that may not go through the coding-agent entry point
- Add unit tests for restoreSandboxEnv
2026-04-27 18:36:53 +02:00
mdsjip
cbe421f877 fix(coding-agent): work around Bun empty process.env inside sandbox (#3807)
Bun bug oven-sh/bun#27802 causes process.env to be empty when running inside a Linux sandbox (Landlock/seccomp).
This breaks npm resolution because PATH is missing, crashing pi on startup with:

  Failed to run npm root -g: Executable not found in $PATH: "npm"

Add getSandboxEnv() to read /proc/self/environ as a fallback on Linux when process.env has zero keys.
Pass this env to all spawn calls in package-manager.ts.
Also fix runCommandSync error handling: check result.error in addition to result.status, and include result.error?.message in the error text so spawn failures (e.g. ENOENT) produce useful diagnostics instead of "null".

Fixes #3806
2026-04-27 18:34:20 +02:00
Aliou Diallo
10425abb87 fix(coding-agent): dedupe symlinked resources (#3818)
* fix(coding-agent): dedupe symlinked resources

Fixes #3767

* refactor(coding-agent): extract canonicalizePath util for symlink resolution
2026-04-27 18:33:10 +02:00
Mario Zechner
c19e64a444 fix(coding-agent): refresh title after extension session rename
closes #3686
2026-04-25 17:20:26 +02:00
Mario Zechner
a363b668ac fix(coding-agent): clear tree navigation compaction state
closes #3688
2026-04-25 17:03:09 +02:00
Armin Ronacher
dcf2651631 feat(coding-agent): Add built-in update command (#3680) 2026-04-25 13:09:33 +02:00
Mario Zechner
0b271a2c4f fix(coding-agent): polish border status editor example
closes #3674
2026-04-24 23:24:38 +02:00
Mario Zechner
6580dae400 feat(coding-agent): allow hiding working loader
closes #3674
2026-04-24 23:17:43 +02:00
Armin Ronacher
02e694b580 doc: pi can read its own docs 2026-04-24 22:25:47 +02:00
Mario Zechner
91154d9757 fix: update stale CI test expectations 2026-04-24 20:22:16 +02:00