dead code elim
This commit is contained in:
@@ -118,10 +118,6 @@ static bool trim_is_empty(std::string_view s) {
|
||||
while (i < s.size() && (s[i] == ' ' || s[i] == '\n' || s[i] == '\r' || s[i] == '\t')) i++;
|
||||
return i == s.size();
|
||||
}
|
||||
static std::string last_role(Messages &msgs) {
|
||||
if (msgs.items.empty()) return "";
|
||||
return msgs.items.back().role;
|
||||
}
|
||||
|
||||
/* ----------------------------- AL loop -------------------------------- */
|
||||
static int AL(Cfg &cfg, Messages &msgs, Usage &out, volatile int *interrupted, std::string *err) {
|
||||
@@ -280,12 +276,6 @@ static int run_turn(Cfg &cfg, Messages &msgs, Usage &usage, std::string *err, vo
|
||||
*interrupted = 0;
|
||||
usage = Usage{};
|
||||
int rc = AL(cfg, msgs, usage, interrupted, err);
|
||||
if (last_role(msgs) == "tool") {
|
||||
Message cont; cont.role = "user"; cont.content = "continue";
|
||||
msgs.items.push_back(cont);
|
||||
cprint("[auto continue: last message was a tool result]\n", std::array{33});
|
||||
rc = AL(cfg, msgs, usage, interrupted, err);
|
||||
}
|
||||
if (rc != 0) {
|
||||
if (*interrupted) { cprint("\n[interrupted]\n", std::array{33}); }
|
||||
else { cprint("\n[error: ", std::array{31}); cprint((!err || err->empty()) ? "error" : *err, std::array{31}); cprint("]\n", std::array{31}); }
|
||||
|
||||
Reference in New Issue
Block a user