{% extends "base.html" %} {% block title %}{{ session.title or "Chat" }} — OpenClose{% endblock %} {% block nav_extras %}
{% endblock %} {% block content %}

{{ session.title or "Untitled Session" }}

{{ session.agent }}
{% for msg in messages %} {% for segment in msg.segments %}
{% if msg.role == "assistant" %} {% else %}
{{ msg.role }}
{% endif %} {% for part in segment %} {% if part.part_type == "text" %}
{{ part.content }}
{% elif part.part_type == "tool_call" and part.tool_name == "plan" %}
Plan
{% elif part.part_type == "tool_call" %}
{{ part.tool_name }}
{{ part.content }}
{% for other in segment %} {% if other.part_type == "tool_result" and other.tool_call_id == part.tool_call_id %}
{{ other.content }}
{% if other.metadata_json and "subagent_steps" in other.metadata_json %}
Sub-agent steps
{% endif %} {% endif %} {% endfor %}
{% endif %} {% endfor %} {% if loop.last and not segment and msg.content %}
{{ msg.content }}
{% endif %}
{% endfor %} {% endfor %}
{% endblock %}