Commit graph

5336 commits

Author SHA1 Message Date
Christian Klotz
af00848d6b
fix(coding-agent): record eval artifacts with explicit tasks 2026-07-30 01:30:18 +03:00
Armin Ronacher
71efc6f0c1 Add [Unreleased] section for next cycle
Some checks are pending
CI / build-check-test (push) Waiting to run
2026-07-30 00:24:23 +02:00
Armin Ronacher
845d6ff1f6 Release v0.83.0 2026-07-30 00:24:19 +02:00
Armin Ronacher
44b26c9b44 fix(tui): format image fallback changes 2026-07-30 00:20:32 +02:00
Christian Klotz
32f3a97282
feat(coding-agent): add comparative Pi eval harness 2026-07-30 01:17:54 +03:00
Armin Ronacher
f0499a63ff docs: audit changelogs since v0.82.1 2026-07-30 00:00:54 +02:00
Armin Ronacher
34239180ac
fix(ai): preserve function arguments with empty custom payloads
Prefer function payloads when malformed OpenAI-compatible tool-call deltas also include an empty custom object, preserving parsed arguments.

Fixes #7160

Co-authored-by: Sunny Young <isunnyyoung@gmail.com>
2026-07-29 23:54:14 +02:00
github-actions[bot]
21f579a9a7 chore: approve contributors from issue #7160 2026-07-29 21:49:58 +00:00
David Brailovsky
d7b02636a0
Merge pull request #7272 from earendil-works/preserve-original-stop-reason
Adds AssistantMessage.rawStopReason and preserves provider original stop reasons.
Improves certain cases of error messages.
For mistral, change unmapped finish reasons to be "error" instead of "stop".

