Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/core/src/tools/exitPlanMode.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,25 @@ describe('ExitPlanModeTool', () => {
});
});

describe('non-empty plan constraint in descriptions', () => {
it('should mention non-empty constraint in plan parameter description', () => {
const schema = tool.schema as {
parametersJsonSchema: {
properties: { plan: { description: string } };
};
};
expect(schema.parametersJsonSchema.properties.plan.description).toContain(
'empty strings will be rejected',
);
});

it('should mention non-empty constraint in tool description', () => {
expect(tool.schema.description).toContain(
'empty strings will be rejected',
);
});
});

describe('validateToolParams', () => {
it('should accept valid parameters', () => {
const params: ExitPlanModeParams = {
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/tools/exitPlanMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ IMPORTANT: Only use this tool when the task requires planning the implementation
## Before Using This Tool
Ensure your plan is complete and unambiguous:
- If you have unresolved questions about requirements or approach, use AskUserQuestion first (in earlier phases)
- The plan parameter MUST contain your actual plan content — empty strings will be rejected
- Once your plan is finalized, use THIS tool to request approval

**Important:** Do NOT use AskUserQuestion to ask "Is this plan okay?" or "Should I proceed?" - that's exactly what THIS tool does. ExitPlanMode inherently requests user approval of your plan.
Expand All @@ -64,7 +65,7 @@ const exitPlanModeToolSchemaData: FunctionDeclaration = {
plan: {
type: 'string',
description:
'The plan you came up with, that you want to run by the user for approval. Supports markdown. The plan should be pretty concise.',
'The plan you came up with, that you want to run by the user for approval. Supports markdown. The plan should be pretty concise. Must contain your actual plan content — empty strings will be rejected.',
},
originalRequest: {
type: 'string',
Expand Down
Loading