Commit graph

2571 commits

Author SHA1 Message Date
Mario Zechner
f3cfb7e1ae feat: add /files command to list session file operations 2026-01-29 02:25:59 +01:00
Mario Zechner
1b6a147579 feat(ai): add PI_CACHE_RETENTION env var for extended prompt caching
Adds support for extended cache retention via PI_CACHE_RETENTION=long:
- Anthropic: 5m -> 1h TTL
- OpenAI: in-memory -> 24h retention

Only applies to direct API calls (api.anthropic.com, api.openai.com).
Proxies and other providers are unaffected.

fixes #967
2026-01-29 02:22:06 +01:00
Mario Zechner
605f6f494b fix(ai): normalize pipe-separated tool call IDs for cross-provider handoff
- Handle pipe-separated IDs from OpenAI Responses API in openai-completions provider
- Strip trailing underscores after truncation in openai-responses-shared (OpenAI Codex rejects them)
- Add regression tests for tool call ID normalization

fixes #1022
2026-01-29 01:28:12 +01:00
Mario Zechner
4f004adefa fix(coding-agent): reset retry counter after each successful LLM response
Previously, within a single tool-use turn, rate limit retries would
accumulate across separate LLM calls. For example, if each of 3 tool
calls hit a 429 and retried once, the counter would show '3/3' and fail
even though each individual retry succeeded.

Now the counter resets immediately when a successful (non-error)
assistant message arrives, so each LLM call gets a fresh set of retries.

Fixes #1019
2026-01-29 01:12:29 +01:00
Mario Zechner
25707f9ad4 fix(ai): 429 rate limit errors no longer trigger auto-compaction
429 (Too Many Requests) was incorrectly classified as context overflow,
triggering compaction instead of retry with backoff. The original logic
assumed token-based rate limiting correlates with context overflow, but
these are different concepts:

- Rate limiting (429): requests/tokens per time period (throughput)
- Context overflow: single request exceeds context window (size)

Now 429 errors are handled by the existing retry logic with exponential
backoff, while 400/413 remain as potential context overflow indicators.

fixes #1038
2026-01-29 00:43:38 +01:00
Mario Zechner
a373dce747 fix(coding-agent): improve thinking defaults in footer 2026-01-29 00:33:45 +01:00
Mario Zechner
81be81328c feat(tui,coding-agent): add shell-style keybindings alt+b, alt+f, ctrl+d
- Add alt+b/alt+f as alternative bindings for cursorWordLeft/cursorWordRight
- Add ctrl+d as alternative binding for deleteCharForward
- Fix ctrl+d in custom editor to perform delete when text is present
  (previously it was always consumed, even with non-empty input)

Closes #1043

Co-authored-by: Jason Ish <ish@unx.ca>
2026-01-29 00:21:39 +01:00
Mario Zechner
5ef79459dc Closes #1041, incorrect .md file name in warning messages. 2026-01-29 00:16:50 +01:00
Mario Zechner
d21cbde87f fix(coding-agent): empty array in package filter now disables all resources
fixes #1044
2026-01-29 00:12:42 +01:00
Mario Zechner
8b5c81f21f fix(ai): preserve input token counts from message_start in Anthropic provider
Proxies like Portkey omit input_tokens in message_delta events (it's nullable
per the SDK). The previous code unconditionally overwrote usage fields, causing
input token counts to reset to 0.

Now only updates usage fields when they are present (not null), preserving
the correct input_tokens value captured from message_start.

