Skip to content

PiSharp 1.1.0.3

Choose a tag to compare

@github-actions github-actions released this 10 Oct 17:11
· 1288 commits to main since this release
f46bd6e

PiSharp 1.1.0.3

A C#-only patch on the Pi v1.1.0 baseline (commit
abe508e1b89912adde45528136c3221eb69acdd7). It fixes the /clear crash reported in
#5 and closes most of the differences from
Pi that 1.1.0.2 listed as open. Each area is tracked, with its test suites, in
sync-1.1.0-applicability.json
(rows parity.*). Owner decisions are in
decision 0004; item 14 is new.

The Parity page lists what still differs from Pi.

Behaviour changes

  • Auto-compaction is on in every mode. Print, JSON, RPC and interactive sessions read
    compaction.enabled (default true), compaction.reserveTokens and
    compaction.keepRecentTokens from settings.json and compact automatically, as Pi
    does. Set "compaction": { "enabled": false } to turn it off.
  • OpenAI Codex tries a WebSocket first. The transport setting defaults to auto, as
    in Pi: requests go over a WebSocket and fall back to server-sent events when it fails
    before the first event. Server-sent-event request bodies are compressed with zstd, as
    Pi always compresses them. Set "transport": "sse" to stay on server-sent events.
  • Print mode recovers from "prompt is too long". With auto-compaction on, a context
    overflow in -p compacts the session, retries and exits 0, as Pi's print mode does.
  • RPC and print setters save settings. set_auto_compaction, set_auto_retry,
    set_steering_mode and set_follow_up_mode write compaction.enabled,
    retry.enabled, steeringMode and followUpMode to the global settings.json, as
    Pi's AgentSession does.
  • Azure resource names are taken as Pi takes them. AZURE_OPENAI_RESOURCE_NAME (or
    azureResourceName) goes into https://<name>.openai.azure.com/openai/v1 and is read
    as Node's URL reads it, so names with dots, upper case or underscores work. 1.1.0.2
    accepted a single DNS label only (decision 0004, item 14).

Fixed

  • /clear crash (#5). /clear and
    /new on a model whose thinking can't be turned off failed with "RPC command failed.".
    Thinking levels are now clamped to the model everywhere Pi clamps them: on new,
    resumed, forked, cloned and switched sessions, --thinking, set_thinking_level, model
    switches and extension setThinkingLevel/setModel.
  • RPC errors carry the real message. A failed RPC command answers with the error's
    message, as rpc-mode.ts does, instead of "RPC command failed.".
  • The interactive footer follows the session. Cost, token, cache and context figures
    update after every turn, tool call, model change, compaction and session switch.
  • agent_settled ordering. agent_settled is published before the response to the
    command that started the run.
  • triggerTurn timing. An extension's sendMessage(…, { triggerTurn: true }) starts
    its turn at once, inside a command or from a timer, as in Pi. It is no longer deferred
    until the command returns or dropped after about 30 seconds.
  • Shell start failures report Node's spawn errors (spawn bash ENOENT,
    spawn EACCES and so on), and the bash tool stays registered when no shell is found,
    failing each command with Pi's discovery message.
  • Error texts. Compaction, fork and tree-navigation failures carry Pi's messages.
  • Codex continuation. previous_response_not_found is retried once even after events
    arrived, and session WebSockets close when the session is disposed.
  • Classifier and image providers registered without an API key need a stored or
    explicit credential, as in Pi.
  • --list-models lists the providers that loaded extensions register.

