Commit graph

5336 commits

Author SHA1 Message Date
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
Christian Klotz
fce7445b1c
fix(coding-agent): make eval comparison direction explicit 2026-07-30 10:58:07 +03:00
github-actions[bot]
6bcc29a06c chore: approve contributors from issue #7300 2026-07-30 07:30:34 +00:00
Christian Klotz
ac033d1865
fix(coding-agent): align eval comparison report output 2026-07-30 10:19:58 +03:00
Christian Klotz
29f97c20f3
fix(coding-agent): simplify harness table tests 2026-07-30 10:11:08 +03:00
David Brailovsky
05558a7928 fix(ai): correct OpenCode Go provider display name from 'OpenCode Zen Go' to 'OpenCode Go'
fixes #7157
2026-07-30 09:01:42 +02:00
github-actions[bot]
fe1f7230f2 chore: approve contributors from issue #7271 2026-07-30 07:00:58 +00:00
Christian Klotz
d9ae6e2b07
fix(coding-agent): simplify comparative eval internals 2026-07-30 02:27:47 +03:00
Christian Klotz
6a3eae8e48
fix(coding-agent): normalize eval inputs before hashing 2026-07-30 02:13:02 +03:00
Christian Klotz
56e6a8a3fa
fix(coding-agent): record eval sessions after each test 2026-07-30 02:05:43 +03:00
Christian Klotz
2a2e677bed
fix(coding-agent): make source artifacts language neutral 2026-07-30 01:59:30 +03:00
Christian Klotz
3631e82d0e
fix(coding-agent): generalize eval source artifacts 2026-07-30 01:56:06 +03:00
Christian Klotz
eb08aa8fa2
fix(coding-agent): specialize eval attachment types 2026-07-30 01:47:53 +03:00
Christian Klotz
2eed6d219a
fix(coding-agent): remove redundant artifact names module 2026-07-30 01:37:23 +03:00