Repository navigation
PiSharp 1.2.0
PiSharp 1.2.0
PiSharp 1.2.0 moves the porting baseline from Pi v1.1.0 to Pi v1.2.0 (commit
06a466935536f8c9bcacb2d5efc0fc021be1bdff, released 2026-10-12). As before, matching the
upstream version names the baseline; it is not a claim of complete behavioral parity. Each
upstream change is tracked, with its tests, in
sync-1.2.0-applicability.json; the
decisions are in decision 0006.
Breaking changes
These follow Pi 1.2.0's breaking changes.
before_agent_startalso fires for extension-triggered runs. A run started by
pi.sendMessage(..., { triggerTurn: true })while idle goes through the same setup as a
prompt. The event is a union onmessageType:"user"events carrypromptandimages,
"custom"events carry the startingmessageand no prompt. Handlers that assume a
prompt should checkmessageType. Native C# extensions get
ExtensionBeforeAgentStartEvent.MessageTypeandMessage.- The session is busy while a run starts, including while
before_agent_starthandlers
run.ctx.isIdle()is false,pi.sendMessage()joins the starting run, and
pi.sendUserMessage()needsdeliverAs; without it the call fails with "Agent is already
processing". The nativesendUserMessageaction withoutDeliverAsused to steer while
busy; it now fails the same way. An abort requested while a run starts aborts it as it
starts. - Configuration schemas.
models.json,keybindings.jsonand themes are validated
with Pi's published schemas, so error messages change. Themes are validated strictly
(no unknown keys, reusable colours undervars), including the themes loaded at
startup. Keybinding values must be valid key ids. pisharp mcp list --jsonreportsresources: truefor servers that offer resources,
instead of resource and template counts. Connecting no longer lists resources.- Codemode: an
// @options:line anywhere but the first line now fails the call
instead of being ignored. MCP tool declarations spell out their result type
(content,structuredContent,isError) instead of the removedCallToolResult<T>. - Model catalog: from pi-ai 1.2.0.
claude-sonnet-4-5now has a 200,000-token
context window (it was 1,000,000).
New
- Per-key OpenRouter model lists: with an OpenRouter key, the
openroutercatalog lists
only the chat models that key may use, with its context size, max output and prices.
The base URL set inmodels.jsonis followed, so regional and guardrail endpoints work.
The list is saved and used offline. - Published configuration schemas:
$schemais accepted insettings.json,
models.json,keybindings.jsonand themes. Validation uses the schemas published at
https://pi.dev/schemas/, through a port of the TypeBox validator (the public
PiSharp.Agent.TypeBoxJsonSchema). - Tool reach: tools declare which tools a call may reach (
reachesTools; native
ExtensionToolDescriptor.ReachesToolsandToolReach). MCP waits, before any tool runs,
only for the servers a call may reach. Tool namespaces gainaliases; MCP namespaces use
the server name. - Codemode: declarations show input constraints (integer, bounds, lengths, pattern,
format, default, deprecated) as@tags. The row shows elapsed time while a script runs
and total time once it finished. - Clipboard:
PI_CLIPBOARD_OSC52=1also sends copies with OSC 52, for remote sessions
Pi cannot detect. - Extensions: TypeScript extensions run against the Pi 1.2.0 npm packages.
- Pi 1.2.0 identity: user agents, MCP
clientInfoand bug reports name Pi 1.2.0.
Fixed
- Mistral streams were aborted mid-generation after the request timeout. The timeout now
covers only the wait for response headers. - Anthropic requests failed when the provider rejected the strict tool set. They are now
retried once with preferred tools non-strict. - "The upstream provider returned an error" is retried as a transient error.
- OpenRouter router models no longer show a cost of -$1,000,000 per 1M tokens.
- Runs started by
pi.sendMessage(..., { triggerTurn: true })keep the system prompt that
before_agent_startset for every request of the run. - Compaction, branch summaries and bug reports no longer include thinking blocks.
- A symlinked
AGENTS.mdin a nested git worktree loads. ~is expanded in!pattern,+pathand-pathresource entries.- Print mode prints a response cut off at the output token limit, warns on stderr and
exits 1. - A command that starts a turn with
pi.sendMessage(..., { triggerTurn: true })and returns
withoutctx.waitForIdle()no longer makespisharp -pexit 1. As in Pi, the run is
aborted when print mode exits. - Aborting a run while an extension's
contexthandler runs ends the run aborted, as in Pi,
instead of failing the session. - MCP: tool calls accept structured content that is not an object; MCP servers with
resources register their tools without waiting for resource listings; a call cancelled
while waiting for an OAuth refresh is not sent afterwards; sign-in rejects aniss
parameter it cannot check. auth.jsonon Windows: a lock folder still being deleted is retried briefly.- Codemode: joining many
text()outputs is linear, and a script that only awaits
(while (true) await null) is stopped by its timeout. - Terminal: focused overlays no longer block wheel scrolling, fragmented terminal colour
replies no longer leak into the prompt, Herdr shows inline images, bindings that name a
shifted symbol (+,ctrl++) match, the compaction status uses the editor's border
colour, andshowHardwareCursoruses only the terminal cursor. pisharp mcp login --helpdescribes--timeoutas the limit for the whole sign-in.tool_searchlowercases a dotted capital I (İ, U+0130) as JavaScript does, so
İstanbulis ranked by the termsiandstanbul, as in Pi.
Known gaps
- TypeScript tools that declare
reachesToolsreach every tool: their calls wait for every
MCP server. Exact per-input reach needs an asynchronous extension contract. - The unthemed codemode row of the native renderer contract shows the total time once a
script finished, but no live elapsed clock. The interactive mode shows both. - Codemode's new sandbox hosts and deterministic runs,
pi-env,pi-durable, Chord and the
removed client, server and protocol packages are out of scope, as recorded in decision
0006.
Packages
All library packages and the PiSharp.Cli dotnet tool are published as 1.2.0:
dotnet tool update -g PiSharp.Cli