Fixes #1045
2026-01-29 00:06:51 +01:00
Mario Zechner
4f9deddd47 fix(ai): detect DeepSeek URLs and disable unsupported developer role
fixes #1048
2026-01-28 23:55:54 +01:00
mom
ee7c0a7d18 fix(ai): handle sensitive stop_reason from Anthropic API (fixes #978) 2026-01-28 02:18:16 +00:00
williamtwomey
41d2c7ff38
OpenAI completions toolChoice fix (#998)
* openai completions tools fix

* Reset generated file

---------

Co-authored-by: williamtwomey <ai@shadylawn.net>
2026-01-28 03:03:15 +01:00
mom
dd854c4a75 feat(web-ui): export CustomProviderCard, ProviderKeyInput, AbortedMessage, ToolMessageDebugView (fixes #1015) 2026-01-28 02:02:14 +00:00
mom
7347d755e4 Revert "feat(web-ui): export CustomProviderCard, ProviderKeyInput, AbortedMessage, ToolMessageDebugView (fixes #1015)"
This reverts commit ec0aa5c30e.
2026-01-28 02:00:50 +00:00
mom
ec0aa5c30e feat(web-ui): export CustomProviderCard, ProviderKeyInput, AbortedMessage, ToolMessageDebugView (fixes #1015) 2026-01-28 02:00:07 +00:00
mom
ebd8e895ce fix: typos in comments (fixes #1016) 2026-01-28 01:56:34 +00:00
Thomas Mustier
e7b9209daf
fix(tui): improve table rendering with row dividers and min width (#997)
* fix(tui): improve table rendering

* fix(tui): handle narrow table widths
2026-01-28 02:42:08 +01:00
mom
fb693fbc90 perf(tui): scan only bottom terminal height lines in extractCursorPosition 2026-01-28 01:40:57 +00:00
mom
9d47747ff6 perf(tui): early-out extractCursorPosition when cursor is above visible viewport 2026-01-28 01:37:43 +00:00
Can Bölük
a8f33fd630
perf(tui): optimized extractCursorPosition to scan lines in reverse order (#1004)
- Optimized extractCursorPosition to scan lines in reverse order for improved performance.
2026-01-28 02:34:50 +01:00
Daniel Nouri
0ad189f12a
Add get_commands RPC for headless clients (#995)
* Add get_commands RPC for headless clients

Headless clients like Emacs can now query which commands are available.
Previously they could only discover file-based prompt templates by
scanning the filesystem; extension commands and skills were invisible.

The response includes each command's name, description, and source
(extension, template, or skill). Commands appear in the same order
as the TUI's autocomplete: extension commands first, then templates,
then skills.

Built-in TUI commands (/settings, /fork, etc.) are excluded since
they require the interactive UI. Commands like /compact have dedicated
RPC equivalents instead.

* Add location and path to get_commands response

Clients can show where commands come from (user/project/path) and
display file paths in tooltips. The data is already available on
templates and skills - just exposing it.
2026-01-28 02:34:15 +01:00
Sviatoslav Abakumov
c67b582fc4
fix(coding-agent): hide provider in footer when terminal is narrow (#981) 2026-01-28 02:15:27 +01:00
Sviatoslav Abakumov
1224b31135
feat(tui): auto-apply single suggestion in force file autocomplete (#993)
When Tab triggers file autocomplete and there's exactly one matching
suggestion, apply it immediately without showing the menu. This makes
path completion faster by eliminating the extra Tab press to confirm.
2026-01-28 02:12:18 +01:00
Mario Zechner
2cc2544809 Add [Unreleased] section for next cycle 2026-01-27 00:15:42 +01:00
Mario Zechner
29c59d79ba Release v0.50.1 2026-01-27 00:14:58 +01:00
Mario Zechner
bec72c428c docs(coding-agent): clarify dependency categories 2026-01-27 00:13:54 +01:00
Mario Zechner
484b605ca0 docs(coding-agent): clarify pi package dependency bundling 2026-01-27 00:10:58 +01:00
Mario Zechner
6159eb4be8 chore: update changelogs 2026-01-27 00:08:06 +01:00
Mario Zechner
ee7d03cf52 fix(coding-agent): prune empty git dirs on remove 2026-01-26 23:58:14 +01:00
Daniel Tatarkin
9f3eef65f8
fix(ai): filter deprecated OpenCode models from generation (#970)
Add status === 'deprecated' check for OpenCode Zen models, matching
the existing pattern used for GitHub Copilot models. This removes
deprecated models like glm-4.7-free and minimax-m2.1-free from the
generated model catalog.
2026-01-26 23:56:13 +01:00
Mario Zechner
a5f603d704 fix(diff): keep picker open after selection 2026-01-26 23:04:32 +01:00
Mario Zechner
5dbeadae05 fix(coding-agent): bind extension UI context on startup 2026-01-26 23:00:48 +01:00
Mario Zechner
f86e3c3103 fix(coding-agent): sync agent state after newSession setup callback
Move setup callback handling from interactive/rpc modes into AgentSession.newSession().
After setup() runs, sync agent state via replaceMessages() so the LLM has context
and the UI renders the messages properly.

fixes #968
2026-01-26 22:25:09 +01:00
Mario Zechner
0134a2a73d fix(coding-agent): handle force-pushed git extensions in pi update
Simplified to use @{upstream} instead of branch detection.
Moved changelog entry to [Unreleased].

Closes #961
2026-01-26 22:02:17 +01:00
Aliou Diallo
bfb21e31f8 fix(coding-agent): handle force-pushed git extensions in pi update 2026-01-26 22:01:08 +01:00
Mario Zechner
3c252d50f5 docs(coding-agent): add placement note for extension hot-reload 2026-01-26 21:55:57 +01:00
Sviatoslav Abakumov
3ae0cbe384
fix(coding-agent): Title Case extension hotkeys in /hotkeys output (#969) 2026-01-26 21:50:51 +01:00
Mario Zechner
2bbc1a7659 Add [Unreleased] section for next cycle 2026-01-26 16:55:24 +01:00
Mario Zechner
453e104d3a Release v0.50.0 2026-01-26 16:54:37 +01:00
Mario Zechner
1c7c5e10e0 add redraws helper extension for TUI development 2026-01-26 16:53:49 +01:00
Mario Zechner
d2de6d0830 docs(coding-agent): expand pi documentation references in system prompt
- Add instruction to read pi .md files completely and follow cross-references
- Add more doc references: prompt-templates, keybindings, sdk, custom-provider, models, packages
- Reorder entries (custom providers last, prompt templates after skills)
2026-01-26 16:52:32 +01:00
Mario Zechner
a6f9c3cf0d fix(tui): fix scrollback overwrite when appending lines past viewport
Appended lines were not committed to terminal scrollback because the
renderer used cursor movement (CSI B) and carriage return without
linefeed. This caused earlier content to be overwritten when the
viewport filled up.

Changes:
- For appended lines, emit \r\n to create real scrollback lines
- When target row is below viewport, scroll with \r\n before positioning
- Add PI_TUI_WRITE_LOG env var for debugging raw ANSI output
- Add fullRedraws readonly property to TUI class
- Add viewport-overwrite-repro.ts test script

fixes #954
2026-01-26 16:51:28 +01:00
Mario Zechner
fa8b26a184 docs: update changelog guidance and links 2026-01-26 15:45:51 +01:00
Mario Zechner
9b903656ae fix(ai): correct provider error message typo (closes #958) 2026-01-26 15:37:57 +01:00
Mario Zechner
585ce73be1 fix(coding-agent): align auto-discovery with loader rules 2026-01-26 13:49:21 +01:00
Mario Zechner
b270e7b585 fix(coding-agent): apply config overrides to auto-discovery 2026-01-26 13:37:08 +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
7a0b435923 docs(coding-agent): add security warnings for third-party packages
- README.md: Pi Packages section
- packages.md: Install and Manage section
- extensions.md: Extension Locations section
- skills.md: Locations section
2026-01-26 12:38:04 +01:00
Mario Zechner
a8d04a1dbf docs(coding-agent): add comprehensive cross-links in extensions.md
- context event → session.md (message types)
- setModel → models.md (custom models)
- session_before_tree → tree.md (tree navigation)
- Mode Behavior table → rpc.md, json.md (add JSON mode row)
- Fix table to distinguish RPC vs JSON modes
2026-01-26 11:54:56 +01:00