@gotgenes/pi-subagents 6.13.1 → 6.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [6.14.0](https://github.com/gotgenes/pi-packages/compare/pi-subagents-v6.13.1...pi-subagents-v6.14.0) (2026-05-23)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add promptSnippet to Agent, get_subagent_result, and steer_subagent ([#152](https://github.com/gotgenes/pi-packages/issues/152)) ([3ccbe14](https://github.com/gotgenes/pi-packages/commit/3ccbe140b05ab038c3c50ff1fdbe314d721c7b60))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Documentation
|
|
17
|
+
|
|
18
|
+
* plan add promptSnippet to subagent tools ([#152](https://github.com/gotgenes/pi-packages/issues/152)) ([f8fd56d](https://github.com/gotgenes/pi-packages/commit/f8fd56dff3d6a824f36c198d9a9d1b50a0bf740a))
|
|
19
|
+
|
|
8
20
|
## [6.13.1](https://github.com/gotgenes/pi-packages/compare/pi-subagents-v6.13.0...pi-subagents-v6.13.1) (2026-05-23)
|
|
9
21
|
|
|
10
22
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
issue: 152
|
|
3
|
+
issue_title: "Add promptSnippet to pi-subagents tools"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Add `promptSnippet` to pi-subagents tools
|
|
7
|
+
|
|
8
|
+
## Problem Statement
|
|
9
|
+
|
|
10
|
+
The `Agent`, `get_subagent_result`, and `steer_subagent` tools are the only tools across the monorepo that lack `promptSnippet`.
|
|
11
|
+
Pi's `buildSystemPrompt` uses `promptSnippet` to build a concise tool summary in the system prompt.
|
|
12
|
+
Without it, these tools rely entirely on their `description` field for model guidance.
|
|
13
|
+
The `Agent` tool's description is especially long (embeds full usage guidelines), so a short snippet would give the model a better quick-reference view.
|
|
14
|
+
|
|
15
|
+
## Goals
|
|
16
|
+
|
|
17
|
+
- Add `promptSnippet` to each of the three tool registrations in pi-subagents.
|
|
18
|
+
- Match the established `"<toolName>: <one-liner>"` format used by pi-github-tools and pi-colgrep.
|
|
19
|
+
|
|
20
|
+
## Non-Goals
|
|
21
|
+
|
|
22
|
+
- Changing `description`, `promptGuidelines`, or any other tool registration field.
|
|
23
|
+
- Adding `promptSnippet` to tools in other packages (already done).
|
|
24
|
+
|
|
25
|
+
## Background
|
|
26
|
+
|
|
27
|
+
Sibling packages pi-github-tools and pi-colgrep already provide `promptSnippet` on every tool.
|
|
28
|
+
The convention is a single string in the form `"tool_name: Short imperative description."`.
|
|
29
|
+
For example: `"ci_list: List recent CI runs for a workflow."`.
|
|
30
|
+
|
|
31
|
+
The three tool factories live in:
|
|
32
|
+
|
|
33
|
+
| Factory | File |
|
|
34
|
+
| --------------------- | ------------------------------ |
|
|
35
|
+
| `createAgentTool` | `src/tools/agent-tool.ts` |
|
|
36
|
+
| `createGetResultTool` | `src/tools/get-result-tool.ts` |
|
|
37
|
+
| `createSteerTool` | `src/tools/steer-tool.ts` |
|
|
38
|
+
|
|
39
|
+
Each factory returns a plain object with `name`, `label`, `description`, `parameters`, and `execute`.
|
|
40
|
+
Adding `promptSnippet` is a single property addition per factory.
|
|
41
|
+
|
|
42
|
+
## Design Overview
|
|
43
|
+
|
|
44
|
+
No structural change — this is a property addition to three existing object literals.
|
|
45
|
+
|
|
46
|
+
Proposed snippets:
|
|
47
|
+
|
|
48
|
+
- **Agent** — `"Agent: Launch a specialized agent for complex, multi-step tasks."`
|
|
49
|
+
- **get_subagent_result** — `"get_subagent_result: Check status and retrieve results from a background agent."`
|
|
50
|
+
- **steer_subagent** — `"steer_subagent: Send a mid-run message to redirect a running background agent."`
|
|
51
|
+
|
|
52
|
+
These are the exact phrasings from the issue.
|
|
53
|
+
Exact wording may be refined during implementation.
|
|
54
|
+
|
|
55
|
+
## Module-Level Changes
|
|
56
|
+
|
|
57
|
+
### `src/tools/agent-tool.ts`
|
|
58
|
+
|
|
59
|
+
Add `promptSnippet` property to the object returned by `createAgentTool`, after `label`.
|
|
60
|
+
|
|
61
|
+
### `src/tools/get-result-tool.ts`
|
|
62
|
+
|
|
63
|
+
Add `promptSnippet` property to the object returned by `createGetResultTool`, after `label`.
|
|
64
|
+
|
|
65
|
+
### `src/tools/steer-tool.ts`
|
|
66
|
+
|
|
67
|
+
Add `promptSnippet` property to the object returned by `createSteerTool`, after `label`.
|
|
68
|
+
|
|
69
|
+
## Test Impact Analysis
|
|
70
|
+
|
|
71
|
+
Existing tool-definition tests (`test/tools/agent-tool.test.ts`, `get-result-tool.test.ts`, `steer-tool.test.ts`) assert `name`, `label`, and `description` but not `promptSnippet`.
|
|
72
|
+
New assertions will verify the property exists with the expected value.
|
|
73
|
+
No existing tests need modification — the new property is additive.
|
|
74
|
+
|
|
75
|
+
## TDD Order
|
|
76
|
+
|
|
77
|
+
1. **Red → Green:** Add `promptSnippet` assertions to the tool-definition tests for all three tools, then add the `promptSnippet` property to each factory.
|
|
78
|
+
Commit: `feat: add promptSnippet to Agent, get_subagent_result, and steer_subagent (#152)`
|
|
79
|
+
|
|
80
|
+
This is a single-cycle change — one test step, one implementation step, one commit.
|
|
81
|
+
|
|
82
|
+
## Risks and Mitigations
|
|
83
|
+
|
|
84
|
+
| Risk | Mitigation |
|
|
85
|
+
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
86
|
+
| Snippet wording doesn't match what Pi displays well | The snippets mirror the first sentence of each tool's `description`; can be tweaked in a follow-up without breaking anything. |
|
|
87
|
+
| SDK `defineTool` doesn't pass through `promptSnippet` | Sibling packages already use it successfully, confirming SDK support. |
|
|
88
|
+
|
|
89
|
+
## Open Questions
|
|
90
|
+
|
|
91
|
+
None.
|
package/package.json
CHANGED
package/src/tools/agent-tool.ts
CHANGED
|
@@ -71,6 +71,7 @@ export function createAgentTool(deps: AgentToolDeps) {
|
|
|
71
71
|
return {
|
|
72
72
|
name: "Agent" as const,
|
|
73
73
|
label: "Agent",
|
|
74
|
+
promptSnippet: "Agent: Launch a specialized agent for complex, multi-step tasks.",
|
|
74
75
|
description: `Launch a new agent to handle complex, multi-step tasks autonomously.
|
|
75
76
|
|
|
76
77
|
The Agent tool launches specialized agents that autonomously handle complex tasks. Each agent type has specific capabilities and tools available to it.
|
|
@@ -19,6 +19,7 @@ export function createGetResultTool(deps: GetResultDeps) {
|
|
|
19
19
|
return {
|
|
20
20
|
name: "get_subagent_result" as const,
|
|
21
21
|
label: "Get Agent Result",
|
|
22
|
+
promptSnippet: "get_subagent_result: Check status and retrieve results from a background agent.",
|
|
22
23
|
description:
|
|
23
24
|
"Check status and retrieve results from a background agent. Use the agent ID returned by Agent with run_in_background.",
|
|
24
25
|
parameters: Type.Object({
|
package/src/tools/steer-tool.ts
CHANGED
|
@@ -18,6 +18,7 @@ export function createSteerTool(deps: SteerToolDeps) {
|
|
|
18
18
|
return {
|
|
19
19
|
name: "steer_subagent" as const,
|
|
20
20
|
label: "Steer Agent",
|
|
21
|
+
promptSnippet: "steer_subagent: Send a mid-run message to redirect a running background agent.",
|
|
21
22
|
description:
|
|
22
23
|
"Send a steering message to a running agent. The message will interrupt the agent after its current tool execution " +
|
|
23
24
|
"and be injected into its conversation, allowing you to redirect its work mid-run. Only works on running agents.",
|