You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Polaris alpha runs concurrent edits and uses the Read/Edit tools against the newly introduced prompt file (packages/opencode/src/session/prompt/polaris.txt), OpenCode incorrectly treats its own prior edits in the same session as an external modification. This triggers the "file has been modified since it was last read" protection and causes legitimate concurrent edits from the same agent/session to be blocked.
Details
Environment: opencode repo, OpenCode v1.0.45, latest dev (after addition of packages/opencode/src/session/prompt/polaris.txt)
Actor: Polaris alpha (OpenCode agent) performing concurrent edits via the Edit tool
Observed behavior:
Polaris reads a file.
Polaris (or its sub-operations) edits the same file as part of the session.
Subsequent parallel edits in the same logical session are rejected with messages like:
"File ... has been modified since it was last read. Please read the file again before modifying it."
This appears even though the only intervening modifications were made by Polaris itself as part of the same workflow.
This effectively creates a race condition / false-positive concurrency conflict for self-induced changes when multiple edits are in flight.
Expected behavior
The modification detection should distinguish between:
Conflicts caused by external writers / other sessions (should be blocked), and
Changes made by the same Polaris/OpenCode session or atomic multi-edit operation (should be allowed or auto-rebased).
Concurrent edits initiated by the same logical session/agent to the same file should not be blocked solely because an earlier step in that session updated the file.
Impact
Breaks multi-step and concurrent edit workflows driven by Polaris/OpenCode.
Forces unnecessary re-reads and manual intervention, and in some cases makes automated refactors/large changes impossible.
Possible direction
Track per-session version IDs or edit tokens so that edits can be validated against a session-aware version, not only the raw mtime/hash.
Allow batched/atomic multi-edit operations where multiple edits share the same read snapshot.
Ensure that edits to internal prompt/config files (e.g. packages/opencode/src/session/prompt/polaris.txt) do not spuriously poison subsequent edits from the same session.
Activity
github-actions commentedon Nov 8, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.