{% extends "base.html" %} {% block title %}Agent - {{ conversation.title or "Chat" }}{% endblock %} {% block extra_head %} {% endblock %} {% block content %} {% from "_agent_header.html" import agent_header with context %}
{{ agent_header(conversation.title or "Chat", urls.path("/-/agent/" ~ conversation_id ~ "/markdown"), conversation.title or "chat", model_id=conversation.model_id) }}
{% set in_tool_group = namespace(value=false) %} {% for msg in messages %} {% if msg.role == "tool" %} {% if not in_tool_group.value %}
{% set in_tool_group.value = true %} {% endif %} {% set html_content = msg.tool_output | agent_extract_html %} {% set edit_sql_url = msg.tool_output | agent_extract_edit_sql_url %}
{{ msg.tool_name }} {% if msg.tool_output is none %} Waiting {% endif %} {% if msg.tool_arguments is not none %}

Request

{{ msg.tool_arguments | agent_pretty_json }}
{% endif %} {% if msg.tool_output is not none %}

Response

{{ msg.tool_output | agent_pretty_json }}
{% if edit_sql_url and not html_content %} {% endif %}
{% endif %}
{% if html_content %}
{% set in_tool_group.value = false %}
{{ html_content | safe }} {% if edit_sql_url %} {% endif %}
{% set in_tool_group.value = true %} {% endif %} {% else %} {% if in_tool_group.value %}
{% set in_tool_group.value = false %} {% endif %} {% if msg.role == "user" %}
{{ msg.content }}
{% elif msg.role == "assistant" and msg.content|trim %}
{{ msg.content }}
{% elif msg.role == "reasoning" and msg.content %}
Thinking
{{ msg.content }}
{% endif %} {% endif %} {% endfor %} {% if in_tool_group.value %}
{% endif %}
{% if not background_agent %}
{% endif %}
{% if pending_question_json %} {% endif %} {% if pending_tasks_json %} {% endif %} {% if not background_agent %} {% else %} {% endif %} {% endblock %}