fixes #7255
2026-07-29 18:34:59 +02:00
David Brailovsky
5a2539a7bd update error messages copy to be more generic 2026-07-29 16:29:37 +00: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
David Brailovsky
4c1a0b92e5 fix(ai): use Qwen thinking controls for token plan reasoning models
fixes #6998 #6951
2026-07-29 14:58:48 +00:00
Cristina Poncela Cubeiro
6a9591ae78 refactor: repo owns session and storage separately 2026-07-29 16:33:20 +02:00
Mario Zechner
4f0437e2d5 docs(agent): harness design v2 (harness-v2.md)
Restructured rewrite: concepts (session = tree + lanes + per-lane
operation logs + global facts), records and crash-site traces, recovery
as reduction, then API and implementation top-down. Renames refs to
lanes, generations to tasks; retires leaf entries, de-trees labels and
name, adds deferred provider requests (stopReason deferred, optional
fetchDeferred/cancelDeferred on ProviderStreams, deliberate lane
suspension), SQLite branch cache with tips and reverse lookup, Unix ms
timestamps. Supersedes harness.md.
2026-07-29 15:41:49 +02:00
David Brailovsky
5a53f086ee fix(ai): preserve raw Mistral stop reasons
Treat unmapped Mistral finish reasons as provider errors instead of successful stops.
2026-07-29 14:05:29 +02:00
David Brailovsky
e5ef8d0654 fix(ai): preserve raw OpenAI response statuses 2026-07-29 13:56:21 +02:00
David Brailovsky
fe1c9b6d52 fix(ai): preserve raw OpenAI completion stop reasons 2026-07-29 13:52:14 +02:00
David Brailovsky
637737ca71 fix(ai): preserve raw Bedrock stop reasons 2026-07-29 13:49:42 +02:00
David Brailovsky
926eb15c18 fix(ai): preserve raw Anthropic stop reasons 2026-07-29 13:41:03 +02:00
David Brailovsky
23cb385b67 fix(ai): preserve google providers raw stop reason 2026-07-29 11:31:53 +00:00
Arunprasad Rajkumar
cced6a21da
fix(coding-agent): stop loading AGENTS.md twice in nested git worktrees (#7221)
Running from a linked worktree nested under its main repo loaded the
project's AGENTS.md/CLAUDE.md twice. The ancestor walk climbs from cwd to
the filesystem root, so it picked up the worktree's copy and then the main
repo's copy above it, even though both are the same tracked file.

The walk now drops that one duplicate: the main repo root's copy is skipped
when the worktree root has a context file of the same name. Nothing else
changes. The worktree still inherits the main repo's copy when it has none,
directories above the main repo keep loading, and ordinary repos, sibling
worktrees, submodules and bare layouts are untouched.
2026-07-29 10:31:50 +02:00
Petr Houška
f9476a61e5
fix(ai): update TypeBox nullable array validation (#7243)
Bump TypeBox to 1.3.7 so compiled validators guard array-specific keywords when null is accepted, and cover tool-argument validation with a regression test.

Breaking for extensions: TypeBox 1.3 removes deprecated APIs including Type.Base, Type.Awaited, Type.Promise, Type.AsyncIterator, Type.Iterator, Type.Options, and Value.Mutate. Extensions using these through Pi's bundled TypeBox aliases must migrate to supported TypeBox APIs.

Fixes #7003
2026-07-29 10:31:07 +02:00
Mario Zechner
fb4ecd633e
fix(tui): shorten image fallback paths and clamp width (#7262)
Image.render() previously emitted the imageFallback line without
truncateToWidth. Long absolute paths (common when callers pass a
filename) exceeded the terminal width and crashed the TUI.

- imageFallback: home-shorten paths to ~/...; OSC 8 file:// link when
  hyperlinks are available and the path is absolute
- Image.render: truncate fallback lines to the render width
- tests for shorten, hyperlink, basename, and width clamp

Co-authored-by: Moritz Hofmann <Moritz.Hofmann@aimentum.de>
2026-07-29 10:27:12 +02:00
github-actions[bot]
7796481e62 chore: approve contributors from issue #7217 2026-07-29 08:24:33 +00:00
github-actions[bot]
a5db0e4f17 chore: approve contributors from issue #7219 2026-07-29 08:23:43 +00:00
Cristina Poncela Cubeiro
3627c01179 fix: do not require index 2026-07-29 10:22:51 +02:00
github-actions[bot]
e9e86e1c83 chore: approve contributors from issue #7224 2026-07-29 08:21:47 +00:00
Steve Immanuel
0c32e83a35
fix(coding-agent): enable streaming usage for llama.cpp provider (#7258)
llama-server supports OpenAI-spec stream_options.include_usage since
b2b6b55a59 (Sep 2025); any server new enough for router mode sends the
final usage chunk when requested. With the flag hardcoded to false the
provider never requests it, so streamed responses record zero tokens
and session/context accounting stays empty.

Verified against llama-server b10094: with include_usage sent, the
final chunk carries usage (incl. prompt_tokens_details.cached_tokens);
without it, nothing.
2026-07-29 10:03:59 +02:00
Cristina Poncela Cubeiro
d5c37c65bf refactor: composable Storage vs Search 2026-07-29 09:50:36 +02:00
Armin Ronacher
027a584790 feat(ai): add per-request fetch injection 2026-07-28 18:51:44 +02:00
Mario Zechner
fdbedcad8a docs(agent): add refs to harness design
Refs: named movable leaf pointers, one active operation per ref, parallel
under one writer. AgentRef surface implemented by AgentHarness for main;
per-ref queues, persisted config, session views, scoped watch() plus
watchSession(). Per-ref recovery and operational-log partitioning (no
parenting; log order is causal order within a ref; session entries carry
no ref, membership derives from parent linkage). Labels and session name
de-treed to global latest-wins records with setter APIs. Named
append-only context invariant (KV cache rationale for deferred writes).
New traces, API examples, and open questions for review.
2026-07-28 16:08:11 +02:00
David Brailovsky
47ca25fcd8 Revert "fix(coding-agent): build-check-test (#7206)"
This reverts commit f145195516.
2026-07-28 15:09:46 +02:00
David Brailovsky
0d008b7468 fix(coding-agent): show tool expansion status
fixes #7180
2026-07-28 15:07:19 +02:00
xu0o0
f145195516
fix(coding-agent): build-check-test (#7206) 2026-07-28 14:46:56 +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
HyeokjaeLee
2fe21b407f
fix(ai): send max_tokens for Z.AI providers (#7174)
* fix(ai): send max_tokens for Z.AI providers

Z.AI (zai, zai-coding-cn, api.z.ai, open.bigmodel.cn) ignores
max_completion_tokens and only honors max_tokens, so the configured
output cap never applied and Z.AI fell back to its 65536 default.
Add isZai to detectCompat's useMaxTokens condition.

* fix(ai): set zai max_tokens compat in model generator

Per review feedback: the model generator now maps Z.AI to max_tokens, so
regenerated Z.AI model entries carry compat.maxTokensField="max_tokens"
(Z.AI ignores max_completion_tokens). The runtime detectCompat change is
kept as a fallback for custom/self-hosted Z.AI base URLs not in the catalog,
matching how moonshot/together/nvidia are handled in both places.
2026-07-28 14:43:41 +02:00
xu0o0
0563a7c017
fix(coding-agent): clean up failed git installs (#7210) 2026-07-28 14:43:22 +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
Cristina Poncela Cubeiro
5d548ae969
fix: rpc bash no longer bypass user_bash (#7214)
* fix: rpc bash no longer bypass user_bash

* fix: rpc bash no longer bypass user_bash
2026-07-28 14:41:39 +02:00
David Brailovsky
66eead6524
fix(coding-agent): preserve resource metadata after extension resource reloads (#7218)
fixes #6968
2026-07-28 14:39:23 +02:00
Cristina Poncela Cubeiro
b6fb91e5b3
fix(coding-agent): include scoped models in TUI extension context (#7215) 2026-07-28 13:20:11 +02:00
Thomas Mustier
063fb963c5
fix(coding-agent): isolate autoload-disabled package test from real home directory (#7167)
* fix(coding-agent): isolate autoload-disabled package test from real home directory

The test asserted result.skills is exactly empty, but resolve() also
scans ~/.agents/skills via getHomeDir(). On machines where that
directory is populated the test failed; CI runners have no
~/.agents/skills, so it always passed there. Stub HOME to the temp
dir with the same save/restore pattern used by neighbouring tests.

* fix(coding-agent): use vi.stubEnv for home directory isolation

Replaces the manual try/finally save/restore with vi.stubEnv plus
vi.unstubAllEnvs in afterEach, shrinking the fix to two added lines.

* fix(coding-agent): plant decoy user skill so the empty-skills assertion cannot pass vacuously

With an empty sandbox, result.skills equal to [] could not distinguish
the package skill being correctly excluded from skill resolution being
broken entirely. A decoy skill in the stubbed HOME's .agents/skills
proves scanning still works while the package skill stays excluded.

* fix(coding-agent): simplify home isolation test
2026-07-28 08:40:26 +02:00
Christian Basch
b63403a50f
fix(ai): prefer configured Bedrock profile over ambient AWS keys (#7176)
Bedrock profile configured via pi's auth flow was ignored when ambient
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY were set, because pi forced
config.credentials from those keys and the SDK treats explicit
credentials as overriding config.profile.

Fixes #6957
2026-07-28 08:38:35 +02:00
pungggi
04b15259b2
feat(extensions): expose ctx.scopedModels to extensions (#7191)
Extensions have no way to read the session's scoped model set (the models
resolved from --models / enabledModels against the available catalogue --
the same list /scoped-models shows). The only model surfaces on
ExtensionContext are ctx.model (active) and ctx.modelRegistry.getAvailable()
(the whole catalogue, unfiltered), so an extension that wants a scoped
model picker must either enumerate everything or re-implement pi's scope
resolution (minimatch on provider/modelId / bare modelId + enabledModels +
--models) from disk -- duplicating core logic.

Add ctx.scopedModels: readonly ScopedModel[] to ExtensionContext, mirroring
how ctx.model is exposed (field -> bindCore -> lazy getter in createContext()).
Empty when no scoping is configured (all available models usable). Each entry
is { model, thinkingLevel? }.

- types.ts: ExtensionContext.scopedModels + ExtensionContextActions.getScopedModels
- runner.ts: field, bindCore wiring, lazy scopedModels getter
- agent-session.ts: provide getScopedModels: () => this._scopedModels
- test: assert ctx.scopedModels reflects the action (default [] + live ref)
- docs/extensions.md: document the new field

Co-authored-by: ngSoftware <alessandro@pungitore.ch>
2026-07-28 08:31:01 +02:00
github-actions[bot]
2903063d2c chore: approve contributors from issue #7171 2026-07-28 06:23:14 +00:00
Mario Zechner
c820aa26fe Merge branch 'design/durable-agent-harness' 2026-07-28 00:01:51 +02:00
Mario Zechner
e8f9c07153 docs(agent): durable AgentHarness design (harness.md)
Full design for the durable, resumable harness: session log with harness
entries, SessionTree query contract, public API with result unions, watch()
snapshots, events/hooks catalogs, recovery procedures as code, forks,
storage backends, and telemetry integration.
2026-07-28 00:01:20 +02:00
Cristina Poncela Cubeiro
c63bf0ee4b cleanup 2026-07-27 21:42:54 +02:00
Cristina Poncela Cubeiro
c2bd0eda7f fix: default sqlite search backend to fts5 2026-07-27 21:32:48 +02:00
Cristina Poncela Cubeiro
499dd8c544 cleanup 2026-07-27 18:17:55 +02:00