fix(tui): prevent crash when input is undefined in prompt set
I added defensive checks for the input object in set() and onSelect callbacks. While this specific race condition is hard to reproduce locally, this change directly addresses the undefined error reported in #7528 by ensuring setText is only called on a valid object.
Thanks for your contribution!
This PR doesn't have a linked issue. All PRs must reference an existing issue.
Please:
- Open an issue describing the bug/feature (if one doesn't exist)
- Add
Fixes #<number>orCloses #<number>to this PR description
See CONTRIBUTING.md for details.
The following comment was made by an LLM, it may be inaccurate:
No duplicate PRs found
Unfortunately, this somewhat breaks message forking since the prompt text from the forked message doesn't populate in the input box anymore
this one makes more sense to fix the issue: https://github.com/anomalyco/opencode/pull/7702
Unfortunately, this somewhat breaks message forking since the prompt text from the forked message doesn't populate in the input box anymore
Oh! Thank you! This feedback helps me think about how to improve the code.