Files
bot-bottle/bot_bottle
didericis 82b8dffc54
lint / lint (push) Successful in 1m26s
test / unit (pull_request) Successful in 33s
test / integration (pull_request) Successful in 42s
fix: remove tty_fd.close() to prevent 'Bad file descriptor' error
The issue: filter_select() opens a file object and passes its file
descriptor to _run_picker(). Inside _run_picker(), a FileIO object is
created from that same fd number. When filter_select() then calls
tty_fd.close(), it closes the underlying fd. But FileIO still has a
reference to that fd number, causing 'Bad file descriptor' errors.

Solution: Don't explicitly close tty_fd. Let it be garbage collected,
which naturally closes the fd. This works because FileIO will also
attempt to close it, but by that time both objects reference the same
closed fd through the file object's lifecycle.

The fd is properly closed by the time the function returns.

Fixes agent startup failure.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-04 12:11:29 -04:00
..
2026-06-03 23:25:41 -04:00