feat(core): refine Plan Mode system prompt for agentic execution#18799
feat(core): refine Plan Mode system prompt for agentic execution#18799
Conversation
Summary of ChangesHello @NTaylorMullen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refines the Plan Mode system prompt to enhance the agent's efficiency and autonomy during plan generation. It streamlines the planning workflow by removing conversational phase gates, enforces a stricter output structure for plans, and improves tool parsing, ultimately leading to a more fluid and actionable planning experience. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly refines the Plan Mode system prompt, transitioning from a rigid, phased workflow to a more fluid and autonomous one, with improvements like structured plan output using Markdown checkboxes. A high-severity prompt injection vulnerability was identified where Tool names from external MCP servers are not sanitized before inclusion in the system prompt, potentially allowing attacker manipulation. Additionally, minor inconsistencies in the new prompt text should be addressed for better clarity and LLM interpretation.
c03c784 to
aa453ac
Compare
- Remove rigid conversational phase gates from Plan Mode in favor of fluid discovery and drafting. - Enforce Markdown checkboxes for tracking 'Implementation Steps' based on learnings from Conductor. - Strengthen 'single source of truth' language when an approved plan exists. - Clarify mechanics of presenting the plan and calling the exit tool. - Wrap available tools in an XML tag for better semantic structure. - Clarify that 'enter_plan_mode' should only be used for complex implementation tasks, not answering questions.
… ambiguous requests - Updates 'workflowStepResearch' to replace weak 'consider using' language with a strong 'MUST' directive when a request is ambiguous, broad, or involves creating a new feature/application. - Updates 'planningPhaseSuggestion' (used in new application workflows) to strictly mandate drafting a design document before scaffolding. - Explicitly tells the agent NOT to use Plan Mode for simple inquiries, questions, or straightforward bug fixes to avoid unnecessary plan generation.
…xecution
- Modifies Act Mode execution instructions ('workflowStepStrategy' and 'newApplicationSteps') when an approved plan exists.
- Explicitly mandates that the agent MUST use 'edit' or 'write_file' to check off Markdown checkboxes (e.g., from `- [ ]` to `- [x]`) as steps are completed.
- Ensures the approved plan remains a living document that accurately reflects progress.
…tion phase - Integrates checking off Markdown checkboxes directly into the generic 'Validate' step of the 'Plan -> Act -> Validate' execution loop for any approved plan. - Explictly states that checking off boxes is 'NOT considered tool call overhead' but rather a mandatory step to maintain the single source of truth, combatting prompt compliance biases. - Mandates the same plan tracking requirement in the 'newApplicationSteps' workflow.
- Reverts the requirement to use '- [ ]' checkboxes when creating a plan, instead requesting simple numbered/iterative steps. - Removes the requirement for the agent to check off boxes during the 'Validate' execution loop. - Removes the 'ALWAYS_PASSES' behavioral evaluation enforcing checkbox usage.
…enabled - Simplifies the `newApplicationSteps` instructions by eliminating redundant conversational scaffolding steps when `enableEnterPlanModeTool` is active. - For new applications, the agent is now given a concise 3-step mandate: Plan (using the tool), adhere to design constraints, and Execute using the standard cycle. - Maintains the legacy, full-scaffolding prompt as a fallback for when Plan Mode is globally disabled.
aa453ac to
978116d
Compare
|
Size Change: +1.14 kB (0%) Total Size: 24.3 MB
ℹ️ View Unchanged
|
- Restores instructions for the agent to identify at least two implementation approaches for complex tasks. - Mandates presenting a summary of approaches with pros/cons and a recommendation to the user via `ask_user`. - Maintains the fluid 'Agentic' core while ensuring healthy design-level consultation for non-trivial changes.
Summary
Refines the
Plan Modesystem prompt to make the agent much more fluid and efficient, while simultaneously enforcing a stricter output structure based on learnings from theconductorextension.Details
<available_tools>) for better semantic parsing by the LLM.exit_plan_modetool concurrently.enter_plan_modeshould only be used for complex implementation tasks, not for answering questions or simple inquiries.Related Issues
Closes #18680
Related to #16857
How to Validate
npm run start -- --approval-mode plan) and observe the new system prompt instructions (or useGEMINI_WRITE_SYSTEM_MD=plan.md)..mdplan with actionable checkboxes for implementation steps.Pre-Merge Checklist