Commit Graph

90 Commits

Author SHA1 Message Date
Armin Ronacher a1b336d73e fix(coding-agent): allow extra edit replacement fields 2026-07-04 01:52:17 +02:00
Vegard Stikbakke 85b7c24741 fix(coding-agent): reject non-positive bash timeouts 2026-07-01 09:03:00 +02:00
Vegard Stikbakke cbcf4e04c3 fix(coding-agent): reject oversized bash timeouts
closes #6181
2026-07-01 08:49:31 +02:00
Armin Ronacher 4cc339f58d fix(coding-agent): process BMP images from disk
closes #6047
2026-06-25 12:52:21 +02:00
Armin Ronacher 756a4e8f6f fix(coding-agent): respect nested repo ignore boundaries in find
closes #5960
2026-06-22 10:57:39 +02:00
Armin Ronacher 128330e36f fix(coding-agent): preserve untouched lines in fuzzy edit
closes #5899
2026-06-19 20:16:47 +02:00
Vegard Stikbakke 1287b69fe0 fix(coding-agent): run legacy WSL bash commands via stdin
closes #5893
2026-06-19 15:08:25 +02:00
Alexey Zaytsev 2b46f38863 feat(coding-agent): Expose edit-diff for extensions (#5756) 2026-06-18 17:14:39 +02:00
Joseph Mearman 3fa4095629 fix: drain stdout before resolving when a child holds the pipe past exit (#5753) 2026-06-15 09:55:45 +02:00
Mario Zechner c45787411e Fix tool expand hint punctuation styling
closes #5359
2026-06-04 23:44:25 +02:00
Marek Pazik 42ce989a62 feat(coding-agent): hyperlink file paths in tool titles
Wrap the path shown in read/write/edit/ls tool titles in an OSC 8 file:// hyperlink when the terminal advertises hyperlink support.
The link target is always the absolute path, while the visible text stays relative/home-shortened and line annotations (e.g. :120-140) are kept out of the target.
2026-05-29 22:02:25 +10:00
Mario Zechner 373bd1282e Collapse read output by default
closes #4916
2026-05-23 11:40:54 +02:00
Mario Zechner 8100046cb8 Finish async tool cleanup 2026-05-23 11:36:41 +02:00
Mario Zechner ba09f1c9e0 Refine async tool control flow 2026-05-23 10:30:00 +02:00
Mario Zechner e9146a5ff7 fix(coding-agent): use async operations in tools 2026-05-23 09:50:03 +02:00
Armin Ronacher c100620bf4 fix(coding-agent): Clean up Path Handling (#4873) 2026-05-22 11:25:15 +02:00
Mario Zechner f953067814 fix(coding-agent): correct bash truncation line count
closes #4818
2026-05-21 16:55:22 +02:00
Mario Zechner 60a55a2399 feat(coding-agent): expose edit tool unified patch
closes #4821
2026-05-21 12:15:39 +02:00
Mario Zechner 7dad27e5f2 fix(coding-agent): avoid duplicate bash truncation path
closes #4819
2026-05-21 12:04:14 +02:00
Armin Ronacher ae9450dc51 chore(ts): use source import extensions 2026-05-20 00:04:03 +02:00
Armin Ronacher 29b3417a7a fix(windows): hide bash helper consoles
closes #4699
2026-05-18 23:21:22 +02:00
Armin Ronacher 2829146dde chore(deps): Kill small dependencies (#4467) 2026-05-13 10:44:56 +02:00
Armin Ronacher 3421726e86 fix(coding-agent): disambiguate resource paths 2026-05-08 00:16:28 +02:00
Mario Zechner 3e5ad67e0f chore: migrate pi packages to earendil works scope 2026-05-07 15:59:42 +02:00
Armin Ronacher 6b18cdbac1 fix(coding-agent): stream bash output incrementally (#4165)
fixes #4145
2026-05-04 19:06:07 +02:00
Armin Ronacher e355696d8a fix(coding-agent): show compact read line ranges 2026-05-04 09:39:12 +02:00
Mario Zechner 324aa1d647 fix(coding-agent): render compact read calls directly
Render compact read classifications in the call row and leave the collapsed result row empty. The previous implementation used shared renderer state to let renderResult hide renderCall, which leaked an internal ReadRenderState type through the tool definition and coupled two render phases unnecessarily. The call renderer has all context needed to choose the compact presentation itself.
2026-05-04 00:52:56 +02:00
Armin Ronacher 588639fa97 feat(read): compact resource read rendering 2026-05-02 21:20:26 +02:00
Mario Zechner 3ffc2b4306 fix(coding-agent): avoid duplicate blocked edit output
closes #3830
2026-04-30 22:50:40 +02:00
Mario Zechner 3d43d2e175 fix(coding-agent): stop tool argument injection
closes #4018
2026-04-30 21:31:43 +02:00
pica 24dec9fcd5 fix(coding-agent): remove detached: true on Windows to fix pwsh.exe stdio (#4013)
On Windows, spawn(..., { detached: true }) prevents pwsh.exe (PowerShell) from
producing any stdout/stderr through pipe streams. This is because detached creates
a new process group which breaks pwsh's console host communication.

bash.exe and other cygwin/msys2 shells are unaffected by detached: true, but
they don't need it either -- on Windows, killProcessTree() already uses
taskkill /F /T /PID which kills the process tree by PID regardless of
whether the process was spawned detached.

The detached flag only matters on Unix, where kill(-pid, SIGKILL) requires a
process group that is only created via detached: true.

Fixes #4012
2026-04-30 20:59:02 +02:00
Mario Zechner ebdf3cf451 Adjusts #3955, better error message 2026-04-30 12:33:02 +02:00
Ramiz Wachtler 43ee9b77ed fix(coding-agent): report edit access failures correctly (#3955)
* fix(coding-agent): report edit access failures correctly closes #3894

- classify edit and edit-preview access errors by errno
- add regressions for missing, permission, and fallback cases
- document the fix in the coding-agent changelog

* chore: get rid of CHANGELOG.md entry

* refactor(coding-agent): apply review suggestions - use single error msg

* refactor(coding-agent): clean up test cases
2026-04-30 12:31:29 +02:00
Armin Ronacher 35ff2689ee fix(typebox): migrate to v1 with extension compat (#3474)
* fix(typebox): migrate to v1 with extension compat

Replace AJV-based validation with TypeBox-native validation, keep legacy extension imports working (including @sinclair/typebox/compiler), and restore coercion for serialized/plain JSON schemas.

This change closes #3112.

* fix(typebox): use canonical imports and harden coercion

Switch first-party code to canonical typebox imports while retaining legacy extension aliases in the loader.

Remove obsolete runtime codegen guards, expand serialized JSON-schema coercion coverage, and update related tests and fixtures.

Fixes #3112.

---------

Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
2026-04-22 19:59:33 +02:00
Mario Zechner c40efa9bab fix(coding-agent): resolve shell config from session settings
Stop shell resolution from consulting ambient process.cwd() during bash execution and use the active session's shellPath setting instead.

closes #3452
2026-04-20 22:32:11 +02:00
Mario Zechner 5a4e22ea44 fix(coding-agent): remove process-cwd tool singletons and use tool-name allowlists
- switch SDK/CLI tool selection to name-based allowlists
- apply allowlists across built-in, extension, and SDK tools
- remove ambient process.cwd defaults from core tooling and resource helpers
- update tests, examples, and TUI callers for explicit cwd plumbing
- add regression coverage for extension tool filtering

closes #3452
closes #2835
2026-04-20 22:05:28 +02:00
Mario Zechner 27c1544839 fix(coding-agent): use tool-name allowlists and remove cwd-bound singletons
- treat tools as a global allowlist across built-in, extension, and SDK tools
- remove process-cwd singleton tool usage from SDK and CLI paths
- add regression coverage for extension tool filtering

closes #3452
closes #2835
2026-04-20 22:05:28 +02:00
Mario Zechner 2f4f283cc2 fix(ai,coding-agent): preserve non-vision image placeholders closes #3429 2026-04-20 16:52:27 +02:00
Danila Poyarkov a2ec01e12f fix(coding-agent): coerce stringified JSON edits in edit tool (#3370)
Some models (Opus 4.6, GLM-5.1) send the edits parameter as a JSON
string instead of a parsed array. This fails AJV validation with
'must be array' and models fall back to sed/python.

Parse stringified edits in prepareEditArguments before validation.
2026-04-18 18:29:23 +02:00
Aliou Diallo bfa11a50e4 feat(agent,coding-agent): per-tool executionMode override for sequential tool execution (#3345)
* feat(agent,coding-agent): add per-tool executionMode field to AgentTool and ToolDefinition

Add optional executionMode?: ToolExecutionMode to AgentTool and
ToolDefinition interfaces. Propagate through wrapToolDefinition and
createToolDefinitionFromAgentTool. No behavioral change yet — agent
loop will read this field in a follow-up.

* feat(agent): support per-tool executionMode override for sequential execution

When a tool defines executionMode='sequential', the agent loop
forces sequential execution of all tool calls in that batch,
even if the global config is parallel.

* feat(coding-agent): re-export ToolExecutionMode from @mariozechner/pi-agent-core

Makes the type available to extensions that want to set
executionMode on tool definitions.

* feat(coding-agent): add tic-tac-toe extension example with executionMode: sequential

Demonstrates per-tool executionMode: the agent plays via move/play
tool calls that share a cursor. Without sequential execution, play
can resolve before earlier moves finish, landing on the wrong cell.
2026-04-18 00:45:57 +02:00
Mario Zechner 1d4fdbad26 fix(coding-agent): scope nested .gitignore rules to their subtree in find
The find tool previously collected every .gitignore under the search
path and passed them to fd via --ignore-file. fd treats --ignore-file
entries as a single global ignore source, so rules from a/.gitignore
also filtered files under sibling b/.

Drop the manual collection and pass --no-require-git instead, which
makes fd apply hierarchical .gitignore semantics whether or not a git
repo is present.

closes #3303
2026-04-16 23:03:41 +02:00
Mario Zechner c5451af749 fix(coding-agent): make find tool match path-based glob patterns
fd --glob matches against the basename unless --full-path is set, so
patterns containing '/' (e.g. 'src/**/*.spec.ts') silently returned no
results. When the pattern contains '/', switch fd into --full-path mode
and prepend '**/' unless the pattern already starts with '/', '**/', or
is '**'. Basename patterns keep the default matcher.

closes #3302
2026-04-16 22:53:45 +02:00
Mario Zechner e9ba9e2ebc fix(coding-agent): harden find cancellation and grep match formatting closes #3148 2026-04-16 13:15:58 +02:00
Armin Ronacher 9b7948c4c8 fix(coding-agent): kill tracked detached bash children on shutdown 2026-04-16 00:12:14 +02:00
Mario Zechner f7cd613ee4 fix(coding-agent): stabilize edit diff previews closes #3134 2026-04-15 23:11:50 +02:00
Jack Rose d22c120b82 handle lower case am/pm in macos screenshot names (#3194) 2026-04-15 12:00:46 +02:00
Mario Zechner 52d16d5a31 fix(coding-agent): persist bash output on line truncation closes #2852 2026-04-05 23:28:49 +02:00
Mario Zechner b5f425ad15 feat(agent,coding-agent): add prepareArguments hook for pre-validation argument preparation
Add AgentTool.prepareArguments and ToolDefinition.prepareArguments hook
that runs before schema validation in the agent loop. This lets tools
silently accept legacy argument shapes from resumed old sessions without
polluting the public schema.

The built-in edit tool uses this to fold legacy top-level oldText/newText
into edits[] when resuming sessions that predate the edits-only schema.

- AgentTool/ToolDefinition: typed prepareArguments returning Static<TParameters>
- agent-loop: prepareToolCallArguments() runs before validateToolArguments()
- edit tool: prepareEditArguments folds legacy fields, validateEditInput is strict
- Documented in extensions.md with edit-tool example
2026-03-29 21:06:22 +02:00
Mario Zechner 0f9db44aff fix(coding-agent): avoid full redraw on large edit results closes #2664 2026-03-29 13:00:46 +02:00
Mario Zechner e773527b3a fix(coding-agent): simplify edit tool input closes #2639 2026-03-28 22:10:34 +01:00