Commit graph

1805 commits

Author SHA1 Message Date
Mario Zechner
cb3ac0ba9e refactor(coding-agent): simplify extension runtime architecture
- Replace per-extension closures with shared ExtensionRuntime
- Split context actions: ExtensionContextActions (required) + ExtensionCommandContextActions (optional)
- Rename LoadedExtension to Extension, remove setter methods
- Change runner.initialize() from options object to positional params
- Derive hasUI from uiContext presence (no separate param)
- Add warning when extensions override built-in tools
- RPC and print modes now provide full command context actions

BREAKING CHANGE: Extension system types and initialization API changed.
See CHANGELOG.md for migration details.
2026-01-07 23:50:18 +01:00
Mario Zechner
faa26ffbf9 Merge PR #536: align openai-codex models list and context window size to codex defaults
closes #536
2026-01-07 20:39:55 +01:00
Mario Zechner
39fa25eb67 fix(ai): clean up openai-codex models and token limits
- Remove model aliases (gpt-5, gpt-5-mini, gpt-5-nano, codex-mini-latest, gpt-5-codex, gpt-5.1-codex, gpt-5.1-chat-latest)
- Fix context window from 400k to 272k tokens to match Codex CLI defaults
- Keep maxTokens at 128k (original value)
- Simplify reasoning effort clamping

