Skip to content

Bash mutations can leave FileTime stale and break same-session edit/write #14183

Closed

Description

@gustavosmendes

Problem

When a session reads a file, then modifies that same file using the bash tool, later edit/write calls in the same session can fail with:

File <path> has been modified since it was last read.

This causes retry loops because the file was changed by the same session, but FileTime remains stale.

Reproduction

  1. Read a file via Read tool.
  2. Modify the file via bash (for example: printf 'new' > file.txt).
  3. Run Edit or Write on that file in the same session.
  4. Observe FileTime.assert() stale-read failure.

Expected behavior

If a file already tracked in the session is changed by bash, the session FileTime should be refreshed so subsequent same-session edits/writes do not fail immediately.

Actual behavior

bash does not update FileTime, so assert() can reject valid same-session follow-up edits/writes.

Notes

This is different from bypassing safety checks globally. The expectation is to preserve read-before-write protection while avoiding false-positive stale-read failures for same-session shell mutations.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Feb 18, 2026
  2. github-actions commented on Apr 20, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions