Commit graph

47 commits

Author SHA1 Message Date
Vegard Stikbakke
46bb9a2c3b docs(coding-agent): clarify Windows paths in settings
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-08-13 09:54:58 +02:00
Armin Ronacher
541045ae0e fix(coding-agent): preserve extension tools with defaults 2026-08-12 15:42:55 +02:00
Armin Ronacher
4d9aa837c2 feat(coding-agent): add configurable default tools 2026-08-12 15:27:01 +02:00
Armin Ronacher
ac4ac9eaf6 feat(coding-agent): configure fullscreen exit output 2026-08-07 18:30:28 +02:00
Armin Ronacher
5446cd7545 feat(coding-agent): rename UI mode to TUI mode 2026-08-05 22:56:58 +02:00
Alexey Zaytsev
66534fbdc7
feat(coding-agent): render Mermaid diagrams (#7624) 2026-08-05 09:43:24 +02:00
Armin Ronacher
b103937d3c
feat(coding-agent): switch UI modes at runtime (#7555) 2026-08-03 17:32:48 +02:00
Jeremy Gayed
b0e05b4423
fix(coding-agent): resize images returned by tools (#7330)
Images produced by tools (extensions, MCP bridges, screenshot tools) went into
session history at full resolution because processImage was only wired to the
read tool and @file CLI attachments. Providers validate every image in the
request, so one oversized image poisons the whole conversation: Anthropic drops
its per-image cap from 8000px to 2000px once a request carries many images, and
every later turn re-sends the same payload. Switching models does not help.

Normalize tool result images in AgentSession.afterToolCall, after the extension
tool_result hook so extension-injected images are covered too. Honors
images.autoResize, and keeps the original block when processing fails so an
unavailable image backend does not delete tool output.

Refs #5369

Assisted-By: devx/86bf3b09-9aba-4d03-8154-50fca3ffc9b5
2026-08-03 14:02:03 +02:00
Mario Zechner
b70c0f5b4e
Revert "feat(tui): add switchable terminal renderers (#7440)" (#7473)
This reverts commit 1fdf21621d.
2026-08-02 09:21:45 +02:00
Armin Ronacher
1fdf21621d
feat(tui): add switchable terminal renderers (#7440)
Allow coding-agent UI modes to switch at runtime while preserving terminal, focus, input, and renderer state.
2026-08-02 09:21:17 +02:00
Armin Ronacher
6129a353b1 feat(tui): add configurable fullscreen scrollbars 2026-07-31 17:17:02 +02:00
Vegard Stikbakke
f074efd921 feat(coding-agent): add ui mode setting 2026-07-31 15:33:52 +02:00
Petr Houška
7af8533c6f
fix(ai): make provider retries abortable (#6980)
Replace OpenAI and Anthropic SDK retries with local request retries that
preserve configured retry counts, enforce maxRetryDelayMs, and make retry
backoff interruptible through AbortSignal.

Alternatives considered: Racing SDK requests against AbortSignal would make
cancellation observable but would not let Pi enforce maxRetryDelayMs before
the SDK enters its retry sleep. Patching private SDK internals would be brittle,
while disabling provider retries entirely would ignore explicitly configured
maxRetries.

Also, align the custom OpenAI Codex retry loop with the documented
maxRetryDelayMs behavior. Oversized server-requested delays now fail immediately
instead of being clamped, allowing the visible, abortable agent-level retry
policy to handle the failure.

Fixes #6911
2026-07-23 12:25:37 +02:00
Aaron Ky-Riesenbach
1a2542b11b
feat(coding-agent): expand ~ in shellPath setting (#6470)
getShellPath() now runs the configured shellPath through the existing
normalizePath() helper, mirroring getSessionDir(). This lets shellPath
point at a home-directory-relative shell wrapper (e.g.
~/.local/bin/agent-shell-sandbox) and resolves consistently across
machines and OSes with different home directories.

refs #6458
2026-07-09 23:23:06 +02:00
Mario Zechner
fbdd46389c feat(ai): add max thinking level 2026-07-09 22:30:53 +02:00
Armin Ronacher
3f9aa5d10b
feat(coding-agent): add prompt cache miss tracking (#6427)
Some checks are pending
CI / build-check-test (push) Waiting to run
Detect prompt cache misses per turn by comparing each assistant message's
cache reads against the previous request's prompt tokens (core/cache-stats.ts).
Significant misses emit a warning-colored transcript notice at the turn they
occur, noting idle gaps past the cache TTL and model switches when relevant.

/session gained cache statistics: a compact token/cache breakdown with hit
rate, a $-prefixed cost section with per-model cost breakdown, and the
cumulative cost re-billed due to cache misses.
2026-07-09 14:12:57 +02:00
Mario Zechner
9be55bc773 fix(coding-agent): apply output padding to user messages
closes #6168
2026-06-30 11:55:40 +02:00
Alexey Zaytsev
6564d94717
feat(coding-agent): add configurable assistant output padding
Closes #6168
2026-06-30 11:44:34 +02:00
Armin Ronacher
5a073885b5 feat(coding-agent): add external editor setting
Some checks are pending
CI / build-check-test (push) Waiting to run
Closes #6122
2026-06-27 23:57:46 +02:00
Armin Ronacher
910508595a feat(coding-agent): add settings http proxy
closes #5790
2026-06-16 18:53:19 +02:00
Armin Ronacher
b4bff7f0d0
fix(coding-agent): avoid project trust prompt for update (#5674)
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-06-12 23:37:16 +02:00
Vegard Stikbakke
0ab2aa86af
feat(coding-agent): add experimental first-time setup flow (#5587)
Some checks are pending
CI / build-check-test (push) Waiting to run
Behind PI_EXPERIMENTAL=1, show a first-time setup dialog on interactive startup when the default agent directory is used and settings.json does not exist. The dialog preselects the detected terminal appearance with an explicit dark/light choice (live preview) and asks for opt-in analytics data sharing. Submitting writes settings.json, which serves as the completion marker; opting in stores a generated trackingId. Escape at any point skips out of setup.
2026-06-10 12:11:49 +02:00
Armin Ronacher
5cb4f597f7 feat(ui): Improved project approval settings 2026-06-09 13:25:54 +02:00
Mario Zechner
89a92207f1 feat(coding-agent): add project trust gating
Some checks failed
CI / build-check-test (push) Has been cancelled
2026-06-05 10:51:43 +02:00
Mario Zechner
c1633e609d Clarify hardware cursor docs
closes #5200
2026-05-30 01:20:14 +02:00
Armin Ronacher
493efd422d
fix(codex): timeouts for websockets (#4979) 2026-05-27 12:11:29 +02:00
Armin Ronacher
8fb1e877cd
fix(ai): disable hidden provider 429 retries (#4991) 2026-05-26 23:41:58 +02:00
Armin Ronacher
6f931797ca fix(coding-agent): install npm packages in managed root closes #4587 2026-05-17 20:48:00 +02:00
Mario Zechner
8191d59c17 feat(coding-agent): support session dir env
closes #4027
2026-04-30 21:37:53 +02:00
George Hilliard
0dd11898ad
fix(coding-agent): redo Bun package manager node_modules handling (#3998)
* Revert "fix(coding-agent): use alternate logic to find Bun's node_modules (#3861)"

This reverts commit c241c6d6d0.  The logic
is faulty: the original strategy of looking for node_modules by asking
the package manager is not incorrect even on bun. Instead, it should
learn a different method of asking the package manager for node_modules
when the *package manager* is bun, not the *runtime*.

* feat(coding-agent): detect bun as package manager and use alternate root query

When `"npmCommand": ["bun"]` is configured in settings.json, pi fails to
start because it invokes `bun root -g`, which doesn't exist:

    error: Failed to run bun root -g: error: Script not found "root"

Add a (simple) check for Bun being used as package manager, and instead
build the relative path starting from Bun's bin directory.
2026-04-30 12:27:50 +02:00
Armin Ronacher
904b843fee docs(coding-agent): clarify telemetry update checks 2026-04-30 11:04:20 +02:00
Mario Zechner
aefb0fedfe feat(coding-agent): add warnings.anthropicExtraUsage opt-out
closes #3808
2026-04-27 20:36:00 +02:00
Mario Zechner
c06750410a fix(ai,coding-agent): expose provider timeout/retry controls closes #3627 2026-04-24 13:33:00 +02:00
Mario Zechner
8700ac1f0e fix(coding-agent): support custom npmCommand for git deps
closes #3604
2026-04-23 22:32:32 +02:00
Mario Zechner
97a38bf652 fix(coding-agent): configure inline tool image width
closes #3508
2026-04-22 00:56:01 +02:00
Mario Zechner
60290b0d75 fix(coding-agent): expand ~ in sessionDir
closes #3514
2026-04-22 00:21:57 +02:00
Mario Zechner
7371c30c0a feat(coding-agent): add install telemetry ping controls 2026-04-14 00:21:13 +02:00
Mario Zechner
9f9277ccdd refactor(coding-agent): replace AgentSessionRuntimeHost with closure-based AgentSessionRuntime
- Replace AgentSessionRuntimeHost and bootstrap abstractions with AgentSessionRuntime
- Runtime creation is now closure-based via CreateAgentSessionRuntimeFactory
- Factory closes over process-global fixed inputs, recreates cwd-bound services per effective cwd
- Session config (model, thinking, tools, scoped models) re-resolved per target cwd
- CLI resource paths resolved once at startup as absolute paths
- Swap lifecycle: teardown old, create next, apply next (hard fail on creation error)
- Unified diagnostics model (info/warning/error) for args, services, session resolution, resources
- No logging or process exits inside creation/parsing logic
- Removed session_directory support
- Removed session_switch and session_fork extension events (use session_start with reason)
- Moved package/config CLI to package-manager-cli.ts
- Fixed theme init for --resume session picker
- Fixed flaky reftable footer test (content-based polling)
- Fixed silent drop of unknown single-dash CLI flags
- Added error diagnostics for missing explicit CLI resource paths
- Updated SDK docs, examples, plans, exports, tests, changelog

fixes #2753
2026-04-03 20:14:12 +02:00
Sam
2b1fc90cd7
feat(coding-agent): Add sessionDir support in settings.json (#2598)
Users can now set sessionDir in global or project settings.json instead
of passing --session-dir on every invocation. CLI flag takes precedence,
then settings.json, then extension hooks.

Closes #2429

Co-authored-by: Sam Collins <81678+smcllns@users.noreply.github.com>
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-03-26 00:03:36 +01:00
Mario Zechner
7ddaf150d6 fix(coding-agent): support configurable npm wrapper command closes #2072 2026-03-14 04:38:01 +01:00
lajarre
1f39cc776a
feat(coding-agent): add treeFilterMode setting for /tree default filter (#1852)
Add configurable initial filter mode for the session tree navigator.
Users who always switch to a specific filter (e.g. no-tools via Ctrl+T)
can now set it as default in settings.

Same pattern as doubleEscapeAction (#404). Filter infra from #747.
2026-03-05 22:25:58 +01:00
Cody Bontecou
f710c2705d
feat: add branchSummary.skipPrompt setting to skip summarization prompt (#1792)
When enabled, /tree navigation skips the 'Summarize branch?' prompt and
defaults to no summary, reducing friction for users who never want branch
summaries.

Closes #1791
2026-03-04 17:54:36 +01:00
Mario Zechner
a26a9cfabd feat: add configurable transport and codex websocket session caching 2026-02-13 23:41:49 +01:00
Mario Zechner
030a61d88c feat: add maxDelayMs setting to cap server-requested retry delays
When a provider (e.g., Google Gemini CLI) requests a retry delay longer
than maxDelayMs (default: 60s), the request fails immediately with an
informative error instead of waiting silently for hours.

The error is then handled by agent-level auto-retry, which shows the
delay to the user and allows aborting with Escape.

- Add maxRetryDelayMs to StreamOptions (packages/ai)
- Add maxRetryDelayMs to AgentOptions (packages/agent)
- Add retry.maxDelayMs to settings (packages/coding-agent)
- Update _isRetryableError to match 'retry delay' errors

fixes #1123
2026-02-01 00:50:41 +01:00
Colin Mason
b212314f45 feat: add autocompleteMaxVisible setting for configurable dropdown height 2026-01-29 03:16:52 +01:00
Mario Zechner
ea93e2f3da fix(coding-agent): add force exclude pattern and fix config toggle persistence
- Add `-path` force-exclude pattern (exact path match, highest precedence)
- Change `+path` force-include to exact path match (no glob)
- Manifest-excluded resources are now hidden from config (not toggleable)
- Config toggle uses `+` to enable and `-` to disable
- Settings paths resolve relative to settings.json location:
  - Global: relative to ~/.pi/agent
  - Project: relative to .pi
- Add baseDir to PathMetadata for proper relative path computation
- Update tests for new base directory and pattern behavior

fixes #951
2026-01-26 12:47:07 +01:00
Mario Zechner
5340862910 docs(coding-agent): update README-NEW.md, tui.md, add new docs
- README-NEW.md: add environment variables, philosophy extras (no built-in to-dos, no background bash), session ID support, pi config command, plain git URLs, version pinning
- tui.md: fix hooks->extensions terminology, update Component interface (invalidate required, add wantsKeyRelease)
- Add new docs: settings.md, development.md, json.md
- Add screenshots: tree-view.png, doom-extension.png
2026-01-26 02:27:19 +01:00