closes #536
2026-01-07 20:39:46 +01:00
Mario Zechner
8bf2b975a5 docs: add changelog citation format check to PR review prompt 2026-01-07 20:20:48 +01:00
Fero
7042a5f61d
docs: add changelog entry for settings preservation fix (#527) (#541) 2026-01-07 18:15:12 +01:00
Fero
cbd3a8cb87
fix: use defaultThinkingLevel from settings when enabledModels lacks explicit suffix (#540)
When enabledModels is configured without thinking level suffixes (e.g.,
'claude-opus-4-5' instead of 'claude-opus-4-5:high'), the scoped model's
default 'off' thinking level was overriding defaultThinkingLevel from
settings.

Now thinkingLevel in ScopedModel is optional (undefined means 'not
explicitly specified'). When passing to SDK, undefined values are filled
with defaultThinkingLevel from settings.
2026-01-07 18:11:03 +01:00
Mario Zechner
f3b7b0b179 fix(tui): handle batched input over SSH with StdinBuffer
Adds StdinBuffer class (adapted from OpenTUI, MIT license) to split
batched stdin into individual sequences before they reach components.

This fixes key presses being dropped when batched with release events,
which commonly occurs over SSH due to network buffering.

- Each handleInput() call now receives a single event
- matchesKey() and isKeyRelease() work correctly without batching awareness
- Properly buffers incomplete escape sequences across chunks
- Handles bracketed paste mode

Addresses #538
2026-01-07 17:50:06 +01:00
Armin Ronacher
615ed0ae2e
Fix compaction UX oddities when model switching (#535) 2026-01-07 16:50:18 +01:00
Mario Zechner
09471ebc7d feat(coding-agent): add ctx.ui.setEditorComponent() extension API
- Add setEditorComponent() to ctx.ui for custom editor components
- Add CustomEditor base class for extensions (handles app keybindings)
- Add keybindings parameter to ctx.ui.custom() factory (breaking change)
- Add modal-editor.ts example (vim-like modes)
- Add rainbow-editor.ts example (animated text highlighting)
- Update docs: extensions.md, tui.md Pattern 7
- Clean up terminal on TUI render errors
2026-01-07 16:11:49 +01:00
Zhou Rui
d893ba7f20
fix(ai): clean up openai-codex models and token limits 2026-01-07 23:09:20 +08:00
Mario Zechner
10e651f99b
Merge pull request #513 from austinm911/fix/async-extension-factories
feat(extensions): support async extension factory functions
2026-01-07 11:48:33 +01:00
Mario Zechner
9dfe5bf895
Merge pull request #527 from ferologics/fix/preserve-settings-on-save
fix: preserve externally-added settings when saving
2026-01-07 11:44:14 +01:00
ferologics
e0dbdc56d6 fix: preserve externally-added settings when saving
When a user edits settings.json while pi is running (e.g., adding
enabledModels), those settings would be lost when pi saved other
changes (e.g., changing thinking level via Shift+Tab).

The fix re-reads the file before saving and merges the current file
contents with in-memory changes, so external edits are preserved.

Adds test coverage for SettingsManager.
2026-01-07 11:31:14 +01:00
Mario Zechner
1f2dbb57f6
Merge pull request #522 from nicobailon/feat/dialog-timeout-countdown
feat(coding-agent): add timeout option to extension dialogs with live countdown
2026-01-07 10:04:21 +01:00
Nico Bailon
77477f6166 feat(coding-agent): add timeout option to extension dialogs with live countdown
Extension UI dialogs (select, confirm, input) now support a timeout option
that auto-dismisses with a live countdown display. Simpler alternative to
manually managing AbortSignal for timed dialogs.

Also adds ExtensionUIDialogOptions type export and updates RPC mode to
forward timeout to clients.
2026-01-06 21:49:27 -08:00
Mario Zechner
fcb3b4aa72 Add [Unreleased] section for next cycle 2026-01-07 01:33:34 +01:00
Mario Zechner
5514d4ffdb Release v0.37.8 2026-01-07 01:32:53 +01:00
Mario Zechner
41fe329cdd fix(tui): filter key release events by default
Components must set wantsKeyRelease=true to receive release events.
Fixes double-processing of keys in editors when Kitty protocol flag 2 is enabled.
2026-01-07 01:31:24 +01:00
Mario Zechner
7508a51599 Add [Unreleased] section for next cycle 2026-01-07 01:02:34 +01:00
Mario Zechner
a4f2bb5c27 Release v0.37.7 2026-01-07 01:01:55 +01:00
Mario Zechner
62919fc1d4 docs(tui): add changelog entry for matchesKey fix 2026-01-07 00:57:28 +01:00
Mario Zechner
7a44cf0db0 fix(tui): matchesKey now matches Kitty sequences for unmodified letter keys
Needed for key release events which come as CSI sequences even for plain letters.
2026-01-07 00:57:10 +01:00
Austin
c2eb8d0f92
Merge branch 'badlogic:main' into fix/async-extension-factories 2026-01-06 15:47:30 -08:00
Mario Zechner
9330f5a10a Add [Unreleased] section for next cycle 2026-01-07 00:43:25 +01:00
Mario Zechner
befbeb30e4 Release v0.37.6 2026-01-07 00:42:45 +01:00
Mario Zechner
a2f032a426 feat(tui): add Kitty keyboard protocol flag 2 support for key release events
- Enable flag 2 in Kitty protocol for event type reporting
- Add isKeyRelease() and isKeyRepeat() functions
- Parse event type suffix (:1/:2/:3) in Kitty sequences
- Export KeyEventType type
2026-01-07 00:41:44 +01:00
Mario Zechner
d863c8eb21 fix: add --force to npm install for cross-platform native bindings 2026-01-07 00:16:35 +01:00
Mario Zechner
f054150ea3 Add changelog entries for bridge prompt export (#510) 2026-01-07 00:11:21 +01:00
Mario Zechner
2015964c40
Merge pull request #512 from nicobailon/feat/abort-signal-ui-dialogs
Add AbortSignal support to extension UI dialogs
2026-01-07 00:10:20 +01:00
Nico Bailon
9771fa1e44 Add AbortSignal support to extension UI dialogs
Closes #474
2026-01-06 15:01:15 -08:00
Mario Zechner
03e3f0d801
Merge pull request #510 from mitsuhiko/annotate-bridge-prompt
Annotate bridge prompt
2026-01-06 23:47:02 +01:00
Austin Mudd
aea9f8439d feat(extensions): support async extension factory functions
Extensions can now use async initialization, enabling:
- Dynamic imports (e.g., loading tools from external packages)
- Async setup (config fetching, service connections)
- Lazy-loaded dependencies

Changes:
- ExtensionFactory type now returns void | Promise<void>
- loadExtensionFromFactory is now async, returns Promise<LoadedExtension>
- All factory(api) calls are now awaited

Backwards compatible: sync extensions continue to work unchanged.
2026-01-06 14:35:43 -08:00
Mario Zechner
282273e156 Fix preset.ts example to use gpt-5.2-codex for plan mode 2026-01-06 23:29:20 +01:00
Mario Zechner
a00322175f Add [Unreleased] section for next cycle 2026-01-06 23:25:53 +01:00
Mario Zechner
fe95983dcf Release v0.37.5 2026-01-06 23:25:12 +01:00
Mario Zechner
59d8b7948c Add ExtensionAPI methods, preset example, and TUI documentation improvements
- ExtensionAPI: setModel(), getThinkingLevel(), setThinkingLevel() methods
- New preset.ts example with plan/implement presets for model/thinking/tools switching
- Export all UI components from pi-coding-agent for extension use
- docs/tui.md: Common Patterns section with copy-paste code for SelectList, BorderedLoader, SettingsList, setStatus, setWidget, setFooter
- docs/tui.md: Key Rules section for extension UI development
- docs/extensions.md: Exhaustive example links for all ExtensionAPI methods and events
- System prompt now references docs/tui.md for TUI development

Fixes #509, relates to #347
2026-01-06 23:24:23 +01:00
Mario Zechner
c35a18b2b3 Export all UI components for extensions 2026-01-06 23:09:58 +01:00
Armin Ronacher
17d863c082 Show the bridge prompt as a standalone thing 2026-01-06 22:38:17 +01:00
Mario Zechner
7c99ea54bf Export truncation utilities for custom tools, add truncated-tool example
- Export truncateHead, truncateTail, truncateLine, formatSize, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES from package
- Add examples/extensions/truncated-tool.ts showing proper output truncation with custom rendering
- Document output truncation best practices in docs/extensions.md
2026-01-06 22:13:08 +01:00
Mario Zechner
f87fb0a38a Add [Unreleased] section for next cycle 2026-01-06 21:29:03 +01:00
Mario Zechner
b08a6b22ce Release v0.37.4 2026-01-06 21:28:24 +01:00
Mario Zechner
999f97cd49 fix(coding-agent): update help text for ctrl+k and add !! shortcut 2026-01-06 21:27:35 +01:00
Tudor Oancea
f755f69e0a added custom header support and example extension 2026-01-06 21:20:19 +01:00
Mario Zechner
512ae4b4c0 fix: OAuth token refresh failure returns undefined instead of throwing
When OAuth refresh fails during model discovery, getApiKey() now returns
undefined instead of throwing. This allows the app to start and fall back
to other providers, so the user can /login to re-authenticate.

fixes #498

feat(coding-agent): support searching/resuming sessions by ID

- Session picker (pi -r) now searches session IDs in addition to message content
- --session flag accepts UUID prefix (e.g., pi --session a8ec1c2a)
- Documented in README.md

fixes #495
2026-01-06 21:09:11 +01:00
Mario Zechner
d2f3b42deb fix: OAuth token refresh failure returns undefined instead of throwing
When OAuth refresh fails during model discovery, getApiKey() now returns
undefined instead of throwing. This allows the app to start and fall back
to other providers, so the user can /login to re-authenticate.

fixes #498
2026-01-06 20:57:42 +01:00
Mario Zechner
cd797cc407 docs(coding-agent): add changelog entry for #503 2026-01-06 20:06:40 +01:00
Mario Zechner
43d6912848
Merge pull request #505 from kim0/fix/google-thoughtsignature-thinking-classification
fix(ai): classify Google thoughtSignature as thinking
2026-01-06 20:02:25 +01:00
Mario Zechner
e3fccdab72
Merge pull request #503 from tmustier/fix/steering-input-preserve
fix(coding-agent): keep draft editor text when previously queued messages send
2026-01-06 19:51:53 +01:00
Ahmed Kamal
e42e9e6305 fix(ai): classify Google thoughtSignature as thinking
Google streaming may emit thoughtSignature without thought=true (including empty-text signature-only parts). Treat non-empty thoughtSignature as thinking to avoid leaking reasoning into normal text and retain signature across streaming deltas. Add unit test coverage.
2026-01-06 20:47:19 +02:00
Thomas Mustier
3964984f59 fix(coding-agent): keep editor text on queued steering 2026-01-06 17:02:35 +00:00