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.
This commit is contained in:
@@ -23,7 +23,7 @@ export default function (pi: ExtensionAPI) {
|
||||
label: "Finish and Exit",
|
||||
description: "Complete a task and exit pi",
|
||||
parameters: Type.Object({}),
|
||||
async execute(_toolCallId, _params, _onUpdate, ctx, _signal) {
|
||||
async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
|
||||
// Do any final work here...
|
||||
// Request graceful shutdown (deferred until agent is idle)
|
||||
ctx.shutdown();
|
||||
@@ -44,7 +44,7 @@ export default function (pi: ExtensionAPI) {
|
||||
parameters: Type.Object({
|
||||
environment: Type.String({ description: "Target environment (e.g., production, staging)" }),
|
||||
}),
|
||||
async execute(_toolCallId, params, onUpdate, ctx, _signal) {
|
||||
async execute(_toolCallId, params, _signal, onUpdate, ctx) {
|
||||
onUpdate?.({ content: [{ type: "text", text: `Deploying to ${params.environment}...` }], details: {} });
|
||||
|
||||
// Example deployment logic
|
||||
|
||||
Reference in New Issue
Block a user