Commit graph

5390 commits

Author SHA1 Message Date
Christian Klotz
515455fbc3
fix(server): sanitize unexpected protocol errors 2026-08-03 21:21:38 +03:00
Christian Klotz
2acd77b5c1
test(coding-agent): defer cross-package coverage 2026-08-03 21:20:33 +03:00
Christian Klotz
7135e83006
refactor(agent): remove unused tool prompt metadata 2026-08-03 21:20:33 +03:00
Christian Klotz
49b58fe7c4
fix(coding-agent): adopt session repository API 2026-08-03 21:20:33 +03:00
Christian Klotz
339ad70fd4
fix(coding-agent): harden server runtime invariants 2026-08-03 21:20:33 +03:00
Christian Klotz
1b929d57d2
fix(coding-agent): harden server lifecycle failures 2026-08-03 21:20:25 +03:00
Christian Klotz
965142c124
fix(coding-agent): remove redundant backend APIs 2026-08-03 21:20:17 +03:00
Christian Klotz
5f2c4dfeba
fix(coding-agent): clarify server session state 2026-08-03 21:20:17 +03:00
Christian Klotz
6d2cb8e877
fix(coding-agent): clarify server model resolver 2026-08-03 21:20:17 +03:00
Christian Klotz
e42c1fbfff
fix(coding-agent): centralize server model policy 2026-08-03 21:20:17 +03:00
Christian Klotz
449d8616a8
fix(coding-agent): group tool prompt metadata 2026-08-03 21:20:17 +03:00
Christian Klotz
66032ba117
fix(coding-agent): preserve server tool prompt 2026-08-03 21:20:17 +03:00
Christian Klotz
875a766985
feat(coding-agent): decouple server backend configuration 2026-08-03 21:20:17 +03:00
Christian Klotz
4abc08a8b3
feat(coding-agent): add server session backend
Add durable coding-agent session runtimes with locking, protocol projection, and JSONL persistence. Remove the obsolete legacy server implementation and dependency cycle.
2026-08-03 21:20:17 +03:00
Armin Ronacher
3d264e85b4 fix(coding-agent): avoid terminal query leak on fullscreen exit 2026-08-03 19:18:39 +02:00
Armin Ronacher
c72728bc1a fix(coding-agent): remove obsolete --alt shortcut 2026-08-03 19:00:35 +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
Armin Ronacher
b103937d3c
feat(coding-agent): switch UI modes at runtime (#7555) 2026-08-03 17:32:48 +02:00
Armin Ronacher
e563301dd3 fix(ai): avoid stale Copilot model in overflow test 2026-08-03 17:20:49 +02:00
Christian Klotz
305c014dcc
fix: make session authentication transport-specific (#7551)
Set the initial protocol version to 1 and remove bearer authentication from framed messages. Require transports to establish authorized connections.
2026-08-03 16:40:00 +03:00
Ramiz Wachtler
0e633790c5
fix(tui): handle batched color scheme reports (#7550)
- fixes #7538
2026-08-03 15:24:34 +02:00
David Brailovsky
c1019d9202 feat(ai): add Baseten provider
Closes #7405
2026-08-03 14:33:21 +02:00
Vegard Stikbakke
a24fb9e96a
fix(coding-agent): preserve auth header deletion markers (#7539)
Fixes #7030
2026-08-03 14:28:26 +02:00
Armin Ronacher
a8ee03b815 fix(tui): cache recently offscreen Kitty images 2026-08-03 14:03:16 +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
yaogangqiang
0f5286d8ab
feat(agent): expose shouldStopAfterTurn on Agent (#7367) 2026-08-03 14:01:16 +02:00
Cristina Poncela Cubeiro
b04faa2dae
fix: --model collects authed providers (#7366)
* fix: --model collects authed providers

* changeloggg

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-08-03 13:59:55 +02:00
Cristina Poncela Cubeiro
2e95584dab
fix: validateToolArguments() coerces nullable union (#7373)
* fix: validateToolArguments() coerces values that already match a nullable union

* changeloggg
2026-08-03 13:58:51 +02:00
David Brailovsky
816237c101
fix(coding-agent): target baseline x64 CPUs (#7390)
Fixes #7149

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-08-03 13:57:51 +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
Renaud Hartert
4f4762f06d
feat(coding-agent): set AI_AGENT environment variable (#7493) 2026-08-03 13:45:32 +02:00
muyiyr
cbaca60389
fix(ai): preserve Gemini 3 tool call IDs (#7494)
fixes #7047
2026-08-03 13:45:01 +02:00
xu0o0
786c76cb76
docs(coding-agent): fix branch summary diagram (#7526) 2026-08-03 13:41:03 +02:00
Jadugar
b9d360a2c7
fix(ai): retry transient provider errors in Google adapters (#7471)
The google-vertex and google-generative-ai adapters called
client.models.generateContentStream bare, so a transient 429/5xx before
the first token became a terminal errored assistant message instead of
being retried like in the Anthropic, OpenAI, Azure, and OpenRouter
adapters. Wrap the initial request in the shared retryProviderRequest
via a new retryGoogleRequest helper that also normalizes @google/genai's
ApiError, which has a status property but no headers property, so
retryProviderRequest's provider-error guard recognizes it.

Opt-in via the existing maxRetries stream option; default behavior is
unchanged.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-03 12:45:45 +02:00
Armin Ronacher
ebf33c0c22 fix(coding-agent): flash fullscreen copy confirmation 2026-08-03 12:00:39 +02:00
Vegard Stikbakke
c6eb6281a8 fix(coding-agent): bound post-login catalog refresh
closes #7027
2026-08-03 08:55:38 +02:00
Vegard Stikbakke
a077fff0b2 fix(coding-agent): identify failed model catalogs 2026-08-03 08:43:30 +02:00
Christian Klotz
f0deb8dd8e
Revert docs changes 2026-08-03 01:43:57 +03:00
Mario Zechner
01eeafd14a docs(agent): add durable queue-item cancellation to harness v2 variants
Queued steer/followUp/nextRun items get a durable identity and retraction,
mirrored in both design variants so the diff stays mechanism-only:

- queue_enqueued acceptance returns the provisioned entryId; snapshots and
  queue_update events carry QueuedItem { entryId, message }.
- New queue_cancelled record: without it, recovery would resurrect a
  cancelled item (record-without-entry restores as pending). Validity rules
  reject cancels of unknown or already-consumed items.
- cancelQueued(entryId) is one conditional mutation-line job; race-catalog
  row 12 covers cancel-vs-consume with exactly two histories. Reduction now
  also excludes abort-killed items (baseline omission).
- Adds the LaneRecord/NewRecord unions that sections 12/13 already
  referenced but section 5 never defined.

Adopted from the effect-durable-agent comparison (pending-message identity
and cancellation), trimmed to the minimal slice.
2026-08-02 23:09:59 +02:00
Mario Zechner
88ed89dbab docs(agent): split harness v2 into effects and generator variants
Replace harness-v2.md with two candidate designs that share Parts I and II
verbatim and differ only in the Part III stepping mechanism:

- harness-v2-effects.md: straight-line async procedures; deterministic
  stepping via a gated effect boundary (drive: "manual").
- harness-v2-generator.md: synchronous state machine; stepping via yielded
  actions and an execution controller.

Both fold in the fixes for the baseline defects found during the audit:
per-lane mutation line with conditional commits (finish/steer/abort/queue
races), nextRun capture at acceptance, terminal-failure recovery, terminate
persisted on tool-result entries, move-first navigation commit (closes the
open question, removes the only multi-object atomic write), corrected v3
normalization, and #7339-aligned deferred redemption.

Only one variant will be implemented; diff the two files to see the
mechanism trade-offs in isolation.
2026-08-02 21:51:15 +02:00
Christian Klotz
35fe55573c
Merge pull request #7459 from earendil-works/feat/experimental-cli-composition
feat(coding-agent): compose experimental CLI commands
2026-08-02 22:45:39 +03:00
Armin Ronacher
4c01c70938 fix(tui): skip clipped rows during layout painting 2026-08-02 16:56:38 +02:00
Armin Ronacher
73414d08b9 fix(tui): optimize alternate-screen image and layout redraws 2026-08-02 14:13:32 +02:00
Christian Klotz
4279da1b7f
Merge pull request #7478 from earendil-works/feat/session-storage-api
feat(agent): compose session storage through repositories
2026-08-02 13:42:19 +03:00
Christian Klotz
e05cc6e12c
docs: remove contributor changelog updates 2026-08-02 13:06:24 +03:00
Christian Klotz
f07af611d3
feat(agent): compose session storage through repositories 2026-08-02 12:35:02 +03:00
Christian Klotz
a4c7cb025d
feat(agent): reject unsupported session search 2026-08-02 12:35:02 +03:00