@@ -99,6 +99,7 @@ const Tui = struct {
9999 reasoning_bytes: usize = 0,
100100 active: bool = false,
101101 paused: bool = false,
102+ retry: bool = false,
102103 pause_requested: std.atomic.Value(bool) = std.atomic.Value(bool).init(false),
103104 aborting: bool = false,
104105 turn_done: std.atomic.Value(bool) = std.atomic.Value(bool).init(false),
@@ -251,6 +252,9 @@ const Tui = struct {
251252 if (self.active and self.pause_requested.load(.seq_cst)) {
252253 return std.fmt.allocPrint(self.s, "{s} · {s}", .{ styles.comment(self.s, "pausing - waiting for the step boundary"), info }) catch info;
253254 }
255+ if (self.retry) {
256+ return std.fmt.allocPrint(self.s, "{s} · {s}", .{ styles.err(self.s, "failed - Enter to retry"), info }) catch info;
257+ }
254258 if (!self.active or self.phase == .idle) return info;
255259 const elapsed = @max(0, @divFloor(time.nowMs() - self.turn_start, 1000));
256260 return std.fmt.allocPrint(self.s, "{s} {s} · {s} · {s}", .{
@@ -437,6 +441,7 @@ const Tui = struct {
437441 .tool_result => |tr| self.commitToolResult(tr.name, tr.text, tr.is_error, tr.diffs, tr.body, tr.images),
438442 .err => |m| {
439443 self.reportStatus("error", null, m);
444+ self.retry = true;
440445 self.endTurn(styles.err(self.s, std.fmt.allocPrint(self.s, "! {s}", .{m}) catch "! error"));
441446 },
442447 .no_model => {
@@ -725,7 +730,10 @@ const Tui = struct {
725730 return;
726731 }
727732 if (self.command_active) return;
728- if (std.mem.trim(u8, text, " \t\r\n").len == 0) return;
733+ if (std.mem.trim(u8, text, " \t\r\n").len == 0) {
734+ self.retryTurn();
735+ return;
736+ }
729737 if (commands.findCommand(text)) |found| {
730738 self.editor.clear();
731739 self.runCommand(found);
@@ -750,8 +758,15 @@ const Tui = struct {
750758 self.startTurn();
751759 }
752760
761+ fn retryTurn(self: *Tui) void {
762+ if (!self.retry or self.active) return;
763+ self.note(styles.comment(self.s, "retrying"));
764+ self.startTurn();
765+ }
766+
753767 fn startTurn(self: *Tui) void {
754768 self.active = true;
769+ self.retry = false;
755770 self.abort.store(false, .seq_cst);
756771 self.pause_requested.store(false, .seq_cst);
757772 self.turn_done.store(false, .seq_cst);
@@ -794,7 +809,7 @@ const Tui = struct {
794809
795810 fn showHelp(self: *Tui) void {
796811 const keys = [_][2][]const u8{
797- .{ "Enter", "submit" },
812+ .{ "Enter", "submit; on an empty draft after a failure, retry it" },
798813 .{ "Shift+Enter", "newline (Ctrl+J also works)" },
799814 .{ "Shift+Up/Down", "walk input history (Ctrl+R to search)" },
800815 .{ "Esc", "pause the turn at the next step boundary" },
@@ -832,6 +847,7 @@ const Tui = struct {
832847 self.keepName(&self.detail, null);
833848 self.keepName(&self.writing_tool, null);
834849 self.steering_text = "";
850+ self.retry = false;
835851 self.phase = .idle;
836852 self.stream_kind = .none;
837853 _ = self.calls.reset(.retain_capacity);