pi-open-agents 0.1.25 → 0.1.26
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/README.md +6 -0
- package/package.json +1 -1
- package/src/primary/manager.ts +20 -1
package/README.md
CHANGED
|
@@ -191,6 +191,12 @@ This means:
|
|
|
191
191
|
- Each subagent runs with exactly the model and tools it declares
|
|
192
192
|
- Skills load per-agent, with wildcard support (`security-*`, `git-*`)
|
|
193
193
|
|
|
194
|
+
> **`skills:` is subagent-only (#19).** pi discovers skills once at session
|
|
195
|
+
> startup and exposes no per-agent filter, so a **primary** cannot role-scope
|
|
196
|
+
> them. Declaring `skills:` on a primary (or `all`) agent warns on apply and
|
|
197
|
+
> the field is ignored; the subagent child receives exactly its listed skills,
|
|
198
|
+
> injected into its system prompt.
|
|
199
|
+
|
|
194
200
|
**Per-call model override:** the caller can override the agent's default for a
|
|
195
201
|
single call — `subagent({ agent: "deep-research", task: "...", model: "zai/glm-5.3-flash" })`.
|
|
196
202
|
Handy for "run this one task on the cheap model" without forking an agent
|
package/package.json
CHANGED
package/src/primary/manager.ts
CHANGED
|
@@ -5,11 +5,28 @@
|
|
|
5
5
|
* and coordinates with the executor for model/thinking/tools/prompt.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
8
|
+
import type { ExtensionAPI, ExtensionContext, ExtensionUIContext } from "@earendil-works/pi-coding-agent";
|
|
9
9
|
import type { Model } from "@earendil-works/pi-ai";
|
|
10
10
|
import type { AgentDefinition, ThinkingLevel } from "../types.ts";
|
|
11
11
|
import { applyAgentConfig } from "./executor.ts";
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Warn when an agent that will act as PRIMARY declares `skills:`.
|
|
15
|
+
*
|
|
16
|
+
* `skills:` is honored only for subagent children (the executor injects them
|
|
17
|
+
* into the child's system prompt). pi loads session skills at startup and
|
|
18
|
+
* exposes no per-agent filter, so a primary cannot role-scope them — warn
|
|
19
|
+
* instead of silently ignoring (#19).
|
|
20
|
+
*/
|
|
21
|
+
export function warnAgentSkillsPrimary(agent: AgentDefinition | undefined, ui: ExtensionUIContext): void {
|
|
22
|
+
if (agent?.skills && agent.skills.length > 0 && agent.mode !== "subagent") {
|
|
23
|
+
ui.notify(
|
|
24
|
+
`Agent "${agent.name}": skills: (${agent.skills.join(", ")}) applies to subagent delegation only — primaries use pi's session-wide skill set (#19)`,
|
|
25
|
+
"warning",
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
13
30
|
interface OriginalState {
|
|
14
31
|
model: Model<any> | undefined;
|
|
15
32
|
thinkingLevel: ThinkingLevel;
|
|
@@ -56,6 +73,8 @@ export class AgentManager {
|
|
|
56
73
|
const agent = this.agents.get(name);
|
|
57
74
|
if (!agent) return false;
|
|
58
75
|
|
|
76
|
+
warnAgentSkillsPrimary(agent, ctx.ui);
|
|
77
|
+
|
|
59
78
|
// Snapshot state on first apply (for restore on clear)
|
|
60
79
|
if (this.activeName === undefined) {
|
|
61
80
|
this.originalState = {
|