Skip to content

bug: track externally modified files - Incorrect detection of external file modifications  #1889

@dariuszkowalski-com

Description

@dariuszkowalski-com

Description

The feature to track externally modified files, introduced in Forge v1.4.0 via PR #1740, incorrectly flags files as externally modified, even when no external changes occurred.

Current Behavior

Notifications about file modifications are added to the internal conversation structure (XML/JSON format). When one file is edited externally, it is not marked as modified. Additionally, when Forge reads a file (e.g., via a tool call), it is subsequently flagged as externally modified, cluttering the context window with irrelevant warnings.

Example XML for all files marked modified (only index.html was edited / all read):

<information>
<critical>The following files have been modified externally. Please re-read them if its relevant for the task.</critical>
<files>
<file>/home/dkowalski/projekty/tetris/index.html</file>
<file>/home/dkowalski/projekty/tetris/script.js</file>
<file>/home/dkowalski/projekty/tetris/style.css</file>
</files>
</information>

Example after reading style.css:

  • Tool call reads lines 79-84 of style.css.
  • Subsequent XML:
<information>
<critical>The following files have been modified externally. Please re-read them if its relevant for the task.</critical>
<files>
<file>/home/dkowalski/projekty/tetris/style.css</file>
</files>
</information>

Expected Behavior

The feature should detect only actual external modifications (e.g., edits outside Forge). Read files by Forge tools should not be flagged as externally modified, and warnings should target only truly changed files to avoid context pollution.

Steps to Reproduce

  1. Download and install Forge v1.4.0
  2. Navigate to a project directory (e.g., /home/dkowalski/projekty/tetris) with multiple files (index.html, script.js, style.css).
  3. Start Forge in interactive mode: forge.
  4. Edit one file externally (e.g., modify index.html in another editor and save).
  5. Resume interaction in Forge and perform a task; observe all files listed as externally modified in internal structure (check via dump --html).
  6. Ask a question requiring file read ; observe the read file flagged as externally modified post-read.

Environment

  • Forge Version: 1.4.0
  • OS: Ubuntu 24

Screenshots/Logs

2025-11-11_14-35-00-dump.html

Additional Context

This issue disrupts workflow by unnecessarily prompting re-reads and inflating context. No workarounds identified. Related to recent release including PR #1740 on November 9, 2025.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions