fix release
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
name: planner
|
||||
description: Creates implementation plans from context and requirements
|
||||
tools: read, grep, find, ls
|
||||
model: llamacpp/Qwen3.6-35B-A3B-instruct
|
||||
---
|
||||
|
||||
You are a planning specialist. You receive context (from a scout) and requirements, then produce a clear implementation plan.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
name: researcher
|
||||
description: Exploratory web research — surveys the open web and returns a compressed brief
|
||||
tools: web_search, fetch_url, read
|
||||
model: llamacpp/Qwen3.6-35B-A3B-instruct
|
||||
---
|
||||
|
||||
You are a web researcher. You investigate a question by searching the open web, fetching the most relevant pages, and returning a compressed brief that another agent can act on without re-searching.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
name: reviewer
|
||||
description: Code review specialist for quality and security analysis
|
||||
tools: read, grep, find, ls, bash
|
||||
model: llamacpp/Qwen3.6-35B-A3B-instruct
|
||||
---
|
||||
|
||||
You are a senior code reviewer. Analyze code for quality, security, and maintainability.
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
name: scout
|
||||
description: Fast codebase recon that returns compressed context for handoff to other agents
|
||||
tools: read, grep, find, ls, bash
|
||||
model: llamacpp/Qwen3.6-35B-A3B-instruct
|
||||
---
|
||||
|
||||
You are a scout. Quickly investigate a codebase and return structured findings that another agent can use without re-reading everything.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
name: worker
|
||||
description: General-purpose subagent with full capabilities, isolated context
|
||||
model: llamacpp/Qwen3.6-35B-A3B-instruct
|
||||
---
|
||||
|
||||
You are a worker agent with full capabilities. You operate in an isolated context window to handle delegated tasks without polluting the main conversation.
|
||||
|
||||
@@ -152,12 +152,14 @@ const TaskItem = Type.Object({
|
||||
agent: Type.String({ description: "Name of the agent to invoke" }),
|
||||
task: Type.String({ description: "Task to delegate to the agent" }),
|
||||
cwd: Type.Optional(Type.String({ description: "Working directory for the agent process" })),
|
||||
model: Type.Optional(Type.String({ description: "Model to use for this subagent run; omit to use the agent/default model" })),
|
||||
});
|
||||
|
||||
const ChainItem = Type.Object({
|
||||
agent: Type.String({ description: "Name of the agent to invoke" }),
|
||||
task: Type.String({ description: "Task with optional {previous} placeholder for prior output" }),
|
||||
cwd: Type.Optional(Type.String({ description: "Working directory for the agent process" })),
|
||||
model: Type.Optional(Type.String({ description: "Model to use for this chain step; omit to use the agent/default model" })),
|
||||
});
|
||||
|
||||
const AgentScopeSchema = StringEnum(["user", "project", "both"] as const, {
|
||||
@@ -168,8 +170,9 @@ const AgentScopeSchema = StringEnum(["user", "project", "both"] as const, {
|
||||
const SubagentParams = Type.Object({
|
||||
agent: Type.Optional(Type.String({ description: "Name of the agent to invoke (for single mode)" })),
|
||||
task: Type.Optional(Type.String({ description: "Task to delegate (for single mode)" })),
|
||||
tasks: Type.Optional(Type.Array(TaskItem, { description: "Array of {agent, task} for parallel execution" })),
|
||||
chain: Type.Optional(Type.Array(ChainItem, { description: "Array of {agent, task} for sequential execution" })),
|
||||
model: Type.Optional(Type.String({ description: "Model to use for this subagent run; omit to use the agent/default model" })),
|
||||
tasks: Type.Optional(Type.Array(TaskItem, { description: "Array of {agent, task, model?} for parallel execution" })),
|
||||
chain: Type.Optional(Type.Array(ChainItem, { description: "Array of {agent, task, model?} for sequential execution" })),
|
||||
agentScope: Type.Optional(AgentScopeSchema),
|
||||
confirmProjectAgents: Type.Optional(
|
||||
Type.Boolean({ description: "Prompt before running project-local agents. Default: true.", default: true }),
|
||||
@@ -218,6 +221,7 @@ export default function (pi: ExtensionAPI) {
|
||||
description: [
|
||||
"Delegate tasks to specialized subagents with isolated context.",
|
||||
"Modes: single (agent + task), parallel (tasks array), chain (sequential with {previous} placeholder).",
|
||||
"Optional model fields let you choose the model per subagent run; omit them to use the agent/default model.",
|
||||
'Default agent scope is "user" (from ~/.pi/agent/agents).',
|
||||
'To enable project-local agents in .pi/agents, set agentScope: "both" (or "project").',
|
||||
].join(" "),
|
||||
@@ -360,6 +364,7 @@ export default function (pi: ExtensionAPI) {
|
||||
params.agent,
|
||||
params.task,
|
||||
params.cwd,
|
||||
params.model,
|
||||
undefined,
|
||||
signal,
|
||||
onUpdate,
|
||||
|
||||
@@ -122,6 +122,7 @@ export async function runSingle(
|
||||
agentName: string,
|
||||
task: string,
|
||||
cwd: string | undefined,
|
||||
modelOverride: string | undefined,
|
||||
step: number | undefined,
|
||||
signal: AbortSignal | undefined,
|
||||
onUpdate: OnUpdateCallback | undefined,
|
||||
@@ -146,8 +147,9 @@ export async function runSingle(
|
||||
};
|
||||
}
|
||||
|
||||
const effectiveModel = modelOverride ?? agent.model;
|
||||
const args: string[] = ["--mode", "json", "-p", "--no-session"];
|
||||
if (agent.model) args.push("--model", agent.model);
|
||||
if (effectiveModel) args.push("--model", effectiveModel);
|
||||
if (agent.tools && agent.tools.length > 0) args.push("--tools", agent.tools.join(","));
|
||||
|
||||
let tmpPromptDir: string | null = null;
|
||||
@@ -161,7 +163,7 @@ export async function runSingle(
|
||||
messages: [],
|
||||
stderr: "",
|
||||
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0, contextTokens: 0, turns: 0 },
|
||||
model: agent.model,
|
||||
model: effectiveModel,
|
||||
step,
|
||||
};
|
||||
|
||||
@@ -324,7 +326,7 @@ export async function runSingle(
|
||||
export interface RunChainOptions {
|
||||
defaultCwd: string;
|
||||
agents: AgentConfig[];
|
||||
steps: { agent: string; task: string; cwd?: string }[];
|
||||
steps: { agent: string; task: string; cwd?: string; model?: string }[];
|
||||
signal: AbortSignal | undefined;
|
||||
onUpdate: OnUpdateCallback | undefined;
|
||||
makeDetails: (results: SingleResult[]) => SubagentDetails;
|
||||
@@ -364,6 +366,7 @@ export async function runChain(opts: RunChainOptions): Promise<SingleResult[]> {
|
||||
step.agent,
|
||||
taskWithContext,
|
||||
step.cwd,
|
||||
step.model,
|
||||
i + 1,
|
||||
signal,
|
||||
chainUpdate,
|
||||
@@ -385,7 +388,7 @@ export async function runChain(opts: RunChainOptions): Promise<SingleResult[]> {
|
||||
export interface RunParallelOptions {
|
||||
defaultCwd: string;
|
||||
agents: AgentConfig[];
|
||||
tasks: { agent: string; task: string; cwd?: string }[];
|
||||
tasks: { agent: string; task: string; cwd?: string; model?: string }[];
|
||||
signal: AbortSignal | undefined;
|
||||
onUpdate: OnUpdateCallback | undefined;
|
||||
makeDetails: (results: SingleResult[]) => SubagentDetails;
|
||||
@@ -406,6 +409,7 @@ export async function runParallel(opts: RunParallelOptions): Promise<SingleResul
|
||||
messages: [],
|
||||
stderr: "",
|
||||
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0, contextTokens: 0, turns: 0 },
|
||||
model: tasks[i].model,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -427,6 +431,7 @@ export async function runParallel(opts: RunParallelOptions): Promise<SingleResul
|
||||
t.agent,
|
||||
t.task,
|
||||
t.cwd,
|
||||
t.model,
|
||||
index + 1,
|
||||
signal,
|
||||
(partial) => {
|
||||
|
||||
Reference in New Issue
Block a user