Skip to content

PiSharp 1.2.0

Choose a tag to compare

@github-actions github-actions released this 16 Oct 00:22
· 1189 commits to main since this release
849cfe7

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_start also 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 on messageType: "user" events carry prompt and images,
    "custom" events carry the starting message and no prompt. Handlers that assume a
    prompt should check messageType. Native C# extensions get
    ExtensionBeforeAgentStartEvent.MessageType and Message.
  • The session is busy while a run starts, including while before_agent_start handlers
    run. ctx.isIdle() is false, pi.sendMessage() joins the starting run, and
    pi.sendUserMessage() needs deliverAs; without it the call fails with "Agent is already
    processing". The native sendUserMessage action without DeliverAs used 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.json and themes are validated
    with Pi's published schemas, so error messages change. Themes are validated strictly
    (no unknown keys, reusable colours under vars), including the themes loaded at
    startup. Keybinding values must be valid key ids.
  • pisharp mcp list --json reports resources: true for 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 removed CallToolResult<T>.
  • Model catalog: from pi-ai 1.2.0. claude-sonnet-4-5 now has a 200,000-token
    context window (it was 1,000,000).

New

  • Per-key OpenRouter model lists: with an OpenRouter key, the openrouter catalog lists
    only the chat models that key may use, with its context size, max output and prices.
    The base URL set in models.json is followed, so regional and guardrail endpoints work.
    The list is saved and used offline.
  • Published configuration schemas: $schema is accepted in settings.json,
    models.json, keybindings.json and 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.ReachesTools and ToolReach). MCP waits, before any tool runs,
    only for the servers a call may reach. Tool namespaces gain aliases; 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=1 also 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 clientInfo and 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_start set for every request of the run.
  • Compaction, branch summaries and bug reports no longer include thinking blocks.
  • A symlinked AGENTS.md in a nested git worktree loads.
  • ~ is expanded in !pattern, +path and -path resource 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
    without ctx.waitForIdle() no longer makes pisharp -p exit 1. As in Pi, the run is
    aborted when print mode exits.
  • Aborting a run while an extension's context handler 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 an iss
    parameter it cannot check.
  • auth.json on 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, and showHardwareCursor uses only the terminal cursor.
  • pisharp mcp login --help describes --timeout as the limit for the whole sign-in.
  • tool_search lowercases a dotted capital I (İ, U+0130) as JavaScript does, so
    İstanbul is ranked by the terms i and stanbul, as in Pi.

Known gaps

  • TypeScript tools that declare reachesTools reach 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