New

  • Built-in extensions on and off. Pi's four built-in extensions, mcp, llama.cpp,
    codemode and tool-search, are resources like any other: "-builtin:mcp" in
    extensions turns one off, project settings override with +builtin: or -builtin:,
    pisharp config lists them under Built-in, --no-extensions turns them off and
    -e builtin:<name> loads one. A built-in that is off registers nothing: no tools,
    commands, providers or MCP servers.
  • llama.cpp. The llama.cpp router provider, with /login llama.cpp, LLAMA_BASE_URL
    and LLAMA_API_KEY, model discovery, /llama to load, unload and download models from
    Hugging Face, and its models as classifiers. Pi's
    llama.cpp guide
    ships next to the CLI as docs/llama-cpp.md.
  • Native classifier and image providers. C# extensions can register classifier and
    image providers, as TypeScript extensions already could.
  • ctx.ui.setTheme switches and saves the theme in interactive mode. RPC mode answers
    Pi's "Theme switching not supported in RPC mode".
  • -e packages add their skills, prompt templates and themes, not only their
    extensions.
  • OpenAI Codex WebSocket transport (auto, websocket, websocket-cached, sse),
    with Pi's connection reuse, continuation, retries and fallback diagnostics.
  • zstd. Codex server-sent-event requests are compressed with zstd, by a
    dependency-free encoder in PiSharp.AI. Frames are valid zstd but not byte-identical to
    Node's.
  • X11 clipboard. Pasting on X11 reads the clipboard through libxcb when wl-paste,
    xclip and xsel are missing, as Pi's built-in helper does.
  • JSON as JavaScript carries it. Escaped lone surrogates stay lone surrogates in RPC
    input, prompts, streamed text, tool-call arguments, tool results, object names and
    session lines. Usage token counts may be fractional and are priced in binary64. JSON
    values hold 1,000 levels of nesting (formerly 64). On the Pi command line, session
    lines, RPC lines, streamed events and tool results are bounded by JavaScript's string
    limit (536,870,888 characters) instead of PiSharp's byte caps.
  • /mcp and /llama are listed by get_commands and work outside interactive mode as
    in Pi. pisharp mcp honours --offline, PI_OFFLINE and httpProxy.
  • The samples ship pisharp-extension.json and load from Pi's extension folders.

Differences from Pi

Intentional:

  • No install telemetry. PI_TELEMETRY and enableInstallTelemetry are ignored.
  • Requests to Anthropic, Azure, Bedrock, Mistral, OpenAI-compatible endpoints and
    OpenRouter images carry a PiSharp user agent where Pi's SDKs send their own.
  • Codemode runs each script in a worker process on Jint (decision 0003 and 0004 item 7).
  • /bug opens a prefilled PiSharp GitHub issue instead of uploading (decision 0004,
    item 11).
  • The version check asks NuGet for PiSharp.Cli (decision 0004, item 12), and
    pisharp update can't update PiSharp itself. Use dotnet tool update -g PiSharp.Cli.

Still open:

  • /reload and MCP. /reload keeps MCP servers connected, and doesn't re-read
    mcp.json, unless the mcp, codemode or tool-search built-ins changed. Pi
    reconnects every server on every reload.
  • /reload diagnostics. After /reload, only extension load errors are shown. Pi
    also shows built-in replacement warnings, unknown built-in names, package resolution
    problems and skill, prompt and theme conflicts.
  • Built-in replacement considers TypeScript extensions only: a C# extension that
    registers codemode, tool_search or /mcp doesn't replace the built-in.
  • JSON depth. JSON values hold 1,000 levels of nesting. Pi's JSON.parse has no
    limit, though V8's JSON.stringify gives up at about 1,700 levels.
  • Explicit session verbs. pisharp session … and the rpc verb keep their byte
    bounds (64 MiB session lines and files, 32 MiB RPC records, 8 MiB tool results) and
    refuse lone surrogates. Provider request bodies stay limited to 64 MiB and single
    request entries to 16 MiB everywhere.
  • Non-finite usage. get_session_stats fails on non-finite usage numbers, where Pi
    reports null.
  • models.json errors use TypeBox's wording but not its full list of union errors.
  • websocketConnectTimeoutMs isn't read; the Codex WebSocket always gets Pi's default
    15 seconds to open.
  • Azure resource names that leave credentials, a fragment or a query in the URL, or a
    host .NET can't hold, are refused when the session starts; Pi fails only on the request
    (decision 0004, item 14).

Out of scope, unchanged from decision 0002:
pi-durable, pi-env, the experimental server and client modes, and Nix packaging.

Packages

All library packages and the PiSharp.Cli dotnet tool will be published as 1.1.0.3:

dotnet tool update -g PiSharp.Cli