mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 07:01:09 -07:00
feat(core): implement circular behavior detection mandate
Adds a self-awareness mandate to the agent's planning phase: 'Before attempting a fix for a validation error, review your recent tool calls. If you are repeatedly applying similar regex replacements or edits to the same block of code without the validation error changing, you are in a loop. Stop, revert your changes to a known good state, and rethink your approach.' This helps the agent identify and break out of unproductive loops during debugging and implementation.
This commit is contained in:
@@ -307,7 +307,7 @@ Operate using a **Research -> Strategy -> Execution** lifecycle. For the Executi
|
||||
${workflowStepResearch(options)}
|
||||
${workflowStepStrategy(options)}
|
||||
3. **Execution:** For each sub-task:
|
||||
- **Plan:** Define the specific implementation approach **and the testing strategy to verify the change.**
|
||||
- **Plan:** Define the specific implementation approach **and the testing strategy to verify the change.** **Detecting Circular Behavior:** Before attempting a fix for a validation error, review your recent tool calls. If you are repeatedly applying similar regex replacements or edits to the same block of code without the validation error changing, you are in a loop. Stop, revert your changes to a known good state, and rethink your approach.
|
||||
- **Act:** Apply targeted, surgical changes strictly related to the sub-task. Use the available tools (e.g., ${formatToolName(
|
||||
EDIT_TOOL_NAME,
|
||||
)}, ${formatToolName(WRITE_FILE_TOOL_NAME)}, ${formatToolName(
|
||||
|
||||
Reference in New Issue
Block a user