Commit graph

6698 commits

Author SHA1 Message Date
Armin Ronacher
c71a496ff9
feat(coding-agent): add Nix flake (#9137)
Add a Nix flake that builds Pi from the checkout on aarch64/x86_64 Linux
and macOS. The build is offline: provider model data is hydrated from a
pi.dev model catalog revision pinned in nix/model-catalog.json, and the
runtime dependency tree comes from packages/coding-agent/install-lock with
internal packages built from source.

The Nix workflow keeps the catalog pin current on main, builds release
tags on all systems, and fast-forwards the stable branch to each release
that builds. The release script refreshes the pin before tagging.
2026-10-02 18:30:51 +02:00
David Brailovsky
4665fafb4d fix(ai): keep models.dev pricing tiers for Amazon Bedrock models
Bedrock OpenAI models were costed at the short-context rate above 272k
input tokens because the generator dropped the models.dev tiers.

closes #10326
2026-10-02 18:25:43 +02:00
Armin Ronacher
319fecb89b fix(codemode): cap script output so print loops cannot exhaust host memory
text(), image(), and console.* fail the script with a RangeError past
MAX_OUTPUT_CHARS (16 Mi) characters or MAX_OUTPUT_ITEMS (100000) items.

closes #10283
2026-10-02 17:54:35 +02:00
David Brailovsky
eeac84ca92 fix(ai): fail Sign in with ChatGPT when the callback port is taken
When port 1455 was held by another pending login (another pi session
or the Codex CLI), login fell back to a paste prompt, but the browser
callback reached the other listener, which rejected it with "OAuth
state mismatch". Fail before opening the browser with a port-in-use
error instead.

fixes #10265
2026-10-02 17:44:05 +02:00
Armin Ronacher
581e7ba781 feat(coding-agent): remove npm shrinkwrap and recommend the managed installer
npm installs no longer pin transitive dependencies. Pinned installs come
from the pi.dev installer lockfile. pi update on global npm installs now
recommends migrating with the installer.

closes #5653
2026-10-02 17:16:56 +02:00
David Brailovsky
221cbcb02e docs(ai,coding-agent): document Cloudflare Clef classifiers
List @cf/cloudflare/clef and @cf/cloudflare/clef-flash under
cloudflare-workers-ai in the classifier models table and add changelog
entries crediting #10316 and #10322.
2026-10-02 16:58:49 +02:00
Nathan Disidore
4812cb268e
feat(ai): add Cloudflare Clef classifiers to Workers AI (#10316)
builds on https://github.com/earendil-works/pi/pull/10322 by @RealAlexandreAI
2026-10-02 16:52:58 +02:00
David Brailovsky
c10bfb0d79 fix(ai): use dashed Claude model IDs for Cloudflare AI Gateway
The gateway's /anthropic passthrough forwards the model ID to Anthropic
unchanged. models.dev lists the gateway's Claude models with dotted
versions (claude-opus-5.5), which Anthropic rejects with a 404. Convert
dots to dashes (claude-opus-5-5) when generating the catalog.
2026-10-02 16:12:00 +02:00
Armin Ronacher
1499466d85 feat(coding-agent): opt-in MCP OAuth client ID metadata documents
Adds oauth.clientRegistration: "cimd", which identifies pi with its Client ID Metadata Document on pi.dev instead of dynamic client registration, matching Codex: a shared document when the authorization server sends iss, otherwise a document and callback path specific to the MCP server. Authorization responses are only accepted on the exact redirect URI. Dynamic client registration stays the default.

closes #10302
2026-10-02 16:02:43 +02:00
Christian Klotz
de7e675de2
docs: update repo and CLI READMEs
Fixes #6907
2026-10-02 14:29:23 +01:00
David Brailovsky
9b3c19da5c fix(coding-agent): ignore empty entries in --models
A trailing comma in --models produced an empty pattern, which
matched every model by substring and added an extra model to
the model cycle.

fixes #10334
2026-10-02 13:42:38 +02:00
Armin Ronacher
b271b0a524 feat(ai): define Anthropic mid-conversation tools inline
Switch native Anthropic tool changes to the inline-tools-2026-09-15 beta. Later tools are defined by value in tool_addition blocks, so the top-level tool list stays fixed and same-name redefinitions no longer fall back to resending the full tool list. The deferred placeholder is kept.

Upgrade @anthropic-ai/sdk to 0.129.0 and deprecate hasToolRedefinitions().
2026-10-02 12:30:48 +02:00
David Brailovsky
3874b3e989 fix(ai): retry "Selected model is at capacity" provider errors
closes #10278
2026-10-02 11:38:35 +02:00
Armin Ronacher
0495646a83 fix(coding-agent): pin brace-expansion 5.0.12
minimatch 10.2.6 (latest) still allows brace-expansion ^5.0.8, so pin the
patched version directly to keep the shrinkwrap off vulnerable releases.

closes #10288
2026-10-02 10:40:58 +02:00
Carlos Villela
28eaccb8e8
fix(ai): update Together DeepSeek V4 Pro model ID (#10336) 2026-10-02 10:18:11 +02:00
Armin Ronacher
ced72c2f09 feat(coding-agent): copy OAuth sign-in URLs with app.message.copy
Login and MCP sign-in screens show a copy hint and copy the URL to the
clipboard (OSC 52 over SSH). /mcp login in the TUI now uses the MCP
sign-in screen instead of a notification.
2026-10-02 10:10:50 +02:00
Armin Ronacher
c450f2c0f8 feat(coding-agent): restore 3D pi logo easter egg alongside 3D Armin
Both share one lazily loaded renderer in easter-egg-3d.ts. Drops the
easter egg changelog entries.
2026-10-02 10:08:56 +02:00
Armin Ronacher
1c1e9c0efc feat(coding-agent): remove daxnuts easter egg 2026-10-02 09:50:04 +02:00
Mario Zechner
7fbbd5f4a1 feat(coding-agent): play a 3D Armin on /arminsayshi in fullscreen mode
Replaces the 3D pi logo easter egg on header logo click. Armin's bitmap is
built from one cube per pixel, using the theme accent color. Regular mode
keeps the inline Armin art.
2026-10-01 22:10:57 +02:00
Armin Ronacher
86dfceec40 Add [Unreleased] section for next cycle 2026-10-01 20:52:38 +02:00
Armin Ronacher
a13d35a742 Release v1.0.0 2026-10-01 20:52:21 +02:00
Armin Ronacher
bc2d8dc1c4 fix(ai): drop mismatched item ids when replaying grammar tool calls
Foreign tool call ids are normalized to fc_*, but grammar tools such as
codemode replay as custom_tool_call, which requires ctc_* ids. This broke
switching OpenAI models through Radius after a codemode call
(earendil-works/radius#115).
2026-10-01 20:42:40 +02:00
Armin Ronacher
92fc452c52 docs: audit changelogs and add new features for next release 2026-10-01 20:41:15 +02:00
Mario Zechner
eaa8b0d065 fix(durable): publish README and changelog, link the spec, add default export condition
Rename docs/pico-v5.md to docs/spec.md and link the design documents on GitHub
instead of shipping docs/. Add a default condition to every export so require()
of the ESM package works. Reset the changelog to the initial release.
2026-10-01 20:23:30 +02:00
Mario Zechner
395315f484 feat(coding-agent): experimental durable vacation planner demo
A copy of the experimental durable coding agent with the coding tools and pi's
coding prompt replaced by a vacation planner: a search tool that is safe to
rerun, and a background research subagent that reports back as a new message.
2026-10-01 19:59:14 +02:00
Armin Ronacher
6f1072cc08 feat(coding-agent): shrink codemode prompt and guide scripts back from errors
Move the codemode script reference, including the models API, into
docs/codemode.md and keep only one line per global in the tool
description. Declared tools get a one-line note on how scripts call them,
and the codemode system prompt guidance and MCP server section are shorter.
With the default tools a GPT-5.6 request drops from about 5,300 to 3,300
tokens.

Errors now point the way back: unknown tools and models members name close
matches, models.classify() and models.generateImages() validate their
arguments, unknown or mistyped models point to getAvailableOfType(),
store() overflow explains the store, and unshown generated images get a note.
2026-10-01 18:27:23 +02:00
Armin Ronacher
88ff80b986 feat(coding-agent): make fullscreen the default TUI mode 2026-10-01 17:26:35 +02:00
Armin Ronacher
c2f65d8f13 docs(coding-agent): add Radius to providers page, rename provider docs sections 2026-10-01 17:06:00 +02:00
Armin Ronacher
ca9c925117 fix(coding-agent): show text wordmark instead of logo in Apple Terminal 2026-10-01 16:58:24 +02:00
Armin Ronacher
aab34df655 feat(coding-agent): add models.generateImages() to codemode
Scripts run image models with the session's credentials, like
models.classify(). Results are base64 image blocks that image() attaches
to the codemode result; usage counts toward the session cost.
2026-10-01 16:50:29 +02:00
Armin Ronacher
ed8b3bcc19 feat(coding-agent): offer Radius sign-in and MCP setup in /login
The top-level /login menu offers Sign in with Radius with its status,
with an animated shimmer on the Radius row and a short Radius intro.
After a Radius sign-in it offers to configure the Radius MCP server in
the global mcp.json with auth.provider and reloads. Cancelling a login
returns to the menu it was started from. OAuth sign-ins without a
subscription are labeled as accounts.

Co-authored-by: niloc <5925270+colindaymond@users.noreply.github.com>
2026-10-01 15:12:24 +02:00
Vegard Stikbakke
233f174401 fix(ai): use color Pi logo on OAuth pages 2026-10-01 15:10:11 +02:00
Mario Zechner
48dd1e2f0f feat(coding-agent): port the experimental client/server to pi-durable
Session workers now host a durable Harness over a per-session sqlite storage.
The server keeps each session in <sessionDir>/<id>/ with meta.json and
session.sqlite and never opens the storage itself. Workers hold retirement
while the Harness task graph has live tasks and resume interrupted work on
open.

Transcript serves the root conversation's durable view directly, Models
follows the conversation's agent document, and AgentController maps prompt,
steer, follow-up, queue cancellation, abort, and compaction onto the root
conversation, plus waitForPrompt. navigate, nextRun, and resume are dropped
(see experimental/services/README.md TODO). The durable TUI and the worker
share harness-setup.ts.

pi-server exports its own SessionMetadata and no longer depends on
pi-agent-core. Chord accepts readonly JSON types in service contracts without
walking them, which recursive JSON types like pi-ai's made too deep.
2026-10-01 14:45:01 +02:00
Mario Zechner
7fd478a2e8 feat(agent): remove the experimental harness from pi-agent-core
pi-agent-core now contains only Agent, the agent loop, the proxy stream, and
their types. Removed the harness, sessions and session storage, pico3, harness
tools, compaction, skills, prompt templates, telemetry schemas, search types,
and the uuidv7 and pi-telemetry re-exports, plus the ./node, ./harness/* and
./experimental/pico3 subpath exports. Durable sessions live in
@earendil-works/pi-durable.

Also removed packages/session-backends and the experimental mini and micro
coding-agent frontends, with their scripts and build configuration.
2026-10-01 14:45:01 +02:00
Armin Ronacher
f29ea3deb2 feat(coding-agent): add header-only quietStartup mode
quietStartup: "header" keeps the startup header with version and key hints
but hides the model scope line and loaded-resource listing.
2026-10-01 14:42:02 +02:00
Maximilian Blazek
409e808f58
fix(coding-agent): keep pastel palettes pastel in the system theme (#10293)
Palette colors now keep the bell-curve falloff and are
also capped at the palette color's OKLCH chroma times that falloff.
Lightness and hue are unchanged, so contrast is unchanged.

closes #10255
2026-10-01 13:40:36 +02:00
Armin Ronacher
c662ec7e37 fix(coding-agent): restore MCP tools loaded by tool_search on resume and reload
The session restored its tool loadout before MCP servers reconnected, so deferred tools that tool_search had loaded were dropped. Restored tools that are not registered yet now stay pending and are activated when they register, until a setActiveTools() call deactivates a tool or the next prompt starts.
2026-10-01 13:35:33 +02:00
Vegard Stikbakke
0f8740bb65 fix(coding-agent): rename unconfigured to not configured 2026-10-01 12:37:37 +02:00
Mario Zechner
e792ba131e fix(coding-agent): keep one copy of each rendered user message line
The user message's Markdown pads and colors its own background instead of
sitting in a Box that kept a second full-width copy of every line. The output
is identical.
2026-10-01 11:37:01 +02:00
Mario Zechner
54c19a2529 fix(tui): reduce memory retained per rendered message
Markdown holds its parsed tokens weakly: a token tree is about ten times its
source, and every transcript message keeps a Markdown component. The tokens
still survive bursts of re-renders such as theme previews. Markdown, Text, and
Box flatten their cached lines, which V8 otherwise keeps as trees of the
concatenated parts. A long assistant message keeps about a fifth of the heap.
2026-10-01 11:36:51 +02:00
Armin Ronacher
5806068c26 fix(coding-agent): store MCP OAuth credentials per server name and URL
Entries sharing a URL now keep separate accounts. Credentials stored by
URL alone move to the first server that loads them.

closes #10252
2026-10-01 11:20:59 +02:00
Armin Ronacher
a4715ec9bf test(coding-agent): run the official MCP client conformance suite in CI
Runs the pinned @modelcontextprotocol/conformance client scenarios for 2025-03-26, 2025-06-18, and 2025-11-25 against pi's MCP connection and OAuth sign-in, and fails on regressions against a committed check-level baseline.
2026-10-01 10:43:44 +02:00
Armin Ronacher
e529a82c98 fix(mcp): keep granted scopes on step-up authorization
A step-up sign-in requested only the scopes of the insufficient_scope challenge, so the new token lost the scopes granted before and other requests asked for sign-in again. Tokens now record their granted scope and step-up requests the union (SEP-2350).
2026-10-01 10:43:44 +02:00
David Brailovsky
0c453048bd fix(coding-agent): require --model when --provider is given
--provider without --model was ignored and the default model from
another provider ran instead. It now fails with an error. Also fixes
the outdated "(default: google)" in the --help text.

closes #10236
2026-10-01 10:25:16 +02:00
Mario Zechner
70c036211d feat(coding-agent): show the durable TUI's task panel by default 2026-10-01 10:07:19 +02:00
David Brailovsky
41169ba2af fix(coding-agent): make /mcp login sign-in URL clickable in the TUI
fixes #10186
2026-10-01 09:55:24 +02:00
Mario Zechner
5609b0d6c0 feat(coding-agent): experimental TUI coding agent on pi-durable
A small local agent in src/experimental/durable: pi's model runtime, settings,
system prompt, theme, and interactive components over a durable Harness with
SQLite storage. Streaming, tools, steer and follow-up, abort, model and
thinking selection, compaction, --continue with recovery of interrupted turns,
a subagent tool with /agents to switch to and talk to subagents, and a live
/tasks panel from the task graph view. The tsconfig path for
@earendil-works/pi-durable/* resolves subpaths to source.
2026-10-01 09:53:21 +02:00
Mario Zechner
49683a3647 feat(durable): lifecycle conformance and task graph view (Packages 22, 23)
Package 22: runtime.now() and report() throw after the invocation ended; a
migration-only commit is published; a failed Harness.open closes without the
caller's context and rethrows the open error; ConversationWatch alias. Tests
for close joining non-cooperative code, cancelled close, queued operations at
the seal, progress calls and viewers on a paused Harness, the Chord guide, and
the spec's usage examples.

Package 23: Harness.taskGraph() and watchTaskGraph() mount every live task with
its owner edge, committed status, flags, and owned conversations, advanced from
commit publications. Example 24 prints the checkout's tree.
2026-10-01 09:53:21 +02:00
Mario Zechner
5b5ccddfac docs(durable): settle lifecycle wording and specify the task graph view (Packages 22, 23)
Close ends states and watches at its seal, joins non-cooperative code, and a
cancelled close cancels only its wait. Conversation.abort() starts scheduling.
New section 9.5 specifies Harness.taskGraph() and watchTaskGraph(). The Chord
guide uses real imports and documents shutdown order.
2026-10-01 09:53:21 +02:00
Armin Ronacher
8ce69e9d2b fix(mcp): treat empty and null optional OAuth fields as absent
Empty or null optional fields in OAuth token and registration responses
(scope, refresh_token, id_token, client_secret) failed sign-in, and
expires_in: null marked tokens as expired. Also fall back to the server
origin when resource metadata has invalid URLs, skip empty scopes when
selecting the requested scope, and end pagination at an empty or null
nextCursor.

closes #10266
2026-10-01 02:05:35 +02:00