Commit Graph

423 Commits

Author SHA1 Message Date
Zeremonienmeister Berber Aab
f05f4e8a5f Add all OpenRouter provider routing fields to OpenRouterRouting (#2904)
The OpenRouterRouting interface only had only and order, but the runtime
passes the entire object as-is to the OpenRouter API's provider field.
This means all other fields worked at runtime but had no TypeScript
type-checking, no autocomplete, and no config validation.

This adds all fields from the OpenRouter provider selection API
(https://openrouter.ai/docs/guides/routing/provider-selection):
allow_fallbacks, require_parameters, data_collection, zdr,
enforce_distillable_text, ignore, quantizations, sort, max_price,
preferred_min_throughput, preferred_max_latency.

Also fixes the models.md documentation which had an invalid fallbacks
field in the example (not part of the OpenRouter API), replaces it with
a comprehensive example showing all available fields, and clarifies that
openRouterRouting is sent as-is in the provider field.
2026-04-09 03:08:45 +02:00
Aadish Verma
ee2483cd34 fix: update google provider to handle gemma 4 thinking levels and route between MINIMAL and HIGH (#2903)
resolves #2812

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-09 03:08:00 +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
Mario Zechner
d98b563165 docs: add switchSession to ExtensionCommandContext in extensions.md
fixes #2735
2026-04-01 23:51:22 +02:00
Mario Zechner
e2f29b0523 add(coding-agent): add defineTool helper closes #2746 2026-04-01 23:07:14 +02:00
Mario Zechner
d86122cbd3 refactor(coding-agent): add runtime host for session switching closes #2024 2026-03-31 13:49:57 +02:00
warren
0c64c1ce07 docs(coding-agent): clarify /tree active branch ordering (#2695) 2026-03-30 17:07:31 +02:00
warren
84d2b51a2e feat(coding-agent): add label timestamps to the session tree (#2691) 2026-03-30 15:56:37 +02:00
Mario Zechner
cbe1a8b732 fix(agent): simplify state API and update consumers fixes #2633 2026-03-30 12:43:34 +02:00
Mario Zechner
350d17d1f3 Merge branch 'main' of https://github.com/badlogic/pi-mono 2026-03-29 21:09:04 +02:00
Mario Zechner
ef6af5ebbd feat(ai,coding-agent): add faux provider and ModelRegistry factories 2026-03-29 21:08:50 +02:00
Mario Zechner
b5f425ad15 feat(agent,coding-agent): add prepareArguments hook for pre-validation argument preparation
Add AgentTool.prepareArguments and ToolDefinition.prepareArguments hook
that runs before schema validation in the agent loop. This lets tools
silently accept legacy argument shapes from resumed old sessions without
polluting the public schema.

The built-in edit tool uses this to fold legacy top-level oldText/newText
into edits[] when resuming sessions that predate the edits-only schema.

- AgentTool/ToolDefinition: typed prepareArguments returning Static<TParameters>
- agent-loop: prepareToolCallArguments() runs before validateToolArguments()
- edit tool: prepareEditArguments folds legacy fields, validateEditInput is strict
- Documented in extensions.md with edit-tool example
2026-03-29 21:06:22 +02:00
Mario Zechner
7e1dd8880c fix(coding-agent): restore extension input source semantics 2026-03-29 19:28:04 +02:00
warren
e6a302b935 docs(coding-agent): clarify repeated compaction boundary behavior (#2662) 2026-03-29 17:03:56 +02:00
Mario Zechner
7d4faa080d fix: expose abort signal to extensions closes #2660 2026-03-28 22:25:06 +01:00
Mario Zechner
7fe7081745 fix(coding-agent): document mutable tool_call input closes #2611 2026-03-27 04:01:20 +01:00
Mario Zechner
a0734bd162 fix(coding-agent): tighten skill discovery and edit diffs closes #2603 2026-03-27 03:48:28 +01:00
Mario Zechner
7a786d88aa fix(coding-agent): resolve models.json auth per request closes #1835 2026-03-27 00:47:40 +01:00
Mario Zechner
56e27fef1d chore: make pi-test.sh runnable from any directory 2026-03-26 15:43:42 +01:00
Mario Zechner
7e94d36a44 fix(coding-agent): add follow-up docs, changelog, and precedence tests closes #2429 2026-03-26 00:28:30 +01: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
835296b1d7 fix(coding-agent): expose rpc context usage closes #2550 2026-03-24 03:08:51 +01:00
Mario Zechner
a8a58ff26b fix(coding-agent): disambiguate duplicate slash commands, fixes #1061 2026-03-23 02:33:52 +01:00
Mario Zechner
4e5af01d73 fix(coding-agent): unify source provenance, closes #1734 2026-03-23 02:02:42 +01:00
Mario Zechner
235b247f1f fix(coding-agent): built-in tools work like extension tools
Export readToolDefinition / createReadToolDefinition and the equivalent built-in ToolDefinition APIs from @mariozechner/pi-coding-agent.
2026-03-22 04:20:38 +01:00
Mario Zechner
e3fee7a511 fix(keybindings): migrate to namespaced ids closes #2391 2026-03-20 01:55:30 +01:00
Mario Zechner
74a46fc7ea fix(coding-agent): queue file mutations across edit and write
closes #2327
2026-03-20 01:55:30 +01:00
xu0o0
31d59f8513 fix(ai): support prompt caching for Bedrock application inference profiles (#2346)
Add AWS_BEDROCK_FORCE_CACHE=1 environment variable support. When the
model ID doesn't contain a recognizable Claude model name, users can
set this variable to force cache point injection.
2026-03-18 11:21:10 +01:00
Mario Zechner
8a8e2a8049 docs(agent): update steering docs for deferred tool execution closes #2330 2026-03-18 03:49:30 +01:00
Mario Zechner
9651e4114d feat(coding-agent): expose local bash operations closes #2299 2026-03-18 00:41:57 +01:00
Mario Zechner
7eb55b08cf fix(coding-agent): reload keybindings on /reload closes #2309 2026-03-17 23:59:45 +01:00
Mario Zechner
7817e9b227 fix(coding-agent): make prompt snippets opt in closes #2285 2026-03-17 12:44:16 +01:00
BillionClaw
1ae0833a72 docs: document xfce4-terminal and terminator keyboard protocol limitations (#2166)
Co-authored-by: BillionClaw <267901332+BillionClaw@users.noreply.github.com>
2026-03-15 18:54:18 +01:00
Mario Zechner
0b48e2518f docs: clarify compat flags for openai-compatible local servers closes #2177 2026-03-15 16:11:40 +01:00
Mario Zechner
03ad7ecee7 fix(ai): add qwen-chat-template compat mode closes #2020 2026-03-14 05:20:27 +01:00
Mario Zechner
bdf2419ac3 fix(coding-agent): honor provider compat in models.json closes #2062 2026-03-14 04:55:03 +01:00
Mario Zechner
7ddaf150d6 fix(coding-agent): support configurable npm wrapper command closes #2072 2026-03-14 04:38:01 +01:00
Mario Zechner
63ac2df24d fix(coding-agent): sync tool hooks with agent event processing closes #2113 2026-03-14 03:10:04 +01:00
Fero
b621f3eefd docs(coding-agent): explain Windows Terminal Alt+Enter remap (#1967) 2026-03-09 13:31:42 +01:00
Mario Zechner
deb5fb3b88 feat(tui): support digit keybindings closes #1905 2026-03-08 00:36:04 +01:00
Mario Zechner
787f351ab7 feat(coding-agent): refine session_directory hook closes #1729 2026-03-08 00:19:35 +01:00
Mario Zechner
d48843ea55 Pr 1724 (#1939)
* feat(coding-agent): add fold/unfold to tree branch navigation

Remap left/right arrow keys in the session tree to jump between branch
segment starts (first child of each branching point). Left on a foldable
node (root or segment start) folds it, hiding its descendants. Right on
a folded node unfolds it. Nested fold state is preserved. Search and
filter changes reset all folds.

Folded branches show ⊞ in the connector (├⊞/└⊞) or as a prefix for
roots. Active path marker • appears after the fold indicator.

Add Page Up/Down support for paging through the tree list, consistent
with session selector and config selector.

* feat(coding-agent): improve tree branch folding closes #1724

---------

Co-authored-by: Sviatoslav Abakumov <dust.harvesting@gmail.com>
2026-03-08 00:15:47 +01:00
Mario Zechner
9a8bc61300 fix(tui,coding-agent): handle tmux xterm extended keys and warn on tmux setup fixes #1872 2026-03-07 23:01:48 +01:00
Mario Zechner
a3f05423d9 feat(coding-agent): add provider payload hook 2026-03-07 14:34:28 +01:00
Mario Zechner
e3adaf1bd9 fix(coding-agent): use strict JSONL framing fixes #1911 2026-03-07 14:34:27 +01:00
Mario Zechner
bcfd5169a2 docs(coding-agent): document tool result truncation in compaction serialization 2026-03-06 16:58:16 +01:00
Mario Zechner
bdf482cefc fix(tui): add modifyOtherKeys fallback for modified enter keys in tmux
When Kitty keyboard protocol is not available (e.g. inside tmux), fall
back to xterm modifyOtherKeys mode 2 so that Shift+Enter, Ctrl+Enter,
and other modified keys are distinguishable from plain Enter.

tmux users need to add to ~/.tmux.conf:
  set -g extended-keys on
  set -g extended-keys-format csi-u

closes #1872
2026-03-06 16:02:17 +01:00
Mario Zechner
b079003cf6 docs(coding-agent): clarify that tool errors must be thrown, not returned
Returning { isError: true } from a tool's execute function was silently
ignored - the agent loop only sets isError via the catch block. Fix the
with-deps example to throw instead, add a clear note in the Tool Definition
docs section, and update the Error Handling summary.

closes #1881
2026-03-06 14:36:27 +01:00
Mario Zechner
a31065166d Merge branch 'feat/use-mistral-sdk' 2026-03-05 23:49:29 +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