summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tui_app.zig10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tui_app.zig b/src/tui_app.zig
index 4313556..88c2c66 100644
--- a/src/tui_app.zig
+++ b/src/tui_app.zig
@@ -1947,7 +1947,7 @@ fn handleSubmittedLine(app: *App, term: *Terminal, line: []const u8, opts: RunOp
return;
};
- driveTurn(app, term, opts, .{ .text = line }) catch |err| {
+ driveTurn(app, term, opts, line) catch |err| {
try app.routeError(err);
};
try app.renderNow();
@@ -2025,8 +2025,12 @@ fn tryAdaptiveFallback(app: *App, err: anyerror) bool {
/// component state until it terminates, rendering coalesced frames as deltas
/// arrive. The stream is always `deinit`ed (persisting the turn tail) on every
/// exit path — agent persistence is untouched.
-fn driveTurn(app: *App, term: *Terminal, opts: RunOptions, message: panto.UserMessage) !void {
- var stream = try opts.agent.run(message);
+fn driveTurn(app: *App, term: *Terminal, opts: RunOptions, message_text: []const u8) !void {
+ // Open the turn from a single user text block; `run` adopts the block.
+ var blocks = [_]panto.ContentBlock{
+ .{ .Text = try panto.textualBlockFromSlice(app.alloc, message_text) },
+ };
+ var stream = try opts.agent.run(.{ .blocks = &blocks });
defer stream.deinit();
// Two single-shot fallbacks can re-open the SAME turn (no user-message
// duplication):