Commit graph

4879 commits

Author SHA1 Message Date
Armin Ronacher
3f9aa5d10b
feat(coding-agent): add prompt cache miss tracking (#6427)
Some checks are pending
CI / build-check-test (push) Waiting to run
Detect prompt cache misses per turn by comparing each assistant message's
cache reads against the previous request's prompt tokens (core/cache-stats.ts).
Significant misses emit a warning-colored transcript notice at the turn they
occur, noting idle gaps past the cache TTL and model switches when relevant.

/session gained cache statistics: a compact token/cache breakdown with hit
rate, a $-prefixed cost section with per-model cost breakdown, and the
cumulative cost re-billed due to cache misses.
2026-07-09 14:12:57 +02:00
David Brailovsky
57d96d72ed
add ResourceExhausted as a retryable error (#6449)
fixes #6364
2026-07-09 13:58:32 +02:00
Mario Zechner
a6f720e6ca fix(coding-agent): count custom messages in compaction budget
closes #6326
2026-07-09 12:46:03 +02:00
Mario Zechner
e9fa5a68a1 fix(coding-agent): add settled agent lifecycle event
closes #6363
2026-07-09 12:42:08 +02:00
github-actions[bot]
050b8176bf chore: approve contributor HarrodRen 2026-07-09 09:56:19 +00:00
Mario Zechner
1ffca0f2aa fix(coding-agent): align reload descriptions
closes #6395
2026-07-09 11:47:44 +02:00
Mario Zechner
c4281a7dd1 fix(coding-agent): warn when session-id creates a session
closes #6407
2026-07-09 11:37:07 +02:00
Mario Zechner
2170363af4 fix(coding-agent): avoid Windows context file walk hang
closes #6369
2026-07-09 11:30:59 +02:00
Mario Zechner
c6251a866b fix(coding-agent): apply modelOverrides to extension providers
closes #6367
2026-07-09 11:22:35 +02:00
Mario Zechner
4285712bae fix(ai): retry Bun socket drops
Some checks are pending
CI / build-check-test (push) Waiting to run
closes #6431
2026-07-09 11:03:58 +02:00
Mario Zechner
72d77b53de fix(ai): update model catalogues 2026-07-09 11:03:58 +02:00
github-actions[bot]
5cb50679e9 chore: approve contributor DeviosLang 2026-07-09 09:02:48 +00:00
Mario Zechner
9eedaf8cf3 fix(ai): update GitHub Copilot extended context windows to 1M
Updates GitHub Copilot built-in model metadata so models with GitHub's extended 1M capability use contextWindow 1000000 in Pi, preventing early compaction and under-budgeting for Claude Opus 4.7/4.8 and GPT-5.3 Codex/5.4/5.5.

Verified against raw docs markdown extended-capabilities table and live /models reports.

closes #6439
2026-07-09 10:39:27 +02:00
Mario Zechner
cb222bf99d feat(agent): export InMemorySessionStorage and JsonlSessionStorage
Export both session storage implementations from @earendil-works/pi-agent-core
so they can be imported and extended directly instead of via repo workaround.

closes #6435
2026-07-09 10:22:30 +02:00
David Brailovsky
86afffe01f
fix fork menu allowing user to double select an entry (#6430)
Some checks are pending
CI / build-check-test (push) Waiting to run
in cases where forking a session was not immediate due to extensions
slowing down teardown, it's possible for the user to select the
message to fork more than once and then create multiple session forks.

in this fix we close the forking menu before starting the fork process
to not allow such behavior.

fixes #6321
2026-07-08 18:23:22 +02:00
Mario Zechner
dd1c690f36 fix(agent): add session context entry projection 2026-07-08 14:59:16 +02:00
Armin Ronacher
312bc713bb feat(coding-agent): support provider arguments for login 2026-07-08 12:06:26 +02:00
David Brailovsky
62f45badae
Fix native clipboard in bun release (#6418)
* copy native clipboard .node files to the clipboard package

under the bun binary packaging, require("@mariozechner/clipboard-linux-x64-gnu")
doesn't work so instead we rely on require("./clipboard.linux-x64-gnu.node")
for that we need to copy the .node files to the clipboard package dir

* fallback to xclip if native clipboard fails on x11
2026-07-08 11:20:24 +02:00
ArcadiaLin
7198e78f99
feat(agent): support custom metadata in jsonl session headers (#6417)
Allow callers to attach an opaque JSON object to the session header so
application context needed to rebuild a harness (for example an agent
profile reference) is readable from the first line alone, without
scanning session entries. The field is optional and ignored by readers
that do not use it; fork inherits the source metadata unless overridden.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-08 11:18:43 +02:00
Vegard Stikbakke
cc2db98002 fix(ai): refresh Xiaomi token plan model catalogs
Some checks are pending
CI / build-check-test (push) Waiting to run
Use the new provider-specific Xiaomi Token Plan catalogs from models.dev instead of cloning the API-billing Xiaomi catalog into every token-plan region. This removes API-billing-only models such as mimo-v2-omni from xiaomi-token-plan-{cn,ams,sgp}.
2026-07-08 10:17:48 +02:00
github-actions[bot]
4ea062f9f3 chore: approve contributor anilgulecha 2026-07-08 07:11:20 +00:00
github-actions[bot]
d1da583610 chore: approve contributor ArcadiaLin 2026-07-08 07:02:44 +00:00
Armin Ronacher
351efc828b
fix(agent): fail tool calls from length-truncated assistant messages (#6285)
Some checks are pending
CI / build-check-test (push) Waiting to run
* fix(ai,agent): stop salvaging malformed tool-call argument JSON

Finalized tool-call arguments must strict-parse (allowing only lossless
string-escape repair). When the streamed JSON is truncated or malformed,
the raw JSON is preserved on ToolCall.malformedArguments, arguments
become {}, and the agent loop refuses to execute the call with an error
tool result instead of running it with silently salvaged partial
arguments. Partial parsing is now only used for streaming previews.

* fix(agent): fail tool calls from length-truncated assistant messages

Reverts the malformed-arguments tracking approach in favor of handling
truncation in the agent loop: when an assistant message stops with
"length", all tool calls in it are potentially borked (streamed
arguments are salvage-parsed), so none are executed. Each gets an error
tool result telling the model to re-issue the call, and the loop
continues. No new fields on ToolCall and no provider changes.

fixes #6284
2026-07-07 14:30:31 +02:00
Affan Ali
8a2ce5a540
fix(tui): decrement paste counter on paste marker delete and terminal clear (#6397)
* fix(tui): decrement paste counter on paste marker delete

* fix(tui): fix case of markers after the removed one and ctrl+c

* fix(tui): formatting
2026-07-07 14:29:39 +02:00
Vegard Stikbakke
2b00dade7c Revert "fix(coding-agent): abort stuck context hooks"
Some checks are pending
CI / build-check-test (push) Waiting to run
This reverts commit 6757561546.
2026-07-07 07:14:27 +02:00
Mat
244f1deaf1
feat(coding-agent): add before_provider_headers extension hook (#6350)
Some checks are pending
CI / build-check-test (push) Waiting to run
* feat(coding-agent): add before_provider_headers extension hook

Extensions can already rewrite the request payload through before_provider_request, but there is no way to adjust the outgoing HTTP
headers of a provider call. This hook fills that gap for cases like request tracing, session correlation, or tenant routing.

Handlers mutate the headers map in place - a null value deletes a header - and the return value is ignored, so a handler cannot accidentally drop auth or attribution headers by
forgetting to spread.

* docs(coding-agent): document before_provider_headers extension hook

Add the before_provider_headers section and lifecycle-diagram entry to
extensions.md; drop the now-superseded proposal file.
2026-07-06 22:35:56 +02:00
github-actions[bot]
cfaa52e1c2 chore: approve contributor affanali2k3 2026-07-06 20:18:36 +00:00
Samwise Wang
279f53b098
fix(ai): use "(no tool output)" placeholder for empty tool results without images (#6290)
OpenAI Completions and Responses providers unconditionally replaced empty
tool result text with "(see attached image)", even when the result had no
image content. This caused the model to hallucinate image attachments for
commands that produce no output (e.g. curl -s with SSL errors, grep with
no matches, true/false).

Now matches the Google provider behavior: "(see attached image)" is only
used when images are actually present; empty results get "(no tool output)".

Co-authored-by: tzwm <tzwm@users.noreply.github.com>
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-06 21:42:56 +02:00
Armin Ronacher
4087346dfd fix(coding-agent): persist issue analysis auth refresh 2026-07-06 21:11:59 +02:00
Victor Araújo
b3dff19a04
feat(coding-agent): add InlineExtension type for named inline extension factories (#6267)
* feat(coding-agent): add InlineExtension type for named inline extension factories

* test(coding-agent): update utilities and add regression test for InlineExtension
2026-07-06 20:59:37 +02:00
Armin Ronacher
c8ada4e76e
Improve project-local pi config (#6309)
* feat(coding-agent): improve config resource overrides

* fix(coding-agent): simplify config resource overrides
2026-07-06 20:50:30 +02:00
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
Vegard Stikbakke
6efc09b7eb fix(coding-agent): clear label timestamp cache on new sessions
Some checks are pending
CI / build-check-test (push) Waiting to run
closes #6354
2026-07-06 15:31:32 +02:00
Armin Ronacher
647c5554b7 feat(coding-agent): add runner tags for issue analysis
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-07-06 08:17:57 +02:00
Armin Ronacher
2e4ad6a094 fix(ai): clamp OpenAI Responses max output token floor
closes #6265
2026-07-06 02:21:15 +02:00
Armin Ronacher
fda6451a2f fix(coding-agent): use high reasoning for issue analysis 2026-07-06 01:51:21 +02:00
Armin Ronacher
7a92545b9c feat(coding-agent): include analysis summary in issue comment
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-07-06 01:33:38 +02:00
Armin Ronacher
190b6459f3 fix(coding-agent): use issuron issue analysis trigger 2026-07-06 01:21:39 +02:00
Armin Ronacher
4728706e3b feat(coding-agent): trigger issue analysis from comments 2026-07-06 01:19:15 +02:00
Armin Ronacher
010e519c90 fix(coding-agent): use gist token for issue analysis share 2026-07-06 01:06:41 +02:00
Armin Ronacher
3df11fd886 fix(coding-agent): share issue analysis sessions as gists 2026-07-06 00:58:45 +02:00
Armin Ronacher
d1e72d0585 fix(coding-agent): use PAT directly for issue analysis auth 2026-07-06 00:40:28 +02:00
Armin Ronacher
abe9c9d9f1 feat(coding-agent): add CI issue analysis import flow 2026-07-06 00:38:17 +02:00
Armin Ronacher
1dac099022 fix(agent): derive short session entry ids from the uuidv7 random tail (closes #6242)
The uuidv7 prefix is timestamp-derived and nearly constant between calls, so slicing the first 8 chars degenerated short ids to full-UUID fallbacks. Regression from 80c918c2 which replaced randomUUID with uuidv7.
2026-07-05 23:35:53 +02:00
Armin Ronacher
478301342b test: use quiet dot reporters and show output only for failing tests
Switch vitest packages (ai, agent, coding-agent) to the dot reporter
with silent: passed-only so passing tests stay quiet while failing
tests still print their console output and full diffs. Add the
github-actions reporter on CI for inline annotations. Switch the tui
node:test runner to the dot reporter as well.
2026-07-05 23:17:17 +02:00
Armin Ronacher
75ac0cb0e6 fix(coding-agent): stabilize auto-compaction threshold test 2026-07-05 23:14:10 +02:00
Armin Ronacher
604ac652d0 fix: CI 2026-07-05 22:45:18 +02:00
Armin Ronacher
035ea9c856 fix: remove redundant record guards 2026-07-05 18:55:09 +02:00
Vegard Stikbakke
ee24a9ec54 feat(ai): refresh generated model catalogs
Some checks failed
CI / build-check-test (push) Has been cancelled
closes #6256
2026-07-04 06:27:58 +02:00
Armin Ronacher
a1b336d73e fix(coding-agent): allow extra edit replacement fields 2026-07-04 01:52:17 +02:00