Commit Graph

249 Commits

Author SHA1 Message Date
Armin Ronacher 8c0ccd14b3 fix(ai,agent,coding-agent): normalize null message content at ingestion boundaries (#6343)
The Message types require content to always be present, but untyped JS
extension tools, hand-built histories, and old or hand-edited session
files can violate that contract, crashing rendering, compaction, and
provider request conversion with 'content is not iterable'.

Normalize null/missing content to an empty array at the ingestion
boundaries instead of guarding every consumer:

- transformMessages (choke point before every provider request)
- createToolResultMessage in the agent loop
- session entry loading (message and custom_message entries)
- extension custom messages (sendCustomMessage, before_agent_start)
- message_end extension replacements

fixes #6259, fixes #6276
2026-07-06 20:47:08 +02:00
Mario Zechner ba10b60b51 fix(coding-agent): add entry renderers for session entries 2026-07-01 11:30:26 +02:00
Mario Zechner fd6659dd5d fix(coding-agent): preserve run prompt during tool refresh
closes #6162
2026-06-30 14:08:48 +02:00
Mat e547bb9f41 fix(coding-agent): refresh session state before next turn 2026-06-30 13:56:04 +02:00
Alexey Zaytsev 726a9c526c fix(coding-agent): emit session name changes to extensions 2026-06-30 00:40:15 -05:00
Michael Yu 73581ea995 fix(coding-agent): avoid pre-prompt compaction continue 2026-06-25 21:43:03 +08:00
Armin Ronacher 371adcf371 fix(coding-agent): retry explicit provider retry errors
closes #6019
2026-06-24 18:14:06 +02:00
Mario Zechner cd95c2749f fix(ai): require OpenAI Responses terminal events 2026-06-23 16:35:45 +02:00
Mario Zechner abbd911693 Merge main into model-registry 2026-06-22 14:00:18 +02:00
Enrico 5b9b70d29c feat(coding-agent): add compaction reason and willRetry to extension compact events (#5962)
session_before_compact and session_compact now carry
reason ("manual" | "threshold" | "overflow") and willRetry, matching
what the RPC protocol already exposes via auto_compaction_start/end.
Extensions can now distinguish manual /compact from threshold
auto-compaction and overflow recovery through the public API instead
of monkeypatching AgentSession internals.
2026-06-22 10:36:16 +02:00
Armin Ronacher 2417adb46a fix(coding-agent): preserve startup extension UI
closes #5943
2026-06-21 23:19:34 +02:00
Armin Ronacher c60f6a8ab3 feat(coding-agent): expose post-compaction token estimates
closes #5877
2026-06-18 23:01:10 +02:00
Armin Ronacher 7d08c81a09 fix(coding-agent): avoid empty compaction summaries
closes #4811
2026-06-18 22:17:57 +02:00
Armin Ronacher 6b9f3f492f fix(coding-agent): avoid retrying successful overflow compaction
closes #5720
2026-06-18 19:30:14 +02:00
Armin Ronacher 7f29e7a369 feat: add provider-scoped environment overrides (#5807) 2026-06-16 17:19:08 +02:00
Armin Ronacher 6102dd2084 fix(coding-agent): handle missing export themes
closes #5596
2026-06-12 17:56:43 +02:00
Mario Zechner 8a0903ebf2 feat(ai): compat entrypoint, core-only root barrel (phase 5)
The root barrel is now core-only and side-effect free: types,
createModels/createProvider, auth substrate, lazyStream/lazyApi, faux,
utils. Generated catalogs, api-registry, env-api-keys, images, global
stream functions, and per-API lazy wrappers leave the root.

New @earendil-works/pi-ai/compat preserves the old surface verbatim as
a strict superset of the root: api-dispatch stream/complete with env
key injection, the builtin registration side effect (skip-if-present so
it cannot clobber earlier overrides), deprecated getModel/getModels/
getProviders aliases of the new getBuiltin* reads in providers/all,
lazy api wrappers + setBedrockProviderModule, and image generation.
Compat dies with the coding-agent ModelManager migration.

Packaging: exports map gains ./compat, ./providers/*, ./api/*;
sideEffects array lists only the effectful modules.

Old-global imports across agent/coding-agent/examples and pi-ai tests
switch to /compat (path-only; compat is a superset). The coding-agent
extension loader resolves the pi-ai ROOT specifier to compat, so
existing user extensions using the old global API keep working at
runtime until compat is removed. vitest configs alias /compat to src;
browser smoke imports old globals from /compat.
2026-06-10 21:17:12 +02:00
Mario Zechner 28c83e8385 fix(coding-agent): sync queue modes on reload
closes #5377
2026-06-09 13:21:59 +02:00
Mario Zechner db3f9953ee feat(coding-agent): expose project trust to extensions
closes #5523
2026-06-09 13:03:59 +02:00
Mario Zechner 6014801229 Add NVIDIA NIM provider 2026-06-02 15:09:36 +02:00
Alexey Zaytsev 8216cca5a7 Add system prompt options to extension commands 2026-06-01 15:42:56 -05:00
Mario Zechner e56521e323 Add extension mode context 2026-06-01 18:32:03 +02:00
Mario Zechner 9380d5f2e4 feat(coding-agent): add exclude tools option closes #5109 2026-05-28 23:49:18 +02:00
Mario Zechner 5b31ffd744 Abort session work during dispose 2026-05-28 11:35:19 +02:00
Mario Zechner edd26444af Expose tool prompt guidelines to extensions
closes #4879
2026-05-28 11:03:25 +02:00
Mario Zechner 8e77f8797b Merge pull request #5115 from DanielThomas/dannyt/sendUserMessage-agent-end
fix(coding-agent): drain follow-ups queued during agent_end
2026-05-28 10:47:31 +02:00
Danny Thomas a29a7902e9 fix(coding-agent): drain follow-ups queued during agent_end
When an extension queues a follow-up during `agent_end` it
gets stuck on the follow-up queue until after the next user
message.

Add a hasQueuedMessages() check to _handlePostAgentRun
so the existing while/continue loop drains them.

- One-line fix in _handlePostAgentRun
- Integration test in agent-session-queue
- git-merge-and-resolve example extension with tests
2026-05-28 18:27:39 +10:00
Mario Zechner cbe8625528 Fix input event streaming behavior semantics 2026-05-28 10:13:06 +02:00
Danny Thomas bcea4b2e27 feat(coding-agent): expose streamingBehavior on InputEvent
Add streamingBehavior to InputEvent so extensions can distinguish
idle prompts from mid-stream steers and queued follow-ups.

- Add streamingBehavior field to InputEvent type
- Thread it through ExtensionRunner.emitInput() and AgentSession.prompt()
- Add streaming-aware input gate example with tests
- Document in extensions.md
2026-05-28 15:52:38 +10:00
Armin Ronacher 8fb1e877cd fix(ai): disable hidden provider 429 retries (#4991) 2026-05-26 23:41:58 +02:00
Armin Ronacher 9600ded922 revert: fix rpc stdout backpressure
This reverts commit d0d1d8edca.
2026-05-24 11:50:53 +02:00
Armin Ronacher d0d1d8edca fix(rpc): respect stdout backpressure
closes #4897
2026-05-24 11:28:02 +02:00
Armin Ronacher c100620bf4 fix(coding-agent): Clean up Path Handling (#4873) 2026-05-22 11:25:15 +02:00
Armin Ronacher ae9450dc51 chore(ts): use source import extensions 2026-05-20 00:04:03 +02:00
Mario Zechner b944827623 fix(agent): stop tool preflight after extension abort
closes #4276
2026-05-19 13:10:03 +02:00
Mario Zechner c685b27369 fix(coding-agent): mark retrying agent end events 2026-05-19 10:33:16 +02:00
Mario Zechner 32bcdc9739 fix(coding-agent): simplify agent session settlement 2026-05-19 09:53:20 +02:00
Armin Ronacher 35f807cfaf fix(coding-agent): route compaction through streamFn
closes #4484
2026-05-17 01:57:03 +02:00
Mario Zechner 5ac874c849 fix(coding-agent): retry Anthropic message_stop stream endings
closes #4433
2026-05-12 23:25:15 +02:00
Mario Zechner 3e5ad67e0f chore: migrate pi packages to earendil works scope 2026-05-07 15:59:42 +02:00
Mario Zechner 23420012ab fix(coding-agent): decouple codex session cleanup 2026-05-04 00:45:56 +02:00
Armin Ronacher 5fa277b320 fix(coding-agent): close codex websocket sessions
Fixes #4103
2026-05-03 23:25:56 +02:00
Armin Ronacher 370fdae6fa fix(ai): fall back from codex websocket to sse (#4133) 2026-05-03 22:51:42 +02:00
Mario Zechner 80f06d3636 feat: add model thinking level metadata
closes #3208
2026-05-02 01:21:06 +02:00
Mario Zechner 95ae590279 fix(coding-agent): refresh thinking border from extensions
closes #3888
2026-04-30 22:50:00 +02:00
Mario Zechner 40c6eabb8f feat(coding-agent): allow message_end replacements
closes #3982
2026-04-30 21:24:36 +02:00
Mario Zechner c19e64a444 fix(coding-agent): refresh title after extension session rename
closes #3686
2026-04-25 17:20:26 +02:00
Mario Zechner a363b668ac fix(coding-agent): clear tree navigation compaction state
closes #3688
2026-04-25 17:03:09 +02:00
Mario Zechner bffb760f4f fix(coding-agent): improve auth setup warnings 2026-04-24 00:55:27 +02:00
Mario Zechner f0cf8a59d2 fix(coding-agent): handle stale extension contexts
fixes #3606
2026-04-23 22:07:13 +02:00