Commit graph

6817 commits

Author SHA1 Message Date
Armin Ronacher
abe508e1b8 Release v1.1.0 2026-10-07 23:33:33 +02:00
Armin Ronacher
bf8d9c659f chore: allow skipping tests in the release script
PI_RELEASE_SKIP_TESTS=1 skips ./test.sh when the suite already passed in release:local and the machine is too loaded for timing-sensitive tests.
2026-10-07 23:32:05 +02:00
Armin Ronacher
e916310705 test(coding-agent): wait for streaming and watcher events instead of fixed sleeps
The concurrent prompt tests slept 10 ms and assumed the first prompt was streaming, and the reftable watcher test allowed 3 s for a real fs event. Both failed under full-suite load during the release run.
2026-10-07 23:15:53 +02:00
Mario Zechner
70759f48be fix: address actionable npm audit findings 2026-10-07 23:00:59 +02:00
Armin Ronacher
a2eef9eb60 fix(ai): pin Kimi K3 Moonshot pricing and expect Haiku 5.5 adaptive thinking
models.dev now lists the input rate as Kimi K3's cache write cost on Moonshot, which does not bill cache writes. Claude Haiku 5.5 uses adaptive thinking, so the metadata test now expects it.
2026-10-07 22:41:41 +02:00
Armin Ronacher
dce4ae6f79 docs: audit changelogs for v1.1.0 2026-10-07 22:20:04 +02:00
Armin Ronacher
943a10e744 fix(ai): keep prompt-length pricing tiers from all model catalogs
models.dev loaders for opencode, opencode-go, google, minimax, and others built costs by hand and dropped tiers; they now use getModelsDevCost. OpenRouter prompt-length overrides and Vercel AI Gateway per-rate tiers are parsed into request-wide tiers. Rates a tier does not list keep the base price. OpenRouter time-of-day overrides are skipped.
2026-10-07 21:54:18 +02:00
Armin Ronacher
f76c1db662 feat(ai): add Claude Haiku 5.5
Adds claude-haiku-5-5 to the anthropic provider with its prompt-length pricing tier (5x above 100k input tokens), adaptive thinking with xhigh/max effort, per-message effort, and mid-conversation system messages and tool changes. Bedrock requests detect Haiku 5.5 for adaptive thinking, native xhigh, block binding, and prompt caching.
2026-10-07 21:44:58 +02:00
Mario Zechner
503c605528 feat(tui,coding-agent): report program status via OSC 7501
Report idle, working, blocked, done, and error to terminals that support
the Program Status Protocol. ProcessTerminal sends the support query with
the keyboard query and reports only after the terminal answers before DA1;
PI_PROGRAM_STATUS=1|0 overrides detection. Interactive mode reports runs,
compaction, extension dialogs, and logins. agent_settled now carries
aborted so cancelled runs report idle.

closes #10607
2026-10-07 19:05:41 +00:00
Armin Ronacher
f10993bc7f fix(coding-agent): cancel MCP OAuth sign-ins and stop refreshing on close
The OAuth flow in pi-mcp takes a signal for every request, and an aborted
refresh no longer falls back to a new authorization. The streamable HTTP
transport closes its session with the last request's token instead of
asking the auth provider, which could refresh first.

The MCP extension owns one signal per session: it aborts sign-ins on Esc
and on session shutdown, replaces the generation counter, and shutdown
waits for aborted sign-ins to clean up. Requests to the authorization
server time out after 15s, and pi mcp login --timeout limits the whole
sign-in.

closes #10565
2026-10-07 16:18:46 +02:00
David Brailovsky
27c7b6ff48 fix(coding-agent): strip ANSI sequences split across user bash output chunks
closes #10504
2026-10-07 15:02:59 +02:00
David Brailovsky
592fb57b70 fix(coding-agent): read Termux clipboard on Android platform
Termux reports process.platform as android, so the Linux-only branch skipped
termux-clipboard-get and Ctrl+V pasted nothing. Also show the Termux:API hint
when a Termux copy fails.

