feat(render): wire table state machine and finalize hook

This commit is contained in:
2026-07-22 12:23:44 -06:00
parent cdfaa0f111
commit bf06d5e8f3
4 changed files with 255 additions and 14 deletions
+15 -5
View File
@@ -368,14 +368,24 @@ impl Session {
for message in &self.messages {
match message.role {
MessageRole::System => {
lines.push(
render
.render(&message.content.render_input(resolve_url_fn, agent_info)),
);
let body = render
.render(&message.content.render_input(resolve_url_fn, agent_info));
let tail = render.finalize();
if tail.is_empty() {
lines.push(body);
} else {
lines.push(format!("{body}\n{tail}"));
}
}
MessageRole::Assistant => {
if let MessageContent::Text(text) = &message.content {
lines.push(render.render(text));
let body = render.render(text);
let tail = render.finalize();
if tail.is_empty() {
lines.push(body);
} else {
lines.push(format!("{body}\n{tail}"));
}
}
lines.push("".into());
}