opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: handle deleted file references in prompt rerun

Open BNasraoui opened this issue 1 day ago • 1 comments

Fixes #9048 #8807

Summary

  • Add file existence check before calling .stat() on file references
  • Return graceful error message when referenced file is missing
  • Add tests for missing file handling

Before

https://github.com/user-attachments/assets/393a9ba8-b952-4195-8372-e4bc09e502dc

After

https://github.com/user-attachments/assets/2e4b9601-cc0b-47ce-80a8-1b7c0abf6c81

How to replicate

  1. Reference a file
  2. Run the prompt
  3. Delete the file
  4. Press up arrow and rerun
  5. Should see error message instead of crash

BNasraoui avatar Jan 17 '26 08:01 BNasraoui