Commit Graph

568 Commits

Author SHA1 Message Date
Mario Zechner
cf5ec23240 feat(coding-agent): add provider display names
closes #3956
2026-04-30 00:10:38 +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
Armin Ronacher
c745efc0d0 feat: Update check against pi.dev (#3877) 2026-04-28 12:48:27 +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
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
2c08775ee7 fix(coding-agent): fix packaged session selector import 2026-04-27 21:44:00 +02:00
Mario Zechner
aefb0fedfe feat(coding-agent): add warnings.anthropicExtraUsage opt-out
closes #3808
2026-04-27 20:36:00 +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
Armin Ronacher
dcf2651631 feat(coding-agent): Add built-in update command (#3680) 2026-04-25 13:09:33 +02:00
Mario Zechner
6580dae400 feat(coding-agent): allow hiding working loader
closes #3674
2026-04-24 23:17:43 +02:00
Armin Ronacher
39db145495 fix(coding-agent): show models.json auth in login selector 2026-04-24 17:28:40 +02:00
Mario Zechner
1e33492525 fix(coding-agent): harden clipboard copy
closes #3639
2026-04-24 12:55:58 +02:00
Mario Zechner
f2f03616ab fix(coding-agent): update provider auth guidance and defaults 2026-04-24 00:55:27 +02:00
Armin Ronacher
27c05b7faa feat(ui): Lower /scoped-models height to same as /models 2026-04-24 00:53:11 +02:00
Armin Ronacher
d4d3c2fd39 feat(login): More consistent styling 2026-04-24 00:30:31 +02:00
Armin Ronacher
40edf7ee06 fix: /model cancellation 2026-04-24 00:16:10 +02:00
Mario Zechner
6bb4a55524 fix(coding-agent): preserve final TUI frame on quit 2026-04-24 00:11:09 +02:00
Mario Zechner
19f2478599 fix(coding-agent): show shortcut conflict diagnostics on startup
closes #3617
2026-04-23 23:31:52 +02:00
Mario Zechner
c091aa732f fix(coding-agent): space first user message after notices
closes #3613
2026-04-23 22:16:40 +02:00
Mario Zechner
f0cf8a59d2 fix(coding-agent): handle stale extension contexts
fixes #3606
2026-04-23 22:07:13 +02:00
Armin Ronacher
e97051313d fix(coding-agent,ai): show env auth source in /login 2026-04-23 21:19:53 +02:00
Aliou Diallo
05e2e9d170 fix(coding-agent): strip trailing index.js|ts from extension labels in startup banner (#3596)
Strip `index.ts` and `index.js` from extension display paths in both
compact and expanded views of the startup banner. This makes the list more
readable by removing redundant filename noise.

Changes:
- Add `formatExtensionDisplayPath()` helper to centralize path formatting
- Update `getCompactExtensionLabels()` to strip index files from segments
- Update expanded view formatting to use the new helper
- Add comprehensive tests for both views

Fixes #3549
Fixes #3559
2026-04-23 21:03:26 +02:00
Vegard Stikbakke
ff220fa41d fix(coding-agent): tear down extension UI before runner invalidation on shutdown (#3597)
Custom footers registered via ctx.ui.setFooter(...) whose render()
closure touched ctx would crash pi on /quit: runtimeHost.dispose()
invalidates the extension runner before the TUI stops rendering, so
any still-attached footer render tick hit assertActive() and threw.

Call resetExtensionUI() before runtimeHost.dispose() in the interactive
shutdown path, matching the rebindCurrentSession() pattern. This
disposes the custom footer (clearing its interval) and detaches it
from the TUI tree before the runner goes stale.

closes #3595

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-23 21:02:15 +02:00
Mario Zechner
8cc046f86e fix(coding-agent): make terminal progress escape sequences configurable, disabled by default
Adds terminal.showTerminalProgress setting (default false) and wires it
to /settings. Guards all OSC 9;4 setProgress calls in interactive-mode.

closes #3588
2026-04-23 15:08:00 +02:00
Armin Ronacher
010e9acfe9 feat(coding-agent): add searchable auth provider login flow (#3572) 2026-04-23 13:42:09 +02:00
Julian LaNeve
de8c947556 fix(coding-agent): route remaining hardcoded pi branding through APP_NAME (#3583)
Swaps hardcoded "pi" / ".pi" / "π" for the existing APP_NAME and
CONFIG_DIR_NAME extension points at four sites the original APP_NAME
rollout missed:

- /quit slash-command description
- process.title (cli.ts and bun/cli.ts)
- project-local extensions dir in loader.ts

For the terminal title, adds an APP_TITLE export in config.ts that
keeps pi's "π" glyph when piConfig.name is unset and falls back to
APP_NAME otherwise. Presence of piConfig.name acts as the "has been
rebranded" signal, so pi's own package.json drops the redundant
"name": "pi" (the existing `|| "pi"` fallback in config.ts makes this
a no-op for APP_NAME).

No behavior change for pi itself: process.title, /quit description,
terminal title prefix, and project-local extensions dir all resolve
to the same values as before.

closes #3476
2026-04-23 12:27:00 +02:00
Mario Zechner
f3a2c9d05e fix(coding-agent,mom): retry fs watchers on async errors closes #3564 2026-04-22 23:03:19 +02:00
Mario Zechner
cc76e73c05 fix(coding-agent): persist custom working message across loader recreation
Replace transient pendingWorkingMessage with a persistent workingMessage
field on InteractiveMode, matching the workingIndicatorOptions pattern.
New loaders now use this.workingMessage || this.defaultWorkingMessage
instead of always falling back to the default.

Also add working-message-test.ts extension example.

closes #3566
2026-04-22 22:24:32 +02:00
Armin Ronacher
35ff2689ee fix(typebox): migrate to v1 with extension compat (#3474)
* fix(typebox): migrate to v1 with extension compat

Replace AJV-based validation with TypeBox-native validation, keep legacy extension imports working (including @sinclair/typebox/compiler), and restore coercion for serialized/plain JSON schemas.

This change closes #3112.

* fix(typebox): use canonical imports and harden coercion

Switch first-party code to canonical typebox imports while retaining legacy extension aliases in the loader.

Remove obsolete runtime codegen guards, expand serialized JSON-schema coercion coverage, and update related tests and fixtures.

Fixes #3112.

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-22 19:59:33 +02:00
Mario Zechner
8234ebf9ee feat(coding-agent,tui): add stacked autocomplete providers closes #2983 2026-04-22 15:44:08 +02:00
Mario Zechner
1cc303d053 fix(coding-agent): add replacement-session callbacks closes #2860 2026-04-22 12:13:54 +02:00
Mario Zechner
a900d25119 feat(tui,coding-agent): add OSC 9;4 terminal progress indicators
Emit OSC 9;4 progress start/end sequences during agent streaming and
compaction so terminals (iTerm2, WezTerm, Windows Terminal, Kitty, etc.)
show activity in their tab bar.

Made with love for @lucasmeijer
2026-04-22 11:55:52 +02:00
Mario Zechner
97a38bf652 fix(coding-agent): configure inline tool image width
closes #3508
2026-04-22 00:56:01 +02:00
Mario Zechner
5a4e22ea44 fix(coding-agent): remove process-cwd tool singletons and use tool-name allowlists
- switch SDK/CLI tool selection to name-based allowlists
- apply allowlists across built-in, extension, and SDK tools
- remove ambient process.cwd defaults from core tooling and resource helpers
- update tests, examples, and TUI callers for explicit cwd plumbing
- add regression coverage for extension tool filtering

closes #3452
closes #2835
2026-04-20 22:05:28 +02:00
Mario Zechner
74139c3f66 feat(coding-agent): add configurable working indicator closes #3413 2026-04-20 16:28:39 +02:00
Mario Zechner
61579214c8 fix(coding-agent): handle symlinked session selector paths closes #3364 2026-04-20 16:25:12 +02:00
Mario Zechner
860d67518c fix(coding-agent): clarify session ID docs closes #3390 2026-04-20 16:12:32 +02:00
Marek Pazik
d4e2e563ae feat(coding-agent): make scoped models and tree filter shortcuts configurable (#3343)
- Add app.models.{save,enableAll,clearAll,toggleProvider,reorderUp,reorderDown}
- Add app.tree.filter.{default,noTools,userOnly,labeledOnly,all,cycleForward,cycleBackward}
- Migrate scoped-models-selector cancel to tui.select.cancel
- Prefer reserved actions on key collision in extension shortcut conflict check
2026-04-20 14:35:30 +02:00
Mario Zechner
d554409b1f fix(coding-agent): split /clone from /fork UX
closes #2962
2026-04-20 14:33:32 +02:00
Mario Zechner
62c1c4031c fix(coding-agent): add OpenRouter attribution headers
closes #3414
2026-04-20 14:14:36 +02:00
Armin Ronacher
23569e304b feat(coding-agent): add fork position and duplicate session option (#3431) 2026-04-20 14:13:34 +02:00
Mario Zechner
0bb4ccf11f fix(coding-agent): keep scoped-model reorder inert in implicit all-enabled state closes #3331 2026-04-17 16:58:49 +02:00
Armin Ronacher
32a305cb9b fix(coding-agent): disambiguate compact extension labels
closes #3308
2026-04-17 09:46:47 +02:00
Mario Zechner
36bffc1d13 fix(coding-agent): restore /import error flow and document throws 2026-04-17 00:59:53 +02:00
Mario Zechner
3ba0d85fa2 fix(coding-agent): restore assistant/user turn spacing 2026-04-17 00:52:14 +02:00
Mario Zechner
b2ed851e84 Merge branch 'main' of https://github.com/badlogic/pi-mono
# Conflicts:
#	packages/coding-agent/CHANGELOG.md
2026-04-17 00:28:14 +02:00
Mario Zechner
b0490310c3 fix(coding-agent): stabilize user message OSC 133 padding closes #3090 2026-04-17 00:22:39 +02:00
Armin Ronacher
165603189b fix(coding-agent): parse quoted import paths and missing files 2026-04-17 00:02:14 +02:00