Commit Graph

1291 Commits

Author SHA1 Message Date
Mario Zechner
5d440b055c fix(coding-agent): fire session shutdown on TERM and HUP closes #3212 2026-04-15 16:37:19 +02:00
Mario Zechner
a8f51764c8 fix(coding-agent): add live retry countdown\n\ncloses #3187 2026-04-15 14:07:46 +02:00
Jack Rose
d22c120b82 handle lower case am/pm in macos screenshot names (#3194) 2026-04-15 12:00:46 +02:00
Mario Zechner
018b40c30c fix: align OpenAI cache affinity and use uuidv7 session ids 2026-04-14 23:20:13 +02:00
Aliou Diallo
ec4d413fc9 fix(coding-agent): custom models for built-in providers and list-models error surfacing (#3072)
* fix(coding-agent): surface models.json load errors on stderr in --list-models

When models.json has validation errors, --list-models silently
discarded custom models and overrides without any user-visible
feedback. Now prints the error to stderr via chalk.yellow warning
before listing available models.

* fix(coding-agent): allow custom models for built-in providers in models.json

Built-in providers (openrouter, anthropic, etc.) already have api and
baseUrl on every model, and auth comes from env vars / auth storage.
Relax validation so custom models under built-in providers don't need
redundant baseUrl, apiKey, or api fields. Inherit them from the first
built-in model for that provider.

fixes #2921

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-14 20:32:18 +02:00
Mat
dcb1f422c4 feat(coding-agent): accept inline extension factories in main() (#3099) 2026-04-14 20:26:07 +02:00
Aliou Diallo
2d3ed0cfa7 fix(coding-agent): use npm view for update checks on non-default registries (#3164)
Previously, getLatestNpmVersion() hardcoded a fetch to
registry.npmjs.org, which 404s for packages on alternate
registries (private, Verdaccio, GitHub Packages, etc.).
The error was silently swallowed, so users never saw update
notifications for these packages.

Replace the direct fetch with
via the existing runCommandCapture helper. This uses the same
registry resolution as npm install (reads .npmrc config chain),
respects the npmCommand setting, and runs with this.cwd for
correct .npmrc lookup.
2026-04-14 20:20:14 +02:00
Aliou Diallo
ac37d4d439 feat(coding-agent): support multiple --append-system-prompt flags (#3171) 2026-04-14 20:19:11 +02:00
Armin Ronacher
64a0a74d37 fix(coding-agent): stop bordered loader on dispose
fixes #3093
2026-04-14 16:48:54 +02:00
Mario Zechner
7371c30c0a feat(coding-agent): add install telemetry ping controls 2026-04-14 00:21:13 +02:00
Sviatoslav Abakumov
3166dae728 fix(coding-agent): flush queued messages after tree navigation (#3091)
Messages sent during branch summarization are added to the compaction
queue but never flushed when summarization ends. The user sees the
message in the steering queue and has to manually dequeue and resend it.

The fix is to flush the compaction queue after successful tree
navigation, matching the existing behavior of auto-compaction and
`/compact`. If the user jumps to a user message, the queued message is
sent as a prompt, and the jumped-to text is placed in the editor.
2026-04-13 11:03:01 +02:00
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
Mario Zechner
61015830ed feat(coding-agent): set PI_CODING_AGENT=true env var at startup
closes #2868
2026-04-09 03:03:19 +02:00
Mario Zechner
cca5a3a1a4 fix(coding-agent): hide Earendil startup notice 2026-04-09 00:53:19 +02:00
Mario Zechner
96916f2cad fix(coding-agent): warn on Anthropic subscription auth 2026-04-08 18:46:40 +02:00
Mario Zechner
6d2d03dcc9 fix(coding-agent): add earendil startup announcement 2026-04-08 11:13:40 +02:00
Mario Zechner
f10cce9435 fix(coding-agent): retry ended-without stream errors closes #2892 2026-04-08 02:06:59 +02:00
Mario Zechner
377eca9684 fix(ai,coding-agent): use node:readline import prefix for Deno compatibility
closes #2885
2026-04-08 01:59:34 +02:00
Mario Zechner
52d16d5a31 fix(coding-agent): persist bash output on line truncation closes #2852 2026-04-05 23:28:49 +02:00
Mario Zechner
080af6fc06 fix(coding-agent): handle missing session cwd 2026-04-05 21:24:32 +02:00
Aliou Diallo
127547f2b3 fix(coding-agent): preserve json mode for piped stdin (#2848) 2026-04-05 21:02:18 +02:00
Aliou Diallo
71e4436932 fix(coding-agent): handle git/npm extension paths in CLI resolution (#2845) 2026-04-05 18:42:14 +02:00
Mario Zechner
a7acef92a7 fix(coding-agent): resource collision precedence, user/project skills override package skills
Sort resolved resources by precedence rank (project settings > project auto >
user settings > user auto > package) so first-wins collision logic produces
correct results. Also reorder CLI paths to prepend instead of append.

fixes #2781
2026-04-04 21:28:38 +02:00
Mario Zechner
5e5eeb9603 fix(coding-agent): handle async fs.watch error events in theme watcher
closes #2791
2026-04-04 20:51:34 +02:00
Mario Zechner
72a43dc063 fix(coding-agent): forward RpcClient subprocess stderr to parent in real-time
fixes #2805
2026-04-04 12:41:09 +02:00
Mario Zechner
f2f79dab9a chore(coding-agent): remove dead main-package-command.ts (replaced by package-manager-cli.ts) 2026-04-03 20:15:40 +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
617f1870f8 fix(coding-agent): reuse initial resource loader on startup closes #2766 2026-04-02 11:06:08 +02:00
Mario Zechner
e2f29b0523 add(coding-agent): add defineTool helper closes #2746 2026-04-01 23:07:14 +02:00
Mario Zechner
a1e107897d fix(tui): await async slash command completions closes #2719 2026-03-31 14:41:50 +02:00
Mario Zechner
5ce0d15b66 fix(coding-agent): resolve theme export variables closes #2707 2026-03-31 14:41:50 +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
84d2b51a2e feat(coding-agent): add label timestamps to the session tree (#2691) 2026-03-30 15:56:37 +02:00
Mario Zechner
21863d4ec7 fix(coding-agent): wait for retried runs to settle 2026-03-30 15:51:59 +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
de022ceba7 feat(coding-agent): add hidden thinking label api closes #2673 2026-03-29 21:33:15 +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
Duncan Ogilvie
1ee0d28d7b fix(coding-agent): properly queue extension messages (#2674) 2026-03-29 19:23:40 +02:00
Mario Zechner
0f9db44aff fix(coding-agent): avoid full redraw on large edit results closes #2664 2026-03-29 13:00:46 +02:00
Mario Zechner
7d4faa080d fix: expose abort signal to extensions closes #2660 2026-03-28 22:25:06 +01:00
Mario Zechner
e773527b3a fix(coding-agent): simplify edit tool input closes #2639 2026-03-28 22:10:34 +01:00
Mario Zechner
46f5b798f9 chore(coding-agent): remove unused compaction import 2026-03-27 04:11:43 +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
f456a7a4db fix(coding-agent): restore compaction summary and dedupe edit errors 2026-03-27 04:00:21 +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
eeace79715 fix(coding-agent): preserve kept messages across repeated compaction closes #2608 2026-03-27 03:36:57 +01:00
Mario Zechner
161ad18287 fix(coding-agent): unify compaction UI events closes #2617 2026-03-27 03:14:24 +01:00