Commit graph

6326 commits

Author SHA1 Message Date
Armin Ronacher
71023aec15 Release v1.3.0 2026-10-15 20:57:27 +02:00
Armin Ronacher
9800c96ffc docs(coding-agent): add changelog entry for #10999 2026-10-15 20:55:08 +02:00
Armin Ronacher
2cb2cfa79f docs: audit changelogs for release 2026-10-15 20:55:00 +02:00
Colin Mason
a4f67eb65e
fix(coding-agent): close own custom ui overlay (#10999)
done() from ctx.ui.custom({ overlay: true }) closed the overlay with
ui.hideOverlay(), which removes the topmost overlay instead of the one
that called done(). With a shell overlay open under a dialog overlay
from another extension, the shell's exit removed the dialog: the
finished shell overlay stayed on screen ignoring input and the dialog's
promise never resolved. Hide the overlay through its own handle.

closes #10648
2026-10-15 20:50:03 +02:00
Armin Ronacher
d05a73fb31 fix: keep the Nix model catalog pin buildable
The pin script discovered the catalog with the checkout's version, which on
main is the last release, so pi.dev answered with the catalog for released
clients after MINIMUM_PI_VERSION was raised. It now pins the newest
published catalog and treats the pin as stale when its provider/type/API
model groups differ. The release script pins the newest catalog and runs
the Nix build steps before tagging.

closes #10985
2026-10-15 20:16:03 +02:00
David Brailovsky
9113094291
fix(ai): drop thinking from other models instead of sending it as text (#11000)
When switching models, thinking blocks from earlier assistant messages
produced by a different model were sent as plain text. The new model saw
the old model's reasoning as part of its replies and could start writing
its own reasoning into the visible answer. These blocks are now dropped;
text and tool calls are kept.

closes #10995
2026-10-15 19:38:33 +02:00
Armin Ronacher
5ab7fe74c4 fix(ai): keep images of error tool results for Anthropic and Bedrock Claude
Anthropic and Claude on Bedrock reject error tool results that contain
images. Instead of replacing the images with a note, each image in the
result is now replaced with a placeholder and the images are sent after
all tool results of the turn, in the same user message, under a caption
naming the tool call. Successful results, error results without images,
and non-Claude Bedrock models are unchanged.

closes #10794
2026-10-15 16:49:50 +02:00
Armin Ronacher
eddebaeebf fix(coding-agent): append Node to PATH in the Nix wrapper
Shells started by the bash tool now keep the user's node/npm. Pi still
runs on the pinned Node, which stays available as an npm fallback.

closes #10519
2026-10-15 15:49:34 +02:00
David Brailovsky
a3f265b1c6 feat(ai): use Chat Completions for the kimi-coding provider
Switch kimi-coding to OpenAI Chat Completions at api.kimi.com/coding/v1,
the protocol the official Kimi Code client uses. K3, K3-256K, and Kimi For
Coding accept tools declared in later system messages, so tools loaded
mid-conversation (e.g. by tool_search) keep the prompt cache. Highspeed
rejects tool-bearing system messages and keeps added tools top-level.

Re-lands b06c1f2 (reverted in 6a1f799b6) with MINIMUM_PI_VERSION bumped
to 1.2.1. Released clients implement only Anthropic Messages for
kimi-coding and ignore a model's api, so they must keep receiving the
last catalog published under 0.80.7.

closes #10720
2026-10-15 15:29:11 +02:00
David Brailovsky
dfb03c3283 fix(coding-agent): use claude-sonnet-4.5 in model registry tests
anthropic/claude-sonnet-4 is no longer in the OpenRouter catalog.
2026-10-15 15:27:42 +02:00
David Brailovsky
568c2a82a7 fix(ai): use claude-sonnet-4.5 in OpenRouter tests
anthropic/claude-sonnet-4 is no longer in the OpenRouter catalog.
2026-10-15 15:23:31 +02:00
Christian Klotz
f7e3cb5433
feat(durable): support namespaced SQLite storage (#10937)
* feat(durable): namespace SQLite storage tables

Render migrations and runtime queries from one schema map, add optional prefixes, and simplify the Cloudflare Durable Object adapter.

* feat(durable): expose SQLite prefixes through storage helpers

* docs: explain shared Durable Object storage

* Update changelog
2026-10-15 14:02:27 +01:00
David Brailovsky
6a1f799b67 fix(ai): revert kimi-coding switch to Chat Completions
Reverts b06c1f2. The pi.dev model catalog is served to every client
since 0.80.7, so released clients received kimi-coding models with
api openai-completions and baseUrl https://api.kimi.com/coding/v1.
Their kimi-coding provider only implements Anthropic Messages and
ignores model.api, so requests went to /coding/v1/v1/messages and
failed with 404. The change will re-land together with a bump of the
catalog's minimum pi version.

refs #10720, refs #10985
2026-10-15 13:19:40 +02:00
Mario Zechner
4a5d372915 feat(chord,durable): move OutputBuffer and Progress to @earendil-works/chord/output
OutputBuffer, Progress, boundOutput, sanitizeOutput, characterEnd and the
output types move from Durable's internal harness/output.ts to the new
Chord subpath, with OutputSkip (the shape of Durable's ShellOutputSkip) and
utf8ByteLength. Durable imports them from Chord; its truncate.ts re-exports
Chord's utf8ByteLength instead of keeping a second copy.
2026-10-15 09:59:46 +00:00
David Brailovsky
dc939913f6 fix(ai): support off thinking level on Claude Haiku 5.5 and Opus 5
Both models accept thinking: {type: "disabled"}, but were treated like
Opus 5.5, which cannot turn thinking off. "off" now sends disabled
thinking without effort markers or block_binding, which Anthropic
rejects while thinking is disabled.

fixes #10753
2026-10-15 11:24:04 +02:00
David Brailovsky
550f1f3ecd fix(ai): retry "The service is temporarily unavailable" errors
closes #10965
2026-10-15 10:12:50 +02:00
Mario Zechner
9a3ca68bda fix(chord): remote references refuse a foreign ctx
A call through a remote reference checked the ctx against its own host,
so a ctx from another host, or an object not made by Chord, passed and
its root was carried over the link. It now runs the same checks as a
local reference and rejects with invalid/foreign_ctx.

closes #10959
2026-10-15 06:25:18 +00:00
David Brailovsky
b06c1f2cf1 feat(ai): use Chat Completions for the kimi-coding provider
Switch kimi-coding to OpenAI Chat Completions at api.kimi.com/coding/v1,
the protocol the official Kimi Code client uses. K3, K3-256K, and Kimi For
Coding accept tools declared in later system messages, so tools loaded
mid-conversation (e.g. by tool_search) keep the prompt cache. Highspeed
rejects tool-bearing system messages and keeps added tools top-level.

closes #10720
2026-10-14 22:23:59 +02:00
David Brailovsky
87f9a36419
fix(ai): report malformed final tool-call arguments instead of keeping the parsed prefix (#10944)
When a finished tool call's arguments text was not valid JSON, the
streaming parser kept only the fields before the error and the tool ran
with them. Finished calls are now parsed strictly (with the existing
string repair); on failure arguments are {} and argumentsError holds the
reason and raw text, which validateToolArguments reports to the model.

fixes #10897
2026-10-14 21:41:42 +02:00
Mario Zechner
b45e0ebcc5 feat(chord): references hydrate their state before use (protocol 4)
- an awaited get or a ready hold has every state member of its variant, local or remote
- holds subscribe to their variant's state; per-member opt-out with state: false
- remote binding keys use canonical identity; client holds carry an opaque origin
- shape frames no longer carry codeVersion
2026-10-14 14:29:58 +00:00
David Brailovsky
9fe3f37162 fix(coding-agent): keep empty quoted prompt template arguments
Empty quoted arguments ("" or '') were dropped, shifting later positional
arguments and preventing positional defaults from applying.

closes #10867
2026-10-14 15:35:39 +02:00
Ramiz Wachtler
910149912c
fix(coding-agent): normalize read line-range labels (#10938)
- share range formatting across the TUI, exports, and examples
- add regression coverage without changing execution arguments
- fixes #9887
2026-10-14 15:20:04 +02:00
David Brailovsky
5712b134ed fix(ai): use 500K context window for Codex GPT-6.1 Sol
The Codex models endpoint now returns context_window=500000 for
gpt-6.1-sol; other Codex models still return 272000.

fixes #10840
2026-10-14 15:19:01 +02:00
David Brailovsky
381a2d8eb6 fix(ai): update Xiaomi replay test for removed reasoning_effort
Xiaomi MiMo models no longer send reasoning_effort since 6374c2baf (#10818).
2026-10-14 14:58:07 +02:00
David Brailovsky
b39979799f feat(ai): remove unused assistant-message frame API
AssistantMessageFrameEncoder and reduceAssistantMessageFrames were only used by the removed experimental agent harness.
2026-10-14 14:37:14 +02:00
Mario Zechner
aa9cf15be4 feat(chord): init for state, typed principals, contract placement (protocol 3)
- self.state(name, schema, { init }) loads before the object goes live
- the principal type is a parameter; createHost self, connect and route principals are required
- remote contracts declare their host (hostNamed, hostFamily); get no longer takes at
2026-10-14 11:55:26 +00:00
David Brailovsky
6374c2baf4 fix(ai): send only thinking on/off toggle for Xiaomi MiMo models
MiMo Chat Completions rejects reasoning_effort "minimal" with a 400.
Xiaomi documents only thinking.type enabled/disabled and treats all effort
levels identically, so stop sending reasoning_effort and expose only the
off and high thinking levels.

fixes #10818
2026-10-14 13:13:16 +02:00
David Brailovsky
1692bba634 fix(ai): send thinkingLevel for Gemini 4 models
Gemini 4 Argon rejected thinkingBudget on Vertex and ignored the selected
thinking level on the Gemini API.

fixes #10890
2026-10-14 12:38:28 +02:00
David Brailovsky
63035734f2 fix(ai): order thinking before text when a completions chunk has both
Proxies such as LiteLLM can send reasoning_content and content in one
stream delta. Reasoning was handled after content, so the message ended
up as [text, thinking]. Handle reasoning fields and reasoning_details
before content and tool calls.

fixes #10926
2026-10-14 12:11:15 +02:00
Christian Klotz
d7f7e0dfee
fix(coding-agent): resolve model references through one provider selection policy (#10913)
* fix(coding-agent): resolve model references through one provider selection policy

Model references from --model, --models/enabledModels, /model, and auth credential printing now share one resolver. It collects every candidate before choosing a provider, so catalog order never decides, a :<thinking> suffix cannot change the provider, and an ambiguous exact match no longer falls through to a fuzzy match.

provider/id still prefers the named provider's exact or fuzzy match. A gateway exposing provider/id as a raw model id is used when the named provider has no match, or lacks credentials while the gateway has them. Several gateways without a unique authenticated one are reported as ambiguous.

fixes #10160

* docs(coding-agent): shorten model selection notes in CLI reference

* docs(coding-agent): condense #10160 changelog entry

* fix(coding-agent): move model reference resolution into model-resolver

* fix(coding-agent): warn when a model scope pattern matches several providers

* docs(coding-agent): trim model resolver comments to the reasons

* fix(coding-agent): build custom model ids from the resolver's not-found target
2026-10-14 11:00:21 +01:00
Mario Zechner
5713c9507c fix(durable): lead with the system baseline after a compaction that keeps assistant messages
Context derivation moved a system message to the front only when user messages
alone preceded it. After a compaction that keeps an assistant message, the
baseline written for the next run followed the kept history and the new input,
so Anthropic and OpenAI Codex requests had no initial prompt or tool set.

Derivation now identifies the harness baseline: the first pi.system entry after
the head marker, or of the transcript when no earlier entry carries a system
message, even one omitted later. Its message leads even past assistant
messages. Only the first system message ever moves, so replay is unchanged;
other system messages after an assistant message stay in place.

closes #10904
2026-10-14 09:47:25 +00:00
Mario Zechner
301617df7b feat(chord): lifetime "host" is checked by the type system
serve(Type, factory, { lifetime: "host" }) compiles only for a local type whose input has no required fields, and
not together with linger; the runtime check stays as a backstop. ServeOptions is a union (ReferencedServeOptions,
HostServeOptions), picked per contract by ServeOptionsFor<C>.
2026-10-14 09:43:42 +00:00
Mario Zechner
b042997178 fix(durable): encode base64 with btoa, without retaining concatenation trees
toBase64 grew each 8 KiB chunk a character at a time; V8 kept every
concatenation node until the final join, about 138 MB of heap for a
3 MiB image, beyond a Durable Object's 128 MB limit.

closes #10923
2026-10-14 09:41:45 +00:00
David Brailovsky
7efebff189 fix(ai): retry gateway 'Unable to forward upstream stream' errors
closes #10920
2026-10-14 11:14:38 +02:00
David Brailovsky
60ac3bcc3b
feat(ai): keep the prompt cache when changing thinking level on OpenAI GPT-6 (#10930)
With an API key, GPT-6 models on the openai provider now keep reasoning.effort
fixed and send the thinking level as configuration_update input items. Each
reply records its level, so earlier items are rebuilt unchanged on every request.
Controlled by compat.supportsMidConvoEffort; skipped for Sign in with ChatGPT
and thinking off.

closes #10853
2026-10-14 10:56:20 +02:00
David Brailovsky
195120a915 fix(ai): move OpenCode providers to inference endpoints
- Use opencode.ai/inference and opencode.ai/inference/go base URLs; /zen/go has no Gemini route (404)
- Add google-generative-ai support to the OpenCode Go provider
- Use Anthropic Messages for OpenCode Go minimax-m2.7; openai-completions now returns ModelProtocolUnsupported
- Remove test for opencode-go deepseek-v4-flash, which is no longer listed
2026-10-14 10:10:28 +02:00
Mario Zechner
39294a5e95 fix(chord): a failed IPC write ends the link instead of raising an unhandled error
A host that wrote to a peer process which had just exited (an ack timer firing after the worker's exit, before the
channel's disconnect) got EPIPE as an unhandled 'error' event. IpcLink now passes a send callback and ends the link on
failure; host-manager control messages to a gone peer are dropped (its exit reports it).
2026-10-14 08:07:35 +00:00
Mario Zechner
00d8d04955 fix(chord): reload and retirement correctness across hosts; no leaked code generations
- A child that says hello during a cluster reload is fenced at once and reconciled after the reload ends, to the
  committed code version (it was marked in sync without voting); a running reconciliation also waits for the reload.
- A child retires a code version only after its parent did (spec section 12): the coordinator retires before it
  prepares, and children learn already retired versions at hello and before a reconciliation's prepare.
- Forced retirement aborts the leftover roots of the old code version, relayed calls included, before it closes the
  resources only that code used.
- A task's replacement starts after the old run has ended, at most taskStopDeadline later.
- A kept resource adopts the newest declaration's close at commit.
- Disposed objects and old code generations are released: Ref bindings are weak, finished disposals leave the dying
  table, stopped tasks are dropped, and contexts link abort signals without AbortSignal.any (which kept linked signals
  and their listeners reachable).
- Facets get FacetApi.signal, aborted when their run is replaced, removed, aborted or the host closes.
- Regression tests for each, including a garbage-collection test of old code generations.
2026-10-14 07:08:02 +00:00
Mario Zechner
d20c6e9662 refactor(chord): declarations by name, void and no-argument methods, per-cell state versions
- self.state(name, schema, initial, { version?, migrate? }) returns the cell; the state version and migration live on
  the cell (ServeOptions.state is gone). self.derive(sources, fn) has no name and is recomputed at commit.
  self.resource(name, { version, deps?, exclusive?, open, close? }) (rev is version). self.task(fn). self.on(name,
  source, [select,] handler) replaces listen/listener. cell(), derivation(), resource(), listener() and the
  declaration maps are gone; a name declared twice in one factory run is an error.
- A listener on state receives the current value at start and after every reload: handlers must reconcile.
- method(args?, result?): an omitted result is void, omitted arguments make a no-argument method called as
  ref.name(ctx) and implemented as (ctx) => ...; the wire omits both.
2026-10-14 06:12:23 +00:00
Mario Zechner
2688aba7dc refactor(chord): name things after the concepts; object variants; link protocol version; object lifetimes
- References are Ref<C> (was Handle<C>), objects ObjectImpl (record.ts is object.ts), ImplementationOf<C> (was
  BehaviorOf<C>), ResourceDeclaration (was ResourceSpec); epochs are code versions (codeVersion in Ctx, RootOptions,
  Shape, Host, frames and reload reports). Docs say object and reference.
- A remote object's variant is named variant (was kind): factories return { variant }, references expose ref.variant.
- Links announce a protocol version (PROTOCOL_VERSION = 2) in hello; peers of different versions close the link with
  reason protocol-version <n> and report it through LinkOptions.onProtocolMismatch.
- ServeOptions.lifetime ("referenced" | "host") replaces eager: a host-lifetime object is local, has an empty input,
  exists once per host and lives until the host closes; awaitEager is awaitHostObjects. A reload that makes a type
  referenced releases the host's own reference.
2026-10-14 05:34:14 +00:00
Armin Ronacher
3daa20280f fix(coding-agent): keep codemode cancellation prompt and bounded
Refs #10748
2026-10-13 18:17:31 +02:00
Christian Klotz
b9ab2a6238
docs(coding-agent): restructure NVIDIA RTX llama.cpp prerequisites 2026-10-13 15:04:38 +01:00
David Brailovsky
6f2f164ab7
fix(coding-agent): restore active tools on session resume (#10887)
The SDK always passed initial tools, so the constructor never restored the
loadout recorded in the transcript, and resumed sessions dropped tools activated
during the session. Sessions that use the default tools now restore the recorded
loadout, with --tools +name/-name entries applied to it.

fixes #10785
2026-10-13 15:55:12 +02:00
David Brailovsky
34a8bb38b2 fix(ai): drop images from Anthropic error tool results
Anthropic rejects error tool results whose content is not all text, which
stalled sessions after a failed codemode script that had shown images.
Images in error tool results are now replaced with a text note.

fixes #10794
2026-10-13 15:45:12 +02:00
Vegard Stikbakke
cea257439d feat(coding-agent): configure session share destination
closes #10870
2026-10-13 15:41:13 +02:00
David Brailovsky
4b994d5e5e fix(ai): repair invalid \u escapes in tool-call arguments
Invalid \u escapes such as \usepackage were treated as valid, so JSON
parsing failed and the partial-json fallback dropped the field and
everything after it. They are now kept as literal text like other
invalid escapes.

fixes #10868
2026-10-13 15:36:01 +02:00
Christian Klotz
746d995b88
docs(coding-agent): add NVIDIA RTX llama.cpp setup 2026-10-13 14:15:52 +01:00
Armin Ronacher
f13c00fb3a fix: pin internal dependencies to exact versions
Update release synchronization and dependency checks to enforce exact versions. Refresh both lockfiles and add regression coverage.

closes #10865
2026-10-13 14:28:15 +02:00
Armin Ronacher
db6497c3d9 feat(chord): flow control links end to end and limit calls per link
Peers acknowledge processed frames (ack, announced with acks in hello). While a window of frames is unacknowledged, state frames wait at the sender, coalesced per subscription, instead of queuing in front of call results; slots that outgrow their bound become resets, or a downstream resubscription on relays. AcceptOptions gains maxCalls, answering calls beyond it with unavailable/too_many_calls. Link.send returns the encoded frame size.
2026-10-13 13:09:04 +02:00
Mario Zechner
a4d040d30f fix(chord): a forked child host no longer inherits its parent's CHORD2_LOCK
forkDriver spread process.env into the child, so a child host that forks its own children (or a test run inside a p2 worker) passed its lock on, and children without a lock of their own failed with "locked".
2026-10-13 10:05:19 +00:00