fixes #10391
2026-10-07 14:35:48 +02:00
David Brailovsky
adae824645 docs(coding-agent): document azure provider id, Foundry models, and deployment mapping
closes #10501
2026-10-07 14:20:13 +02:00
David Brailovsky
b30a6dd779 fix(coding-agent): ignore Node's own worker messages in image resize
Under `node --watch`, Node 24.19+ and 26.x post `{ "watch:require": [...] }`
on the worker message channel (nodejs/node#65044). The image resize code
treated the first message as the worker's reply, resolved it to `null`, and
dropped the image as "could not be resized below the inline image size limit".

Worker replies now carry a `type` marker, and the main thread ignores any
message without it. The reply type is now either a result or an error.

fixes #10527
2026-10-07 12:26:43 +02:00
Mario Zechner
7fb59f995b fix(ai): retry Mistral finish_reason error
Mistral reports transient server failures as finish_reason "error". Its
error message now includes "server error" so the retry classifier treats
it as retryable.

closes #10487
2026-10-07 09:06:19 +00:00
Mario Zechner
b2363841a5 fix(tui): detect Herdr as supporting OSC 8 hyperlinks
TERM_PROGRAM=herdr enables hyperlinks with image protocols off. Herdr is
checked before outer-terminal detection so leaked variables such as
KITTY_WINDOW_ID do not enable images inside Herdr panes.

closes #10573
2026-10-07 08:54:32 +00:00
github-actions[bot]
ea6fa125ab chore: update Nix model catalog pin 2026-10-07 08:45:35 +00:00
Mario Zechner
8d8ae2fc24 fix(ai): fall back to a free port for Anthropic OAuth callback
Try 53692 first so forwarded setups keep working, then let the OS pick a
free loopback port when 53692 cannot be bound (e.g. Hyper-V/WSL port
exclusions on Windows). The authorize URL, paste prompt and token exchange
use the bound redirect URI.

closes #10571
2026-10-07 07:47:22 +00:00
Armin Ronacher
2db5e359bf fix(coding-agent): keep MCP manager responsive (closes #10562)
Open the manager before startup connections finish and keep connection actions in the background. Serialize reconnects and replacements, wait for current readiness, and resolve the active connection when executing tools.
2026-10-07 08:35:24 +02:00
Armin Ronacher
6b58544540 fix(ai): type empty OpenAI classifier catalogs 2026-10-07 08:35:06 +02:00
Armin Ronacher
ce8972a0e9 feat(ai,coding-agent): add OpenAI Decisions classifier and classifier images
Adds the openai-decisions classifier API with gpt-6-luna on the openai provider. bool questions map to predicates with the criteria in the instructions, refusals fail the result, and gateway timeouts (504) are not retried. The model needs an API key and is hidden from availability while openai uses Sign in with ChatGPT.

Adds optional images to ClassifierContext. Models without image input and APIs that cannot send images return an error result. Codemode's models.classify() accepts images.

Moves the shared classifier HTTP code out of system-one-shared.ts into classifier-shared.ts.
2026-10-07 08:27:56 +02:00
Armin Ronacher
eb326d265a fix(codemode,coding-agent): separate codemode output items
Text items get ==> text N/M <== headers when there are several, and
console output is grouped into one <console_output> block. Console text
items are marked with console: true.
2026-10-06 23:51:09 +02:00
Mario Zechner
ae92585d3b fix(durable): report settings failures when checking kept context retention
The idle check reads settings.contextRetentionMs from commit listeners,
reconciliation, and the expiry timer. A throwing settings getter escaped as an
unhandled rejection; it is now reported and the kept contexts are dropped.
2026-10-06 21:10:40 +02:00
Mario Zechner
da866ada17 feat(durable): keep each conversation's context in memory; Durable Object SQLite adapter
runtime.context() keeps each conversation's last read range and derived
view. A later read by any of the conversation's tasks with the same head
marker scans and derives only the entries committed since, so a
generation no longer rereads and re-derives the whole transcript for
each model request. Busy conversations keep the range; idle ones for
settings.contextRetentionMs (default ten minutes), checked on task
changes and by one unreferenced timer where the runtime supports it.
Kept entries are frozen; each read returns its own view arrays.

Add openDurableObjectSqliteStorage(ctx.storage) in
@earendil-works/pi-durable/storage/sqlite/cloudflare: SQLite storage on
a SQLite-backed Cloudflare Durable Object, without per-row copies.
2026-10-06 20:58:35 +02:00
Mario Zechner
fe11328b0d fix(ai): compare faux prompt-cache usage per message
The faux provider's prompt-cache usage estimate compared the previous and
current prompt as two joined strings, character by character, on every
call. It now compares the prompts message by message and compares
characters only from the first differing message. Usage numbers are
unchanged.
2026-10-06 20:58:35 +02:00
Mario Zechner
4c28a6865c fix(durable): raise the root entry budget for the shared storage scan module 2026-10-06 20:57:14 +02:00
Mario Zechner
92216fa15c fix(durable): lead the model context with the initial system message
A run's input is committed before the system prompt is rendered, so requests
started with the user message. Anthropic then sent the tool list at the top of
every request and each tool change invalidated the whole prompt cache. Context
derivation now moves a system message preceded only by user messages to the
front. A live e2e test gates the cache reuse across a tool change.

closes #10542
2026-10-06 20:55:52 +02:00
Mario Zechner
f284a2460c fix(ai): time responses with private fields; use the real stream in proxy and test mocks
Replaces the WeakMap workaround. streamProxy and the agent and coding-agent test
mocks reimplemented AssistantMessageEventStream as plain EventStream subclasses;
they now use createAssistantMessageEventStream().
2026-10-06 20:26:27 +02:00
Mario Zechner
3ba22ce17a fix(ai): keep AssistantMessageEventStream assignable from plain event streams
The response timing added private fields, which made test and host streams built on
EventStream no longer assignable to StreamFn. Keep the start in a WeakMap instead.
2026-10-06 20:08:35 +02:00
Mario Zechner
4dd2af42c8 feat(durable): scan conversations, entries, tasks, and submissions in either order
ScanOrder is an optional order on each scan query; cursors carry it.

closes #10546
2026-10-06 20:03:03 +02:00
Armin Ronacher
43d3763991 fix(ai): replace bundled Radius catalog with gateway catalog
Models disabled by an organization owner were still listed because the
fetched catalog was merged into the shipped default catalog.
2026-10-06 19:46:54 +02:00
Mario Zechner
36a686ee8d feat: record response, tool execution, and durable task times
pi-ai's AssistantMessageEventStream sets AssistantMessage.durationMs with a
monotonic clock for every API implementation. The agent loop and the durable
tool task set ToolResultMessage.durationMs around execute(). Durable task
records carry startedAt/endedAt stamped by the Session. The coding agent's bash
renderer shows Took from the recorded duration, also after a reload.

closes #10549
2026-10-06 19:28:54 +02:00
Mario Zechner
636703a0a4 feat(durable): take the TaskRuntime.context() cutoff as an options object
Matches Conversation.context(context, { at }). refs #10512
2026-10-06 18:12:44 +02:00
Justin Santer
2989eb581f
fix(ai): send reasoning effort to OpenAI models on Bedrock Converse (#10142)
buildAdditionalModelRequestFields only handled Claude, so the configured
thinking level never reached OpenAI models on Bedrock and they always ran at
Bedrock's default effort. gpt-oss now gets the flat reasoning_effort, clamped
to low/medium/high. Other GPT models (GPT-5.x, GPT-6) get nested
reasoning.effort, with minimal sent as low since Bedrock rejects it.

closes #9331
2026-10-06 18:06:46 +02:00
David Brailovsky
311f0e020d fix(ai): update output limit assertions for token estimate 2026-10-06 15:58:16 +00:00
Armin Ronacher
269121616c fix(coding-agent): mark codemode lookup helpers as async in description
closes #10555
2026-10-06 17:53:40 +02:00
David Brailovsky
27075fe075 fix(ai): estimate request context at 3.5 characters per token
Increase estimated input size to leave more room when calculating
output limits. Verified against OpenRouter DeepSeek V4 Flash: the
same large input now succeeds with an explicit output limit.

Fixes #10497
2026-10-06 17:37:24 +02:00
Ramiz Wachtler
18336987ad
fix(coding-agent): apply outputPad to all transcript blocks (#10557) 2026-10-06 17:27:55 +02:00
Mario Zechner
76f6c06daf feat(durable): read a conversation's context as of an earlier entry
closes #10512
2026-10-06 17:22:05 +02:00
Mario Zechner
b0114ef5fa feat(durable): expose models on ToolExecutionApi and HookApi
closes #10395
2026-10-06 17:14:43 +02:00
Mario Zechner
68ccef1760 fix(durable): reuse the scanned context range within a task invocation
runtime.context() keeps the range its last read scanned for the task
invocation. A later read with the same conversation and head marker scans
only entries committed after that range's tail and re-derives the view in
memory. A generation's request no longer rereads the whole transcript after
its prepare. The range is dropped when the invocation ends or sleeps.
2026-10-06 16:59:46 +02:00
Christian Klotz
83c9e26453
fix(tui,coding-agent): clear fullscreen selection on transcript rebuild (#10567)
Selection coordinates survived session switches and other transcript rebuilds, highlighting unrelated text in the new transcript. Reset selection and multi-click state before re-rendering session entries.

Based on #9310.

fixes #9311

Co-authored-by: xdagiz <xdagiz@protonmail.com>
2026-10-06 16:35:24 +02:00
David Brailovsky
8b5708dbb1 fix(ai): retry transient server-busy provider errors
Recognize server_busy and servers are currently busy as retryable errors.

Fixes #10543
2026-10-06 15:59:24 +02:00
Christian Klotz
56b25ff4eb
docs(coding-agent): align documented message types (#10566) 2026-10-06 15:05:49 +02:00
Armin Ronacher
ddaa0a0341 feat(coding-agent): accept +name/-name entries in --tools
A --tools list of only +name/-name entries changes the default tool
selection like the defaultTools setting, e.g. pi -t +codemode. Mixed
lists and patterns in modifiers are rejected, and /reload keeps tools
removed with -name removed.
2026-10-06 13:51:04 +02:00
Christian Klotz
23cf2b948d
feat: unify package artifact validation (#10197)
* feat: unify package artifact validation

* fix: restrict local artifact output paths

* fix: clarify package artifact module names

* feat: support pnpm package artifact consumers

* fix: preserve local release package installs

Keep npm and Bun consumer installs as runnable release artifacts while retaining isolated validation for other packages. Simplify smoke fixtures and avoid redundant release work.
2026-10-06 13:30:02 +02:00
github-actions[bot]
428a12bc77 chore: approve contributors from issue #10353 2026-10-06 08:18:03 +00:00
Lucas Meijer
0cf65d2bf7
fix(ai): let caller headers override Codex originator and User-Agent (#10429)
StreamOptions.headers documents that caller values override provider
defaults, and every other provider applies model/caller headers after its
User-Agent default. The Codex provider set originator and User-Agent after
merging caller headers, so they could not be overridden. Set the defaults
first; Authorization and chatgpt-account-id stay fixed.

Co-authored-by: Lucas Meijer <308974+lucasmeijer@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: David Brailovsky <davidbrai@gmail.com>
2026-10-06 10:01:19 +02:00
Armin Ronacher
1ffb6bd621 fix(coding-agent): disable .env autoload in standalone binary
Bun compiled executables load cwd .env files into process.env by default.
closes #10473
2026-10-06 09:57:14 +02:00
Lucas Meijer
9ad083102a
feat(ai): let apps name themselves in OpenAI logins (#10433)
LoginOptions.agentName replaces pi's name in the Sign in with ChatGPT
agent_name_hint and the Codex browser login originator.
2026-10-06 09:27:40 +02:00