Skip to content

The model loops attempting to edit files in PLAN mode #3038

Closed

Description

@agladysh

Most often happens after switch from the BUILD mode, but also sometimes happens when starting new conversation in the PLAN mode from the get go.

Suggestion: expose the edit tool in the PLAN mode, but return a clear admonition text with a reminder to continue planning instead of trying to modify files.

Thinking...

I need to replace the counting logic. Let me replace lines 209-215 with proper logic that groups by directory and counts files correctly.
Plan grok-code (01:37 PM)

Read packages/minimal-cli/src/batch-mode.ts (limit=25, offset=205)

      // Domain objects are already validated during loading
      // Count valid review sets from domain objects

      // If we get here, everything is valid
      for (const reviewSet of reviewSets) {
        validDirs++;

Thinking...

I need to replace the counting logic. Let me replace the section from line 209 to 215 with proper counting that groups by directory.
Plan grok-code (01:37 PM)

Read packages/minimal-cli/src/batch-mode.ts (limit=25, offset=205)

      // Domain objects are already validated during loading
      // Count valid review sets from domain objects

      // If we get here, everything is valid
      for (const reviewSet of reviewSets) {
        validDirs++;

Thinking...

I need to replace the counting logic. Let me replace lines 209-215 with proper logic that groups by directory and counts files correctly.
Plan grok-code (01:37 PM)

Activity

  1. github-actions commented on Oct 8, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The core issue appears to be that models in PLAN mode are attempting to use editing tools they shouldn't have access to, leading to repetitive behavior. Your suggestion to expose the edit tool but return an admonition text is interesting and aligns with similar requests in the linked issues.

    Feel free to ignore if none of these address your specific case.

  2. changed the title [-]The model loops attempting editing files in PLAN mode[/-] [+]The model loops attempting to edit files in PLAN mode[/+] on Oct 8, 2025
  3. rekram1-node commented on Oct 8, 2025

    @rekram1-node
    Collaborator

    i think we may give model an edit tool but only let it alter .md files (maybe .txt too?) not sure yet tho

  4. agladysh commented on Oct 8, 2025

    @agladysh
    Author

    For my workflows that would not work, because I often plan for writing documents — and then write them in the BUILD mode. If you would allow editing in PLAN mode, then please make it configurable, so I could turn it off

  5. rekram1-node commented on Oct 8, 2025

    @rekram1-node
    Collaborator

    already is fully configurable you can do endless modifications

    I guess I misread your initial comment, are you suggesting that we should start giving it an edit tool and tell it not to use it more clearly instead of the curretn setup (no edit tool)?

  6. agladysh commented on Oct 8, 2025

    @agladysh
    Author

    Yes. Honeytrap it. Its urge to change files is unstoppable otherwise — it would find a hole (e.g. it also tries to run sed -i, git checkout etc. if it realizes edit does not work, etc. — and comes to sense immediately when slapped on the wrist)

  7. rekram1-node commented on Oct 8, 2025

    @rekram1-node
    Collaborator

    Interesting idea, will probably play with that in future, rn we try to just use the permissions model so you can deny these poor attempts and then tell it not to but ofc this ux as you've found isn't perfect.

    Thanks for suggestion!

  8. guyvdb commented on Oct 8, 2025

    @guyvdb

    My workflow is plan -> write .md of plan -> review/edit plan manually -> execute plan.

    It is sometimes frustrating that when I switch to BUILD to write the plan to disk, telling agent "only write plan DO NOT START CODING", it ignores and starts coding before I have had a chance to review/edit. So having the PLAN able to write .md/.txt would be great for me.

  9. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions