Commit Graph
652 Commits
Author SHA1 Message Date
Christian Klotz 0f997a599e docs(coding-agent): condense reload guidance 2026-08-11 12:57:41 +03:00
Christian Klotz 93c0e1a9b9 feat(coding-agent): defer extension runtime reloads
Fixes #6552
2026-08-11 12:55:12 +03:00
Vegard Stikbakke 9cb7f493e7 docs(coding-agent): document AI_AGENT process marker
closes #7747
2026-08-11 09:04:09 +02:00
Vegard Stikbakke 31b513e316 chore(docs): change a bullet point in compaction docs 2026-08-10 08:27:35 +02:00
Vegard Stikbakke 4761021709 chore(docs): change 'reloads' phrasing in compaction docs 2026-08-10 08:03:46 +02:00
Vegard Stikbakke 368e013dec chore(docs): fix ascii alignment in compaction docs 2026-08-08 12:22:47 +02:00
Mario Zechner 9dd90a4971 fix(ai): replace Mistral SDK with native transport 2026-08-08 09:32:49 +02:00
Armin Ronacher ac4ac9eaf6 feat(coding-agent): configure fullscreen exit output 2026-08-07 18:30:28 +02:00
Zhichao Li 4688e4f92f docs(coding-agent): reconcile keybinding behavior (#7729) 2026-08-07 00:11:39 +02:00
Armin Ronacher a3e93ec85e feat(tui): add half-page transcript scrolling
closes #7735
2026-08-06 22:30:13 +02:00
Mehmet Aras c03d78bdce feat(ai): add Qwen Token Plan Individual provider (#7659) 2026-08-06 17:18:02 +02:00
muyiyr 1eb988cfe8 feat(agent): allow blocked tool calls to terminate (#7715)
Closes #5998
2026-08-06 17:14:48 +02:00
Armin Ronacher 5446cd7545 feat(coding-agent): rename UI mode to TUI mode 2026-08-05 22:56:58 +02:00
Armin Ronacher 16ad96ae89 feat(tui): add configurable prompt history actions 2026-08-05 21:34:21 +02:00
m3 8ecf8a9883 feat(coding-agent): support AGENTS.override.md (#7681) 2026-08-05 21:24:31 +02:00
Alexey Zaytsev 66534fbdc7 feat(coding-agent): render Mermaid diagrams (#7624) 2026-08-05 09:43:24 +02:00
Armin Ronacher b0d382e25a fix(tui): add editor viewport key aliases (closes #7574) 2026-08-04 21:25:39 +02:00
Duncan Ogilvie 25a2c8dcfe Add support for generic sampling parameters (#7568) 2026-08-04 00:05:29 +02:00
Mario Zechner fed6009cc9 fix(coding-agent): make model refresh cancellation caller-owned
Add generation-safe catalog publication, cancellable auth and storage operations, locally consistent credential mutations, and cache-first interactive model flows.
2026-08-04 00:03:52 +02:00
Christian KlotzandMario Zechner a4475344fb fix(coding-agent): make JSON streaming output linear (#7394)
Fixes #7290

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-08-03 18:33:22 +02:00
Armin Ronacher b103937d3c feat(coding-agent): switch UI modes at runtime (#7555) 2026-08-03 17:32:48 +02:00
David Brailovsky c1019d9202 feat(ai): add Baseten provider
Closes #7405
2026-08-03 14:33:21 +02:00
Jeremy Gayed b0e05b4423 fix(coding-agent): resize images returned by tools (#7330)
Images produced by tools (extensions, MCP bridges, screenshot tools) went into
session history at full resolution because processImage was only wired to the
read tool and @file CLI attachments. Providers validate every image in the
request, so one oversized image poisons the whole conversation: Anthropic drops
its per-image cap from 8000px to 2000px once a request carries many images, and
every later turn re-sends the same payload. Switching models does not help.

Normalize tool result images in AgentSession.afterToolCall, after the extension
tool_result hook so extension-injected images are covered too. Honors
images.autoResize, and keeps the original block when processing fails so an
unavailable image backend does not delete tool output.

Refs #5369

Assisted-By: devx/86bf3b09-9aba-4d03-8154-50fca3ffc9b5
2026-08-03 14:02:03 +02:00
xu0o0 786c76cb76 docs(coding-agent): fix branch summary diagram (#7526) 2026-08-03 13:41:03 +02:00
Mario Zechner b70c0f5b4e Revert "feat(tui): add switchable terminal renderers (#7440)" (#7473)
This reverts commit 1fdf21621d.
2026-08-02 09:21:45 +02:00
Armin Ronacher 1fdf21621d feat(tui): add switchable terminal renderers (#7440)
Allow coding-agent UI modes to switch at runtime while preserving terminal, focus, input, and renderer state.
2026-08-02 09:21:17 +02:00
Armin Ronacher b3ed27b3fe feat(coding-agent): add scrollbar thumb theme color 2026-07-31 17:41:40 +02:00
Armin Ronacher 6129a353b1 feat(tui): add configurable fullscreen scrollbars 2026-07-31 17:17:02 +02:00
Armin Ronacher 3c717842e8 feat(tui): add fullscreen transcript navigation 2026-07-31 16:23:58 +02:00
Vegard Stikbakke f074efd921 feat(coding-agent): add ui mode setting 2026-07-31 15:33:52 +02:00
Mario Zechner ea1e77e2db feat(tui): add alternate-screen viewport layouts 2026-07-31 09:22:10 +02:00
Alexey ZaytsevandMario Zechner 714978bf51 Markdown api (#7231)
* feat(tui): export bundled Marked parser

* feat(coding-agent): add width-aware Markdown transformers

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-30 22:39:04 +02:00
Mario Zechner 2c30412420 fix(ai): support streams without finish reasons 2026-07-30 22:23:46 +02:00
Mario Zechner c13ffe1877 feat(tui): add alternate-screen renderer
Closes #7304
2026-07-30 12:59:48 +02:00
pungggiandngSoftware 04b15259b2 feat(extensions): expose ctx.scopedModels to extensions (#7191)
Extensions have no way to read the session's scoped model set (the models
resolved from --models / enabledModels against the available catalogue --
the same list /scoped-models shows). The only model surfaces on
ExtensionContext are ctx.model (active) and ctx.modelRegistry.getAvailable()
(the whole catalogue, unfiltered), so an extension that wants a scoped
model picker must either enumerate everything or re-implement pi's scope
resolution (minimatch on provider/modelId / bare modelId + enabledModels +
--models) from disk -- duplicating core logic.

Add ctx.scopedModels: readonly ScopedModel[] to ExtensionContext, mirroring
how ctx.model is exposed (field -> bindCore -> lazy getter in createContext()).
Empty when no scoping is configured (all available models usable). Each entry
is { model, thinkingLevel? }.

- types.ts: ExtensionContext.scopedModels + ExtensionContextActions.getScopedModels
- runner.ts: field, bindCore wiring, lazy scopedModels getter
- agent-session.ts: provide getScopedModels: () => this._scopedModels
- test: assert ctx.scopedModels reflects the action (default [] + live ref)
- docs/extensions.md: document the new field

Co-authored-by: ngSoftware <alessandro@pungitore.ch>
2026-07-28 08:31:01 +02:00
Rafael 61da9e2f37 feat(ai): add manual redirect URL fallback to OpenRouter OAuth login (#7114)
The OpenRouter PKCE flow only completed through the loopback callback
server, so remote/headless sessions (e.g. pi over SSH) could never
finish login: the browser runs on another machine and cannot reach
127.0.0.1 on the host running pi.

Race the callback server against a manual_code prompt, matching the
existing Anthropic and OpenAI Codex flows. Users can paste the final
redirect URL (or the bare authorization code) and the flow exchanges
it with the same PKCE verifier. A claimed callback keeps priority so
a pasted code cannot interrupt an in-flight exchange.

The callback server object follows the OAuthServerInfo shape from the
OpenAI Codex flow: waitForCredential() resolves null when cancelWait()
hands the login over to manual entry, and close() is pure cleanup that
never settles the wait.

Refs #7078
2026-07-27 11:58:04 +02:00
Lucas Meijer f9a49869c2 feat(ai): expose pending stop reason while streaming (#7151)
* feat(ai): expose pending streaming stop reason

Closes #7142

* manual tidy up of human facing copy
2026-07-27 11:56:15 +02:00
Alexey ZaytsevandMario Zechner 518855dd50 feat(coding-agent): expose output padding to custom renderers (#7045)
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-25 08:29:34 +02:00
Armin Ronacher 24bace27cf feat(ai): support constrained sampling (#6341)
Add the constrained sampling API and provider plumbing for OpenAI and Anthropic tool calls, including grammar sampling variants and model capability metadata.
2026-07-23 23:48:40 +02:00
Thomas MustierandArmin Ronacher 241431c69b fix(agent,ai): don't cache write compaction or branch summaries (#6618)
avoid cache writes for compaction and branch summaries

Co-authored-by: Armin Ronacher <armin.ronacher@active-4.com>
2026-07-23 23:03:23 +02:00
Anantha Kumaran fc85bdd88b feat(coding-agent): emit bash_execution_update events (#6971) 2026-07-23 12:28:12 +02:00
Petr Houška 7af8533c6f fix(ai): make provider retries abortable (#6980)
Replace OpenAI and Anthropic SDK retries with local request retries that
preserve configured retry counts, enforce maxRetryDelayMs, and make retry
backoff interruptible through AbortSignal.

Alternatives considered: Racing SDK requests against AbortSignal would make
cancellation observable but would not let Pi enforce maxRetryDelayMs before
the SDK enters its retry sleep. Patching private SDK internals would be brittle,
while disabling provider retries entirely would ignore explicitly configured
maxRetries.

Also, align the custom OpenAI Codex retry loop with the documented
maxRetryDelayMs behavior. Oversized server-requested delays now fail immediately
instead of being clamped, allowing the visible, abortable agent-level retry
policy to handle the failure.

Fixes #6911
2026-07-23 12:25:37 +02:00
Armin Ronacher bb3d7d399c feat(coding-agent): expose session metadata to bash tools (#6967) 2026-07-22 20:15:02 +02:00
Saryev Rustam 7b52cef2e6 feat(ai): add OpenRouter OAuth support (#6927)
Closes #6814
2026-07-22 15:48:39 +02:00
Mario Zechner 6f95a33888 fix(ai): enable cache control for OpenRouter aliases
closes #6940
2026-07-22 11:46:21 +02:00
David Brailovsky 7540da4016 add docs for new event types 2026-07-21 15:40:11 +00:00
Cristina Poncela Cubeiro 9e7582aa03 feat: sqlite session storage (#6594)
This PR:

- Adds retainedTail to compaction entries in the new agent harness so we don't have to walk up the tree for the 2000 tokens before compaction,
- Changes getPathToRoot to getPathToRootOrCompaction to only load until last compaction, as unnecessary to access all nodes where it is called,
- Adds a SQLite storage backend, in a separate packages/session-backend-sqlite, with a migration system and schemas as per on-site discussions: sessions to match session header messages (except for metadata, which I couldn't understand what it's used for or where it gets written, so I omitted it), session_entries for shared entry types as columns plus payload as a json for what remains, session_sequences to represent the append-only, serialized nature of the jsonl files, branch_entries to attribute nodes to branches (relationship one-to-many), and session_materialized with the session info (see /session in TUI) to act as a "cache" or quick-access for costs, message count, token info, labels, session name, and model-thinking-level config (e.g. for fast resume).
- This is compatible with the new agent harness Session abstraction.
2026-07-21 11:36:31 +02:00
Mario Zechner f8b74a4507 fix: complete extension usage accounting
closes #6509
2026-07-20 17:06:22 +02:00
Cristina Poncela Cubeiro c179395218 feat: get_available_thinking_levels rpc (#6865) 2026-07-20 16:29:10 +02:00
QuintinShaw bbb91fa8ae feat(ai): add Qwen Token Plan as built-in provider (#6858)
Add Alibaba Cloud Model Studio Token Plan subscription service as two
built-in API-key providers: qwen-token-plan (international, Singapore)
and qwen-token-plan-cn (China, Beijing).

Each provider exposes 15 text-generation models (Qwen, DeepSeek, GLM,
Kimi, MiniMax) via the OpenAI-compatible endpoint with DashScope
enable_thinking support. Model metadata is sourced from models.dev;
qwen3.8-max-preview is hardcoded until models.dev includes it.

Also fixes kimi-coding test references (k2p7 -> kimi-for-coding) after
models.dev catalog update picked up by generate-models.

Closes #6850
2026-07-20 13:53:30 +02:00