Remove SystemMessage.replace. A prompt forced from before_agent_start is a rendering
of the current prompt for the run, not conversation state: persisting it as a
replacing system message wrote the full prompt and tool list on every change,
lost the structured sections while forced, and disabled mid-conversation system
messages for the rest of the session once a replacement existed.
The transcript now always records section patches. AgentSession wraps
transformContext and, when a forced prompt is active, collapses the system
messages into one head carrying the forced text and the current tools. Providers
receive the same request as before; nothing is persisted and the projection ends
with the run.
The evals harness validated the without_docs variant from the transcript, which
relied on the persisted replacement. Its transform extension now records the
prompt it forced and validates that instead.
Map signal termination to conventional nonzero exit codes and reject null exit codes from custom shell operations while preserving partial output.
fixes#9577
Add SystemMessage.replace: replaying a system message with the flag discards the
accumulated prompt content, sections, and tools before applying it, and providers
collapse the transcript into one leading system message whenever a later message
replaces it.
A forced prompt from before_agent_start is opaque, so it is persisted as a replace
message holding the text in content with no sections (the agent loop fills in the
full tool set). Leaving force mode persists another replace message with the
structured sections. Previously the forced prompt became a preamble section patch,
so models with native mid-conversation system messages kept the original prompt
as their leading system prompt and received the forced one as a later update.
* fix(coding-agent): fail closed on user bash hook errors
Prevent failed execution-routing hooks from falling back to the local shell.
Fixes#9068
* fix(coding-agent): validate user bash hook results
* docs(coding-agent): clarify user bash result semantics
* docs(coding-agent): streamline user bash semantics
* fix(coding-agent): strengthen user bash regressions
* docs(coding-agent): clarify user bash breaking change
This change makes system prompt text and tool changes part of the transcript rather than silently rewriting its starting conditions. This lets Pi record when instructions changed or tools became available, restore that state after resuming or navigating branches, and preserve cached prompt prefixes where the upstream supports it.
Follow-up to e687434a6.
Recheck compaction state after navigation dialogs and response cancellation before replacing status indicators or escape handlers. Document navigation conflicts and add regression coverage.
Replace the external clipboard dependency with small macOS, Windows,
and X11 helpers and integrate them into coding-agent.
Run native clipboard operations on worker threads and make command
fallbacks asynchronous. Preserve incremental X11 transfers, legacy text
encodings, native image formats, and existing Wayland and platform tools.
Include native prebuilds with ARM64 page alignment, packaging updates,
and regression coverage.
Separate stable and development entrypoints, exclude remote harness code from distributions, and verify isolated consumer installs before release. Fixes#9132.
Adds TuiAltScreenOptions.scrollToEndIndicator, composited onto the last
row of the follow-end primary scroll view while it is scrolled up. A left
press on the label resumes end-following. Minimal rebuild of #9080.
The fd/ripgrep auto-download resolved the latest version through
api.github.com, which shares the anonymous API quota (60 requests/hour
per IP). Behind shared egress IPs (corporate proxies, CI runners, NAT)
that quota is permanently exhausted by unrelated traffic, so the
download failed with 'GitHub API error: 403' on every launch while the
actual release download endpoint would have worked fine.
Resolve the version from the /releases/latest web redirect instead: it
carries the tag in the Location header, is not subject to the API
quota, and lives on the same origin as the binary download itself. The
redirect body is discarded so the connection can be reused, and the
pinned fd version on darwin/x64 now skips the lookup entirely.
Also improve download failure diagnostics: status messages include the
error cause chain so transport errors surface their actionable detail
instead of a bare 'fetch failed', and HTTP download errors include the
failing URL.
Fixes#8594
Co-authored-by: Terminator666666 <Terminator666666@users.noreply.github.com>
* feat(coding-agent): ingest external entries in in-memory sessions
SessionManager.inMemory() takes the entries to start from, so a session
held outside the filesystem can be resumed as it was stored.
Replaying through appendMessage/appendCompaction cannot do this: ids are
minted fresh, so every stored firstKeptEntryId, targetId and fromId has to
be remapped, timestamps are rewritten, and parentId always comes from the
current leaf, so a branched tree needs the original branch() choreography
reproduced call by call.
The entry-adoption half of _setSessionFile becomes _loadEntries, which the
constructor also uses when there are entries but no file. Entries carrying
a session header keep it; without one, the header comes from the options
and the entries become its body.
* fix(coding-agent): carry the stored version through restored entries
inMemory() took SessionEntry[], which excludes SessionHeader, so an
external store could not pass the header it saved and the header branch of
_loadEntries was unreachable through the public API. A restore therefore
always synthesised a current-version header, and the migration that ran
next read that header and skipped: a v2 session kept its hookMessage roles
forever.
Widening to FileEntry[] lets the stored header through, version included.
Migration moves inside the header branch, where a version exists to compare
against; without a header the entries are adopted as current-version, which
is the only thing they can mean.