[PR #9049] fix: handle deleted file references in prompt rerun #12961

Open
opened 2026-02-16 18:17:50 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9049

State: open
Merged: No


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
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9049 **State:** open **Merged:** No --- 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
yindo added the pull-request label 2026-02-16 18:17:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12961