Commit graph

12 commits

Author SHA1 Message Date
Mario Zechner
93ecdbea35 fix(coding-agent): improve subagent parallel summaries closes #4710 2026-05-18 22:52:59 +02:00
Mario Zechner
3e5ad67e0f chore: migrate pi packages to earendil works scope 2026-05-07 15:59:42 +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
nathyong
462b3d21e3
fix(coding-agent): do not inject bunfs script path into subagent prompts (#3002)
The presence of `process.argv[1]` in the current invocation does not
imply that the current `pi` process is being invoked as a script.
Specifically, in the case of a bun compiled binary, `process.argv[1]`
will be the virtual path `/$bunfs/root/pi`, which is not a real file on
the filesystem.  This causes the subagent extension to inject this path
into the child `pi` invocation, which is interpreted as part of the
prompt, which confuses the subagent.

This change uses the script only if it is not a bunfs virtual script

Co-authored-by: nathyong <nathyong@noreply.github.com>
2026-04-14 20:33:05 +02:00
Mario Zechner
235b247f1f fix(coding-agent): built-in tools work like extension tools
Export readToolDefinition / createReadToolDefinition and the equivalent built-in ToolDefinition APIs from @mariozechner/pi-coding-agent.
2026-03-22 04:20:38 +01:00
Ziphyrien
7c92bb8151
fix(subagent): reuse current pi invocation for child agents closes #2464 (#2465) 2026-03-20 17:12:24 +01:00
Mario Zechner
74a46fc7ea fix(coding-agent): queue file mutations across edit and write
closes #2327
2026-03-20 01:55:30 +01:00
Tianshu Wang
7390f830de
fix(subagent): use getAgentDir for user agents path (#1559) 2026-02-26 00:22:42 +01:00
Daniel Nouri
dae2eb5bfa
fix(subagent): list available agents in unknown-agent error (#1414)
The invalid-params error paths already listed available agents,
but the unknown-agent path in runSingleAgent just returned
'Unknown agent: claude' with no hint what exists.

Now: 'Unknown agent: "claude". Available agents: "worker".'

Model would guess names like "claude", "default", or skill names
like "brave-search". Now it self-corrects on the next call.

Tested with Opus 4.6: without fix, model gave up on subagent
and ran the tool calls itself instead. With fix, 1 wasted call.
2026-02-08 23:04:42 +01:00
Mario Zechner
0a26db53ef fix(coding-agent): align ToolDefinition.execute signature with AgentTool
BREAKING CHANGE: ToolDefinition.execute parameter order changed from
(id, params, onUpdate, ctx, signal) to (id, params, signal, onUpdate, ctx).

This aligns with AgentTool.execute so wrapping built-in tools no longer
requires parameter reordering. Update extensions by swapping signal and
onUpdate parameters.
2026-02-02 00:29:47 +01:00
Richard Gill
ce7e73b503
Centralize frontmatter parsing + parse frontmatter with yaml library (#728)
* Add frontmatter utility and tidy coding agent prompts

* Add frontmatter parsing utilities and tests

* Parse frontmatter with YAML parser

* Simplify frontmatter parsing utilities

* strip body in 1 place

* Improve frontmatter parsing error handling

* Normalize multiline skill and select-list descriptions
2026-01-16 00:31:53 +01:00
Mario Zechner
c6fc084534 Merge hooks and custom-tools into unified extensions system (#454)
Breaking changes:
- Settings: 'hooks' and 'customTools' arrays replaced with 'extensions'
- CLI: '--hook' and '--tool' flags replaced with '--extension' / '-e'
- API: HookMessage renamed to CustomMessage, role 'hookMessage' to 'custom'
- API: FileSlashCommand renamed to PromptTemplate
- API: discoverSlashCommands() renamed to discoverPromptTemplates()
- Directories: commands/ renamed to prompts/ for prompt templates

Migration:
- Session version bumped to 3 (auto-migrates v2 sessions)
- Old 'hookMessage' role entries converted to 'custom'

Structural changes:
- src/core/hooks/ and src/core/custom-tools/ merged into src/core/extensions/
- src/core/slash-commands.ts renamed to src/core/prompt-templates.ts
- examples/hooks/ and examples/custom-tools/ merged into examples/extensions/
- docs/hooks.md and docs/custom-tools.md merged into docs/extensions.md

New test coverage:
- test/extensions-runner.test.ts (10 tests)
- test/extensions-discovery.test.ts (26 tests)
- test/prompt-templates.test.ts
2026-01-05 01:43:35 +01:00