Commit graph

5249 commits

Author SHA1 Message Date
Christian Klotz
33bc0a7b83
feat(client): add runtime-neutral session client
Split harness shutdown initiation from settlement so callbacks can request shutdown without deadlocking active work.
2026-07-31 12:19:19 +03:00
Christian Klotz
e6fb3ec68f
Merge pull request #7365 from earendil-works/fix/auth-storage-lock-tests
fix(coding-agent): decouple auth lock error tests
2026-07-31 12:18:28 +03:00
Christian Klotz
8ee2207824
fix(coding-agent): decouple auth lock error tests 2026-07-31 12:09:16 +03:00
Cristina Poncela Cubeiro
ab366ebe94
fix: custom-compaction through provider via new model runtime complete (#7325)
* fix: custom-compaction through provider via new model runtime complete

* Update CHANGELOG.md
2026-07-31 10:54:26 +02:00
David Brailovsky
59ad3dead3
fix(ai): preserve Anthropic initial stream block content (#7358)
fixes #7283
2026-07-31 10:39:38 +02:00
Mario Zechner
9786716d4d fix(coding-agent): update vulnerable brace-expansion
closes #7316
2026-07-31 10:36:02 +02:00
jingtao
6138f5a079
fix(ai): keep signed empty text/thinking blocks in google history (#7362)
Gemini can attach thoughtSignature to a part whose visible text is
empty and requires it echoed back; convertMessages dropped such blocks
together with the signature, breaking the reasoning chain. With the
chain broken, gemini flash models intermittently end a mid-task turn
with a thought-only STOP and no tool call. Empty blocks are now dropped
only when they are unsigned, mirroring the anthropic converter.

Co-authored-by: Jingtao Xu <jingtaozf@gmail.com>
2026-07-31 10:30:38 +02:00
Armin Ronacher
17090d4b99
feat(tui): add stacked alt-screen flashes (#7361) 2026-07-31 10:13:31 +02:00
Mario Zechner
57cde86906 fix(coding-agent): reload credentials before reads
closes #7319
2026-07-31 10:05:57 +02:00
github-actions[bot]
2b5097644d chore: approve contributors from issue #7319 2026-07-31 08:05:30 +00:00
Mario Zechner
32761383d2 fix(coding-agent): update Doom WAD download source 2026-07-31 10:03:41 +02:00
David Brailovsky
3c5a1b2393 fix(tui): reduce default mouse wheel scroll speed 2026-07-31 09:53:33 +02:00
github-actions[bot]
e187887886 chore: approve contributors from issue #7357 2026-07-31 07:51:54 +00:00
github-actions[bot]
5f10deb5c9 chore: approve contributors from issue #7356 2026-07-31 07:50:25 +00:00
Christian Klotz
97cfd708d4
Merge pull request #7359 from earendil-works/refactor/session-repository-factory-names
fix(agent): refine session repository API
2026-07-31 10:42:23 +03:00
Erik Ogenvik
4523528b21
fix(ai): treat only plain objects as provider error bodies (#7205)
pickBodyText serialized any non-empty object into the error body. SDK error
fields can hold class instances instead of parsed bodies - AWS SDK v3's
$response.body is an HTTP stream/response wrapper - and stringifying one
produced garbage like {"_events":...} as the body, which then replaced
error.message in the composed display string. error.message is where the SDK
puts the real deserialized exception text ("Input is too long...", schema
validation details), so the one useful string was discarded for noise.

The existing pipe-based stream sniffing only covers node-style streams; web
ReadableStreams (pipeTo/pipeThrough, no pipe) and non-stream wrapper classes
slipped through. Require Object.prototype/null prototype before serializing
a candidate body - parsed JSON bodies are plain objects by construction, so
real gateway bodies still surface.
2026-07-31 09:38:54 +02:00
github-actions[bot]
66cd061ab4 chore: approve contributors from issue #7330 2026-07-31 07:37:19 +00:00
Christian Klotz
8eda7d5020
fix(agent): type composed session stores explicitly 2026-07-31 10:37:12 +03:00
Christian Klotz
a1bb7e4483
fix(agent): expose session stores through factories 2026-07-31 10:28:59 +03:00
Mario Zechner
ea1e77e2db feat(tui): add alternate-screen viewport layouts 2026-07-31 09:22:10 +02:00
github-actions[bot]
471c3390fe chore: approve contributors from issue #7299 2026-07-31 07:02:25 +00:00
Christian Klotz
2700511e45
fix(agent): refine session repository API 2026-07-31 09:48:24 +03:00
Christian Klotz
9b50b046d3
Merge pull request #7163 from cristinaponcela/feat/search
feat: search index sqlite
2026-07-31 09:15:12 +03:00
Cristina Poncela Cubeiro
aa784e5eed refactor, cleanup and conditionals for fts5 2026-07-31 05:51:24 +02:00
Cristina Poncela Cubeiro
c984b7c9e2 cleanup 2026-07-31 05:35:19 +02:00
Cristina Poncela Cubeiro
fb0f0f7cd5 rename: vars 2026-07-31 05:19:23 +02:00
Mario Zechner
74caa2649f fix(coding-agent): validate package manifests
closes #7187
2026-07-30 22:43:22 +02:00
Alexey Zaytsev
714978bf51
Markdown api (#7231)
* feat(tui): export bundled Marked parser

* feat(coding-agent): add width-aware Markdown transformers

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-30 22:39:04 +02:00
Brian
70bbe47a9d
feat(ai): preserve structured metadata for Bedrock provider errors (#7286)
* feat(ai): preserve structured metadata for Bedrock provider errors

A failed Bedrock turn only exposed `errorMessage`, so downstream runtimes
could not classify a provider failure or correlate it with AWS support
without parsing that string. The AWS SDK carries the HTTP status, the
modeled error code, and the request id on the thrown exception; the
provider dropped all three.

Attach them as a `bedrock_response_failure` diagnostic on the existing
`AssistantMessage.diagnostics` array. No new core type surface, and no
existing line changed: the diff is purely additive.

`errorMessage` stays byte-identical because `isRetryableAssistantError`
classifies retries by string-matching it, and `BEDROCK_ERROR_PREFIXES` is
documented as load-bearing for that.

Scope note: the serialized-stream noise in the original report
(`Validation error: 400: {"_events":...}`) was already fixed in v0.82.1 by
 #7081, which added the unread-stream guard in `normalizeProviderError`.
Verified against main: `errorMessage` is clean today. This change covers
only the remaining half of the issue, the missing structured metadata.

Details:
- Carries `details` only, no `error` block, as `pi_messages_rewrite` does.
  A modeled mid-stream exception is not an `Error` at all, so routing it
  through `extractDiagnosticError` would record `"[object Object]"` plus a
  stack trace pointing into the SDK. The readable text is in `errorMessage`.
- `errorCode` reads `error.name`, which is where the SDK puts the modeled
  code for both paths that expose one: service exceptions from
  `client.send()` (via `x-amzn-errortype`) and the plain `Error` the
  event-stream unmarshaller throws for an unmodeled stream error (via
  `:error-code`). All 13 modeled Bedrock errors end in `Exception`, so that
  suffix is the gate; it excludes transport failures such as `TimeoutError`
  and `CredentialsProviderError`, and the SDK's `Unknown` placeholder,
  without enumerating them.
- A modeled mid-stream exception reports only a request id, on purpose.
  `@smithy/core` `getMessageUnmarshaller` throws `deserializedException[code]`
  after reading the code into a local, and the JSON shape deserializer built
  that value as a bare object literal, so the code no longer exists by the
  time it reaches us. The request id from the initial response is used as a
  fallback so these failures stay correlatable.
- `details.status` matches the key `pi_messages_response_failure` uses.
- Header-derived values are dropped when over-long rather than truncated: a
  truncated request id is not a request id.
- Aborted turns emit no diagnostic.

closes #7224

* docs(ai): trim comment density in the Bedrock failure diagnostic

The added block sat at 52 percent comment against 14 percent for the rest
of bedrock-converse-stream.ts and 2-9 percent across the other providers.
Cut to the facts a future maintainer cannot infer from the code: why the
error code is not gated on `BedrockRuntimeServiceException`, why a modeled
mid-stream exception yields only a request id, and the `errorMessage`
byte-identity invariant. Now 29 percent of a 27-line block.

Test comments trimmed the same way, 15 percent to 4 percent, matching
bedrock-custom-headers.test.ts. No behavior change; all tests unchanged
and passing.

---------

Co-authored-by: Brian Stanley <brian.stanley@kavak.com>
2026-07-30 22:32:20 +02:00
Petr Houška
dfe47d3fbd
fix(tui): align grapheme widths with terminal cells (#6987)
Intl.Segmenter can group Indic conjuncts and spacing marks into one grapheme even when wcwidth-style terminals allocate multiple cells. Count visible consonants after marks and Unicode spacing marks separately while preserving zero-width exceptions.

This is a compatibility heuristic. Unicode Spacing_Mark indicates positive advance, not a full terminal cell; Kitty keeps many Indic continuations in the initial cell, while xterm-style terminals advance for them, so Pi overcounts some clusters in Kitty.

Overcounting causes horizontal drift, but undercounting can trigger terminal autowrap, so this change favors overcounting.

Clusters can contain repeated marks and mark-consonant continuations, so this implementation leaves their widths uncapped. Collapsing them would undercount terminals that advance for every visible continuation.

Mode 2027 does not report cluster widths, so Pi still needs local width calculations. This change does not implement OSC 66, which would be preferable where supported.

Fixes #6124

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-07-30 22:25:46 +02:00
Mario Zechner
2c30412420 fix(ai): support streams without finish reasons 2026-07-30 22:23:46 +02:00
muyiyr
393c344229
fix(coding-agent): replace deprecated getModel in SDK example (#7306) 2026-07-30 22:01:49 +02:00
Christian Klotz
c066d01a40
Merge pull request #7344 from earendil-works/feat/protocol-package
feat(protocol): add remote session wire protocol
2026-07-30 22:43:55 +03:00
Christian Klotz
b2a1a06550
docs(protocol): add package changelog 2026-07-30 22:33:15 +03:00
Christian Klotz
9cde1725d7
fix(agent): preserve waitForIdle semantics 2026-07-30 22:22:47 +03:00
Christian Klotz
871a990479
refactor(agent): unify harness task tracking 2026-07-30 22:16:08 +03:00
Christian Klotz
bd2cfabc5f
fix(protocol): reject cyclic values and organize sources 2026-07-30 22:07:42 +03:00
Christian Klotz
bc031ae457
fix(agent): await mutations during harness shutdown 2026-07-30 22:07:37 +03:00
Armin Ronacher
b889a0ce3d fix(ai): update GPT-5.6 pricing 2026-07-30 21:02:58 +02:00
Christian Klotz
56eb685b69
feat(protocol): add remote session wire protocol 2026-07-30 21:45:58 +03:00
Christian Klotz
7d86e6233a
Merge pull request #7343 from earendil-works/feat/agent-harness-shutdown
feat(agent): add harness shutdown lifecycle
2026-07-30 21:35:01 +03:00
Christian Klotz
82c4859839
feat(agent): add harness shutdown lifecycle 2026-07-30 21:29:30 +03:00
Cristina Poncela Cubeiro
83a7f755cc refactor and cleanup 2026-07-30 16:35:29 +02:00
Cristina Poncela Cubeiro
5e48d41ecd refactor: repo facade 2026-07-30 14:07:58 +02:00
Mario Zechner
c13ffe1877 feat(tui): add alternate-screen renderer
Closes #7304
2026-07-30 12:59:48 +02:00
Mario Zechner
96eda8b47f docs(agent): agent-loop building blocks in harness v2
New section 14: streamAssistant and the three-phase tool execution
blocks (prepare/execute/finalize) with durability callbacks, batch rules
(parallel vs sequential, length truncation, terminate), and the
unbreakable agent-loop.ts compatibility requirement with acceptance
criterion. Harness internals rewritten on top of the blocks: runToolBatch
with provisioned-id callbacks, reconciliation via phases 2+3, hook-to-
block wiring table. Auth surface removed from the stream block: Models
resolves auth per request; before_payload/after_response mount on
onPayload/onResponse. Sections 16-22 renumbered.
2026-07-30 12:59:09 +02:00
Cristina Poncela Cubeiro
bb226f9c1f
fix: redundancy in setToolsExpanded (#7313) 2026-07-30 10:57:16 +02:00
Christian Klotz
7659e1c98d
Merge pull request #7289 from earendil-works/worktree/evals-baseline
feat(coding-agent): add comparative Pi eval harness
2026-07-30 11:46:45 +03:00
Christian Klotz
743e1595c4
fix(coding-agent): remove custom eval shuffling 2026-07-30 11:31:41 +03:00
Christian Klotz
ca11823f72
fix(coding-agent): streamline comparative eval ergonomics 2026-07-30 11:12:04 +03:00