Commit graph

742 commits

Author SHA1 Message Date
Armin Ronacher
5674690966
feat(tui,coding-agent): add color values and theme styling (#8398)
Expose theme colors as values and add theme.style() for combined styling.

- @earendil-works/pi-tui gains a Color type (palette index, sRGB, OKLCH) with parseColor(), mixColors(), colorToHex(), colorToRgb(), styleText() and related helpers.
- Theme JSON accepts #rgb and oklch(...) values and an optional appearance ("dark" or "light"), detected from the theme colors when omitted.
- theme.style() combines tokens or concrete colors with text attributes; theme.colors exposes concrete colors, including the terminal's reported default colors (OSC 10/11) for tokens set to "".
- Terminals with TERM=*-direct are detected as truecolor.
2026-09-24 14:42:22 +02:00
Armin Ronacher
a328aa89ad
feat(ai,coding-agent): unify image and classifier model infrastructure (#9948) 2026-09-23 17:41:19 +02:00
David Brailovsky
002fc83852
feat: expose provider stream events to extensions (#9901)
Add onProviderStreamEvent through pi-ai and agent core, and surface
provider_stream_event to coding-agent extensions.

Closes #9784
2026-09-23 16:03:30 +02:00
Armin Ronacher
8d897edaa6 fix(coding-agent): prevent duplicate extension runtimes (closes #9863) 2026-09-23 15:33:56 +02:00
Christian Klotz
25cc5c7bf4
docs(coding-agent): refresh documentation (#9898)
* docs(coding-agent): improve getting started documentation

* docs(coding-agent): correct getting started details

* docs(coding-agent): clarify SDK entry point

* docs(coding-agent): restructure guides and references

* docs(coding-agent): improve getting started guides

* docs(coding-agent): refresh integration guides

* docs(coding-agent): improve terminal and CLI guides

* docs(coding-agent): refresh customisation guides

* docs(coding-agent): clarify project trust terminology

* docs(coding-agent): simplify customisation guidance

* docs(coding-agent): improve runtime and reference guidance

* Fix settings reference

* feat(coding-agent): add Crowdin documentation sync

* docs(coding-agent): separate CLI and slash command references

* docs(coding-agent): correct compaction reference

* docs(coding-agent): streamline package documentation

* docs(coding-agent): split RPC reference documentation

* Update configuration docs

* Shorten config docs

* docs(coding-agent): refine configuration references

* docs(coding-agent): streamline settings reference

* docs(coding-agent): clarify configuration reference

* docs(coding-agent): clarify project trust exception

* docs(coding-agent): simplify keybindings reference

* docs(coding-agent): remove Crowdin integration

* docs(coding-agent): turn themes reference into guide

* docs(coding-agent): consolidate model and authentication docs

* docs(tui): require Component.invalidate() (fixes #9358)

* docs(coding-agent): document offline catalog behavior (fixes #8684)

* docs(coding-agent): preserve established documentation routes

* docs(coding-agent): reorganize documentation navigation

* docs(coding-agent): correct audited behavior

Clarify provider, session, local-model, Termux, TUI, SDK, debug, and extension behavior. Simplify the documentation audit to report only clear user-visible contradictions.

* docs(coding-agent): fix broken documentation links
2026-09-22 16:48:19 +02:00
Armin Ronacher
aef5fc429b
fix(coding-agent): keep prompt and tool state across context handlers (#9846)
Since 0.86 the prompt and tool declarations live in transcript system
messages, so a context handler that filters or slices messages could drop
them. After extension-driven compaction this sent requests without built-in
tools and made Codex emit raw tool-call text.

context handlers now see the conversation only. An unchanged list keeps the
transcript as is; a changed list gets the replayed prompt sections and tool
declarations as one leading system message. Handler-added system messages
are kept after it.

Add context_with_system, which runs after every context handler on the full
transcript and sends its result verbatim, for extensions that need to edit
system messages per request. Dropping the leading system message is reported
as an extension error.

closes #9789, closes #9822
2026-09-21 17:14:22 +02:00
Mario Zechner
466db0fecd feat: add canonical session context boundaries
Make SessionManager projections authoritative for provider requests, add append-only context edits and actionable turn boundaries, and preserve existing queue scheduling during continuation and recovery.
2026-09-21 16:59:20 +02:00
Armin Ronacher
f5c946480c feat(ai,coding-agent): add image input limits (closes #9631) 2026-09-20 22:59:16 +02:00
Alexey Zaytsev
b73412a378
feat(ai,coding-agent): add Meta provider with Muse subscription OAuth (#9096)
Device authorization flow against auth.meta.com mints a Model API key via the Muse Code key-mint endpoint. Identity token stored as refresh, minted key as access; daily re-mint via the standard OAuth scheduler. Identity is non-renewable (no refresh grant), so mint 401/403 directs to /login meta. Models sourced from models.dev; default muse-spark-1.3.
2026-09-20 11:13:43 +02:00
Armin Ronacher
c596d09d9c
feat(coding-agent): add prompt cache warming (#9668) 2026-09-19 21:18:15 +02:00
Armin Ronacher
4d38031fbd feat(ai): ship Radius model catalog 2026-09-19 19:23:31 +02:00
Armin Ronacher
3c75b27479 feat(coding-agent): add bug reporting 2026-09-19 17:55:49 +02:00
Ramiz Wachtler
46c9de402b
feat(coding-agent): add event handler unsubscribe (#9630) 2026-09-17 21:44:26 +02:00
Armin Ronacher
16292398af fix(coding-agent): send forced system prompts without recording them
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.
2026-09-17 20:02:23 +02:00
Armin Ronacher
e4c75a7322 fix(coding-agent): replace the system prompt when a handler forces it
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.
2026-09-16 23:35:01 +02:00
Christian Klotz
509ee2bd0b
fix(coding-agent): fail closed on user bash hook errors (#9662)
* 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
2026-09-16 17:21:17 +01:00
Armin Ronacher
9e05370b29
Mid conversation system messages (#9548)
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.
2026-09-16 15:54:07 +02:00
David Brailovsky
b03a367a4f feat(coding-agent): allow configuring Anthropic fallback models
Allow models.json overrides to replace or disable server-side fallback metadata.

Fixes #9294
2026-09-16 10:50:24 +02:00
Vegard Stikbakke
d92eb8d4b1 feat(ai): enable Fireworks Messages deferred tool loading 2026-09-10 21:18:35 +02:00
Vegard Stikbakke
46bde88a1c feat(coding-agent): support per-model compaction token budgets
Closes #8133
2026-09-10 08:37:20 +02:00
Christian Klotz
f3564a1d41
docs: validate documentation navigation and reachability (#9380)
* feat: use docs manifest for documentation evals

* feat: support nested documentation navigation

* docs(coding-agent): validate documentation reachability

* docs(coding-agent): remove catalog schema version
2026-09-09 17:34:42 +02:00
David Brailovsky
c37b0e03b5 fix: cap agent retry backoff
Add a configurable 60-second default cap for assistant and summarization retry delays across coding-agent and the agent harness.

Fixes #8826
2026-09-09 11:54:56 +02:00
Christian Klotz
9211da1723
feat: add implementation-backed documentation evals (#9280)
* feat: add implementation-backed documentation evals

Generate one model-backed audit per cataloged documentation page and validate the catalog deterministically. Support terminating custom audit tools through the Pi eval harness.

* feat: inline documentation audit schema

* docs: document focused documentation eval command

* feat: simplify documentation audit setup
2026-09-07 20:21:39 +01:00
Vegard Stikbakke
c1d4c80111 fix(coding-agent): embed all session status spinners in the editor border 2026-09-07 15:31:00 +02:00
Ramiz Wachtler
aa23e784c6
fix(coding-agent): update repository links to "earendil-works/pi" (#9278)
- update repository links in prompts, docs, and code to use `earendil-works/pi` instead of `earendil-works/pi-mono`
2026-09-07 14:09:39 +02:00
Vegard Stikbakke
47acd8e6cf fix(coding-agent): preserve active operation UI during tree navigation
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.
2026-09-07 12:59:20 +02:00
Ramiz Wachtler
1f78cea7ad
fix(coding-agent): allow extensions to stream from custom providers (#9272)
- fixes #8964
2026-09-07 12:16:12 +02:00
Armin Ronacher
caf6dfe731
feat(tui): Simplify clipboard handling (#9163)
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.
2026-09-05 23:52:32 +02:00
Armin Ronacher
1382777ed8 fix(coding-agent): keep remote harness dependencies development-only
Separate stable and development entrypoints, exclude remote harness code from distributions, and verify isolated consumer installs before release. Fixes #9132.
2026-09-05 12:45:04 +02:00
Armin Ronacher
17de82d7be feat(ai): add GPT-6 Astra support 2026-09-04 22:08:06 +02:00
Ramiz Wachtler
92d8e2d17d
fix(coding-agent): selector save keybindings (#9149)
- fixes #8797
2026-09-04 18:06:21 +02:00
Manuel de la Peña
47236c8445
docs(coding-agent): document running pi in Docker Sandboxes (#9077) 2026-09-04 15:27:32 +02:00
Cristina Poncela Cubeiro
457ae8c79c
feat(tui): alt mode scrollbar but prettier (#8801) 2026-09-04 00:05:47 +02:00
Armin Ronacher
79680533c6 feat(tui): add clickable jump-to-end indicator to fullscreen transcript
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.
2026-09-03 22:54:59 +02:00
Cristina Poncela Cubeiro
1d9787c11f
feat(tui): prettier Working... spinner (#8799) 2026-09-03 20:34:04 +02:00
Vegard Stikbakke
e44d75c20a fix(coding-agent): raise branch summary output cap
closes #8845
2026-09-03 15:14:51 +02:00
Cristina Poncela Cubeiro
7d399e7be8
feat(tui): search improvements (#8800) 2026-09-03 15:09:51 +02:00
Vegard Stikbakke
007c0be640 docs(tui): clarify standalone renderer configuration
Follow-up to c505f4c19.
2026-09-03 12:03:59 +02:00
Alexey Zaytsev
1d6dbf9e3d
fix(coding-agent): keep skills available with bash-only tools (#8552) 2026-09-03 11:08:26 +02:00
Julien Barbay
2b768ba42c
feat(coding-agent): ingest external entries in in-memory sessions (#8980)
* 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.
2026-09-03 10:49:41 +02:00
David Brailovsky
8c08d0645a Merge remote-tracking branch 'origin/main' into dev 2026-09-03 07:58:51 +00:00
David Brailovsky
bea67d90d1 fix(coding-agent): cancel compaction on session abort
Include compaction and branch summarization in session idle tracking so abort waits for cancellation to settle.\n\nfixes #8920
2026-09-03 09:41:55 +02:00
Mario Zechner
4e69b0c280 feat(ai): preserve Anthropic per-turn thinking effort
Route eligible OpenRouter Claude models through the native Messages API and surface provider thinking-drop diagnostics.
2026-09-02 21:39:29 +02:00
Ramiz Wachtler
8d1b1178cd
docs(coding-agent): clarify session-scoped model/thinking-level changes (#9009)
- fixes #8976
2026-09-02 14:53:49 +02:00
David Brailovsky
487af8e168 Merge remote-tracking branch 'origin/main' into dev 2026-09-01 14:48:57 +00:00
Sviatoslav Abakumov
6492144773
fix(tui): detect Zed terminal capabilities (#8828) 2026-09-01 11:03:34 +02:00
David Brailovsky
58ea6c0ba5 Merge remote-tracking branch 'origin/main' into dev 2026-08-29 08:21:44 +00:00
David Brailovsky
56700d42ed
fix(coding-agent): compact before post-tool model requests (#8782)
Run next-turn preparation only when the agent loop continues, allowing threshold compaction before the next provider request. Restore interactive progress when the same run resumes.

Closes #6879

Important to notice:
this changes when prepareNextTurn & prepareNextTurnWithContext are invoked:
the now run only when a next turn actually happens, and after shouldStopAfterTurn.
2026-08-28 13:40:59 +02:00
Cristina Poncela Cubeiro
758a0ee9b7 Merge branch 'main' into dev
# Conflicts:
#	packages/agent/CHANGELOG.md
#	packages/ai/scripts/generate-models.ts
#	packages/ai/src/providers/cloudflare-ai-gateway.ts
#	packages/ai/test/zai-coding-plan-models.test.ts
#	packages/coding-agent/src/modes/interactive/interactive-mode.ts
#	packages/tui/src/tui-alt-screen.ts
2026-08-28 13:19:43 +02:00
Cristina Poncela Cubeiro
4e49492999
feat(tui): allow disable copy on fullscreen, ctrl + x copies selection (#8731) 2026-08-27 18:07:54 +02:00