Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 1b6e1d0

Browse files
authored
fix: handle EOF (#1434)
1 parent 4807899 commit 1b6e1d0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

engine/commands/chat_completion_cmd.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ void ChatCompletionCmd::Exec(const std::string& host, int port,
9797
std::string user_input = std::move(msg);
9898
if (user_input.empty()) {
9999
std::cout << "> ";
100-
std::getline(std::cin, user_input);
100+
if (!std::getline(std::cin, user_input)) {
101+
break;
102+
}
101103
}
102104
if (user_input == kExitChat) {
103105
break;

0 commit comments

Comments
 (0)