mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
Add new CompletePlan function with schema and validation to allow agents to explicitly signal when all execution steps are done. Update system prompt to include completion confirmation step. Refactor execution loop to recursively prompt for completion if incomplete, with MAX_EXECUTION_DEPTH limit replacing MAX_PLANNING_ITERATIONS. Remove automatic incomplete execution handling in favor of explicit agent-driven completion.
31 lines
No EOL
1.1 KiB
TypeScript
31 lines
No EOL
1.1 KiB
TypeScript
import { AIFunction } from "Enums/AIFunction";
|
|
import type { IAIFunctionDefinition } from "../IAIFunctionDefinition";
|
|
|
|
export const CompletePlan: IAIFunctionDefinition = {
|
|
name: AIFunction.CompletePlan,
|
|
description: `Marks the current execution plan as fully completed.
|
|
|
|
Use this function when all steps in the plan have been successfully executed and
|
|
the original goal has been achieved.
|
|
|
|
Call this function:
|
|
- After the final step in the plan has been completed successfully
|
|
- When all plan objectives have been fully satisfied
|
|
- Before providing the user with a completion summary
|
|
|
|
Do NOT use this function:
|
|
- While there are still pending steps to execute
|
|
- If any critical steps failed or were skipped
|
|
- If the plan was modified and needs replanning`,
|
|
parameters: {
|
|
type: "object",
|
|
properties: {
|
|
confirm_completion: {
|
|
type: "boolean",
|
|
description: "Safety flag that must be explicitly set to true to confirm the completion is intentional. This prevents accidental plan completions.",
|
|
default: false
|
|
}
|
|
},
|
|
required: ["confirm_completion"]
|
|
}
|
|
} |