Repository navigation
PiSharp 1.1.0.3
·
1288 commits
to main
since this release
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(defaulttrue),compaction.reserveTokensand
compaction.keepRecentTokensfromsettings.jsonand compact automatically, as Pi
does. Set"compaction": { "enabled": false }to turn it off. - OpenAI Codex tries a WebSocket first. The
transportsetting defaults toauto, 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-pcompacts 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_modeandset_follow_up_modewritecompaction.enabled,
retry.enabled,steeringModeandfollowUpModeto the globalsettings.json, as
Pi'sAgentSessiondoes. - Azure resource names are taken as Pi takes them.
AZURE_OPENAI_RESOURCE_NAME(or
azureResourceName) goes intohttps://<name>.openai.azure.com/openai/v1and is read
as Node'sURLreads 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
/clearcrash (#5)./clearand
/newon 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 extensionsetThinkingLevel/setModel.- RPC errors carry the real message. A failed RPC command answers with the error's
message, asrpc-mode.tsdoes, 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_settledordering.agent_settledis published before the response to the
command that started the run.triggerTurntiming. An extension'ssendMessage(…, { 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
spawnerrors (spawn bash ENOENT,
spawn EACCESand so on), and thebashtool 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_foundis 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-modelslists the providers that loaded extensions register.
New
- Built-in extensions on and off. Pi's four built-in extensions,
mcp,llama.cpp,
codemodeandtool-search, are resources like any other:"-builtin:mcp"in
extensionsturns one off, project settings override with+builtin:or-builtin:,
pisharp configlists them under Built-in,--no-extensionsturns 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
andLLAMA_API_KEY, model discovery,/llamato load, unload and download models from
Hugging Face, and its models as classifiers. Pi's
llama.cpp guide
ships next to the CLI asdocs/llama-cpp.md. - Native classifier and image providers. C# extensions can register classifier and
image providers, as TypeScript extensions already could. ctx.ui.setThemeswitches and saves the theme in interactive mode. RPC mode answers
Pi's "Theme switching not supported in RPC mode".-epackages 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 inPiSharp.AI. Frames are valid zstd but not byte-identical to
Node's. - X11 clipboard. Pasting on X11 reads the clipboard through
libxcbwhenwl-paste,
xclipandxselare 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. /mcpand/llamaare listed byget_commandsand work outside interactive mode as
in Pi.pisharp mcphonours--offline,PI_OFFLINEandhttpProxy.- The samples ship
pisharp-extension.jsonand load from Pi's extension folders.
Differences from Pi
Intentional:
- No install telemetry.
PI_TELEMETRYandenableInstallTelemetryare ignored. - Requests to Anthropic, Azure, Bedrock, Mistral, OpenAI-compatible endpoints and
OpenRouter images carry aPiSharpuser agent where Pi's SDKs send their own. - Codemode runs each script in a worker process on Jint (decision 0003 and 0004 item 7).
/bugopens 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 updatecan't update PiSharp itself. Usedotnet tool update -g PiSharp.Cli.
Still open:
/reloadand MCP./reloadkeeps MCP servers connected, and doesn't re-read
mcp.json, unless themcp,codemodeortool-searchbuilt-ins changed. Pi
reconnects every server on every reload./reloaddiagnostics. 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
registerscodemode,tool_searchor/mcpdoesn't replace the built-in. - JSON depth. JSON values hold 1,000 levels of nesting. Pi's
JSON.parsehas no
limit, though V8'sJSON.stringifygives up at about 1,700 levels. - Explicit session verbs.
pisharp session …and therpcverb 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_statsfails on non-finite usage numbers, where Pi
reportsnull. models.jsonerrors use TypeBox's wording but not its full list of union errors.websocketConnectTimeoutMsisn'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