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
{{ message }}
Repository navigation
[BUG]: No session-level tracking of which files AI has read before editing #30767
The session runner (packages/core/src/session/runner/llm.ts) and the V1 prompt assembly (packages/opencode/src/session/prompt.ts) have no mechanism to track which files the AI has read.
read.ts has a warm() function but it's only for LSP pre-warming (line 119-120: "LSP warm-up is optional; do not let a background defect fail an otherwise successful read.")
No "read set" is maintained in session state
No tool-level check exists to verify a file was read before editing it
The stale-content check in writeIfUnchanged only catches race conditions between read and edit; it does nothing if the AI never read at all
This means the entire read-before-edit "enforcement" relies solely on the system prompt asking nicely. There's no programmatic guard.
If this is intentionally a narrower/follow-on report (e.g. scoped specifically to the session runner rather than the tool layer), please clarify how it differs from #30376 so maintainers can track it separately.
Activity
github-actions commentedon Jun 4, 2026
This issue might be a duplicate of existing issues. Please check:
instruction.tsalready tracks read files viaextract()/loaded(), but edit/write/apply_patch never use it. The session-level tracking gap described here is addressed in that report.If this is intentionally a narrower/follow-on report (e.g. scoped specifically to the session runner rather than the tool layer), please clarify how it differs from #30376 so maintainers can track it separately.