diff --git a/packages/core/src/tools/exitPlanMode.test.ts b/packages/core/src/tools/exitPlanMode.test.ts index fa592544cef..39f19babe97 100644 --- a/packages/core/src/tools/exitPlanMode.test.ts +++ b/packages/core/src/tools/exitPlanMode.test.ts @@ -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 = { diff --git a/packages/core/src/tools/exitPlanMode.ts b/packages/core/src/tools/exitPlanMode.ts index 32aeb2d7989..689b09b426f 100644 --- a/packages/core/src/tools/exitPlanMode.ts +++ b/packages/core/src/tools/exitPlanMode.ts @@ -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. @@ -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',