Commit graph

132 commits

Author SHA1 Message Date
Cristina Poncela Cubeiro
2ff8ba6223
fix(coding-agent): keep model and thinking level changes session scoped (#8356)
* fix(coding-agent): keep model and thinking level changes session scoped

* fix(coding-agent): persist requested default thinking level

* feat: --default arg to persist

* fix

* fix(coding-agent): keep model and thinking level changes session scoped

* fix: make default thinking level per model show list of models

* cleanup export
2026-08-19 16:48:29 +02:00
Armin Ronacher
1355cd36e0 fix(coding-agent): normalize UTF-8 BOMs in text inputs
Some checks are pending
CI / build-check-test (push) Waiting to run
closes #8337
2026-08-19 14:11:02 +02:00
Vegard Stikbakke
4495469a5e fix(coding-agent): compact without provider usage
closes #8328
2026-08-19 13:44:22 +02:00
Vegard Stikbakke
678f0af30d fix(coding-agent): show startup diagnostics in TUI
fixes #7829
2026-08-19 13:07:57 +02:00
Christian Klotz
830a0a59e9
fix(coding-agent): expose tool metadata at stream start (#7953)
* fix(coding-agent): expose tool metadata at stream start

* fix(coding-agent): centralize message update serialization
2026-08-19 12:24:30 +02:00
Mario Zechner
c061328981 fix(coding-agent): load extensions in Node SEA hosts, closes #8237 2026-08-18 16:48:18 +02:00
Vegard Stikbakke
ef8dc7385b feat(coding-agent): centralize compaction summary requests 2026-08-18 14:19:01 +02:00
Vegard Stikbakke
8af7690c4f fix(coding-agent): skip trusted subagent prompts
closes #8261
2026-08-18 09:26:07 +02:00
Armin Ronacher
b82a374c7d fix(coding-agent): reduce redundant slow tests 2026-08-17 22:57:18 +02:00
Cristina Poncela Cubeiro
a6b1dbceb1
fix(extensions): emit compaction failed for extensions (#8241)
* fix(extensions): emit compaction failed

* changelog yeet
2026-08-17 13:10:08 +02:00
Vegard Stikbakke
c7c763f5c4 fix(coding-agent): clarify truncated recovery failure
closes #8130
2026-08-17 11:03:07 +02:00
Armin Ronacher
7d8c11d37f fix(coding-agent): share concurrent model catalog refreshes 2026-08-13 09:43:36 +02:00
Christian Klotz
c93ea6ccf0
fix(coding-agent): preserve usage in streaming events (#7982)
Fixes #7911
2026-08-13 00:32:26 +03:00
Duncan Ogilvie
b987ead358
feat(agent): expose expandPromptTemplates in sendUserMessage (#7857) 2026-08-11 11:14:28 +02:00
Armin Ronacher
666d8972ff fix(coding-agent): preserve TUI wrapper routing (closes #7731)
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-08-07 00:40:44 +02:00
muyiyr
1eb988cfe8
feat(agent): allow blocked tool calls to terminate (#7715)
Closes #5998
2026-08-06 17:14:48 +02:00
Ted
6ca423447f
event bus leak fix (#7656) 2026-08-05 22:23:44 +02:00
Armin Ronacher
3852cb2b81 fix(coding-agent): send prompts queued during compaction 2026-08-05 21:20:44 +02:00
Vegard Stikbakke
97f0ccdd96 fix(coding-agent): recursively merge nested settings, closes #7572 2026-08-04 13:04:02 +02:00
Vegard Stikbakke
18d65de623 fix(coding-agent): preserve Copilot summary endpoint
closes #6768
2026-08-04 11:00:30 +02:00
Petr Houška
523b5a4917
fix(coding-agent): normalize find root results (#7569)
Relativize absolute find results with path.relative() instead of slicing
at searchPath.length + 1. path.resolve() keeps the trailing separator for
root paths (POSIX / and Windows bare drive roots like I:\), so the slice
dropped the first character of the first path segment. Preserve directory
markers using platform-aware separators so Windows paths do not gain "//"
and valid POSIX backslashes remain unchanged.

This also avoids treating sibling paths with a shared prefix as children.
Relative results returned by custom glob operations now pass through
unchanged instead of being resolved against process.cwd(), which produced
invalid paths whenever cwd differed from the search path.

Fixes #6104
2026-08-04 00:05:48 +02:00
Mario Zechner
fed6009cc9 fix(coding-agent): make model refresh cancellation caller-owned
Add generation-safe catalog publication, cancellable auth and storage operations, locally consistent credential mutations, and cache-first interactive model flows.
2026-08-04 00:03:52 +02:00
muyiyr
da66636cc4
fix(coding-agent): discover sessions through symlinked directories (#7552)
fixes #7497
2026-08-03 18:34:12 +02:00
Christian Klotz
a4475344fb
fix(coding-agent): make JSON streaming output linear (#7394)
Fixes #7290

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-08-03 18:33:22 +02:00
David Brailovsky
32850ef7c5
fix(coding-agent): resume after context-limited length stops (#7540)
* fix(coding-agent): resume after context-limited length stops

Treat length stops as context overflow when prompt usage is within 1% of
Pi's configured context window. Include cache-write tokens in that usage
and allow non-zero output because OpenAI may emit reasoning tokens before
returning an incomplete response.

After compaction, remove any retryable error or truncated-length assistant
message restored from persisted session history so the interrupted agent
turn can continue.

This is specifically for handling this case for openai models:
https://developers.openai.com/api/docs/guides/reasoning

> If the generated tokens reach the context window limit or the max_output_tokens value you’ve set, you’ll receive a response with a status of incomplete and incomplete_details with reason set to max_output_tokens. This might occur before any visible output tokens are produced, meaning you could incur costs for input and reasoning tokens without receiving a visible response.

This detection currently assumes the reported prompt usage is within 1% of
the context window configured in Pi. Its reliability therefore depends on
Pi's model contextWindow metadata matching the provider's effective limit.

Maybe we should consider treating OpenAI incomplete responses as requiring compaction
regardless of the local context-window estimate?

fixes #7020

* fix(coding-agent): recover truncated responses after compaction

Classify length stops by comparing provider-reported output usage with the model's intended output limit. Compact and retry once when generation ends below that limit, avoiding unreliable context-window estimates while preserving genuine max-output stops.

Normalize OpenAI Responses incomplete reasons so only max_output_tokens is treated as a length stop. Preserve qualified provider reasons for diagnostics, surface other reasons as errors, and use neutral truncation wording in the TUI.
2026-08-03 18:07:53 +02:00
David Brailovsky
e56893f4cd
fix(coding-agent): prevent auto-compaction race during manual compaction (#7370)
* fix(coding-agent): preserve agent events during compaction

Manual compaction already waits for the active agent run to settle, and summary generation does not emit Agent events. Keep the agent subscription connected so unexpected concurrent events are not dropped, and remove the obsolete reconnect helper.

closes #7253
2026-08-03 18:00:21 +02:00
Jeremy Gayed
b0e05b4423
fix(coding-agent): resize images returned by tools (#7330)
Images produced by tools (extensions, MCP bridges, screenshot tools) went into
session history at full resolution because processImage was only wired to the
read tool and @file CLI attachments. Providers validate every image in the
request, so one oversized image poisons the whole conversation: Anthropic drops
its per-image cap from 8000px to 2000px once a request carries many images, and
every later turn re-sends the same payload. Switching models does not help.

Normalize tool result images in AgentSession.afterToolCall, after the extension
tool_result hook so extension-injected images are covered too. Honors
images.autoResize, and keeps the original block when processing fails so an
unavailable image backend does not delete tool output.

Refs #5369

Assisted-By: devx/86bf3b09-9aba-4d03-8154-50fca3ffc9b5
2026-08-03 14:02:03 +02:00
David Brailovsky
d93e7e88fa
Merge pull request #7383 from earendil-works/fix-issue-7150
fix(coding-agent): reject prompts during manual compaction
2026-08-03 13:53:27 +02:00
Christian Klotz
960d271cb8
fix(coding-agent): synchronize model reload regression 2026-08-01 23:03:11 +03:00
Christian Klotz
6374a95fb2
fix(coding-agent): make model reload test deterministic 2026-08-01 22:53:41 +03:00
Christian Klotz
8750a38c4c
fix(coding-agent): make child output test deterministic 2026-08-01 21:26:55 +03:00
a-yeyang
8f9e769742 fix(coding-agent): recover stalled availability refreshes
Start forced availability rebuilds independently and discard stale snapshot and error publication. This fixes #7301 and reuses the implementation from #7421 by @a-yeyang with expanded race coverage.
2026-08-01 20:17:00 +02:00
David Brailovsky
8eda4f5b25 fix(coding-agent): reject prompts during manual compaction
closes #7150
2026-07-31 14:09:21 +00:00
Mario Zechner
74caa2649f fix(coding-agent): validate package manifests
Some checks are pending
CI / build-check-test (push) Waiting to run
closes #7187
2026-07-30 22:43:22 +02:00
David Brailovsky
bff5ab7174
fix(coding-agent): show system prompt files in startup context (#7266)
Shows file-backed SYSTEM.md and APPEND_SYSTEM.md entries in the interactive startup [Context] section.

fixes #7096
2026-07-29 17:05:22 +02:00
Thomas Mustier
cefa40ed8f
***WIP it's a PoC *** fix(coding-agent): guard tree navigation during responses (#7022)
* fix(coding-agent): guard tree navigation during responses

* fix(coding-agent): simplify tree navigation regression

* fix(coding-agent): abort active run on session replacement and tree navigation

Session replacement (resume, new, fork, import) now settles the active
response in teardownCurrent before disposing the outgoing session, so the
aborted turn and its tool results persist instead of leaving a dangling
tool call. Tree navigation aborts the active response directly once the
user commits, without a confirmation gate.
2026-07-28 14:46:30 +02:00
Christian Basch
f1ea6c0d05
fix(coding-agent): reset model selector selection to top row when filtering (#7211)
Typing a model name in the /model selector only clamped selectedIndex to
the filtered list length, leaving the highlight wherever it happened to
be instead of moving to the best match. Reset selectedIndex to 0 when a
non-empty query is present so the top row is highlighted in both the All
and Scoped tabs. Keep the clamp behavior when the query is cleared.

fixes #7209
2026-07-28 14:42:42 +02:00
Michael Yu
2efa728d2e
fix(coding-agent): support concurrent user bash cancellation (#7103)
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-07-27 12:00:24 +02:00
Michael Yu
c2275d6703
fix(coding-agent): prevent duplicate messages on startup session switch (#7110) 2026-07-27 11:59:27 +02:00
Lucas Meijer
f9a49869c2
feat(ai): expose pending stop reason while streaming (#7151)
* feat(ai): expose pending streaming stop reason

Closes #7142

* manual tidy up of human facing copy
2026-07-27 11:56:15 +02:00
Christian Klotz
a3ee1d286e
fix(coding-agent): expose unavailable scoped models (#7032)
* fix(coding-agent): expose unavailable scoped models

Keep missing configured models editable in the scoped-model selector. This fixes #6949.

* fix(coding-agent): reuse model scope diagnostics

* fix(coding-agent): classify model scope diagnostics
2026-07-25 07:19:56 +02:00
Armin Ronacher
24e5cc04f4
fix(ai): support Anthropic bearer token env (#6148)
Fixes #5871
2026-07-24 15:13:22 +02:00
Armin Ronacher
f87468131f
fix(coding-agent): reload model config in picker (#7036) 2026-07-24 07:52:49 +02:00
Anantha Kumaran
fc85bdd88b
feat(coding-agent): emit bash_execution_update events (#6971) 2026-07-23 12:28:12 +02:00
Christian Klotz
33e40c3e15
fix(ai): retry DNS transport failures (#6946)
Fixes #6904
2026-07-22 11:26:19 +02:00
Mario Zechner
b9e5c5d941 fix(agent): restore streamFn extension compatibility
Keep streamFn required for typed callers while preserving the legacy runtime fallback for extensions that omit it.\n\nfixes #6915
2026-07-21 18:37:07 +02:00
David Brailovsky
162179af5a add branch/compact retries to agent-harness 2026-07-21 12:11:39 +00:00
David Brailovsky
8e53e0e49c compaction & branch summarization follow retry policy
fixes #6647

compaction (auto & manual) and branch summarization retry on transient failures.
use the same retry policy from settings.
emit events for the tui to show indication of retries
2026-07-21 10:07:20 +00:00
Mario Zechner
1235c0ec64 fix(agent): decouple agent streams from compat
closes #6851
2026-07-20 17:54:36 +02:00
David Brailovsky
2fd3868401
add usage info to branch summary, compaction and tool result entries (#6671)
Some checks are pending
CI / build-check-test (push) Waiting to run
* add usage info to branch summary entries

* add usage to compaction entries

* allow custom tools to report llm usage in tool results

* allow observing and patching usage in tool_result hooks

* agent-harness: save usage in entries

for compaction, branch summaries and tool results
2026-07-20 16:41:43 +02:00