{% extends "base.html" %} {% set active_page = "sessions" %} {% block title %}{{ ws.get('summary', session_id) }} - AI Control Plane{% endblock %} {% block head_extra %} {% endblock %} {% block breadcrumb %} {% endblock %} {% block content %}
Session timeline ({{ conversation|length }} events) — click a marker to jump
{% for item in conversation %} {% if item.kind == 'session_start' %}
{{ ts_display(item.timestamp) }}
Session started · {{ 'Claude Code' if source == 'claude' else ('VS Code Chat' if source == 'vscode' else 'Copilot') }} {{ item.version }} {% if item.repo %} · {{ item.repo }}{% endif %} {% if item.branch %} ({{ item.branch }}){% endif %}
{% elif item.kind == 'user_message' %}
{{ ts_display(item.timestamp) }}{% if item.time_spent_waiting_ms %}waited {{ "%.1f"|format(item.time_spent_waiting_ms / 1000) }}s{% endif %}
User{% if item.permission_mode and item.permission_mode != 'default' %}{{ item.permission_mode }}{% endif %}{% if item.agent_mode %}{{ item.agent_mode }}{% endif %}
{{ item.content }}
{% if item.attachments %}
{% for a in item.attachments %} {{ a.type }}: {{ a.name or a.path }} {% endfor %}
{% endif %}
{% elif item.kind == 'assistant_message' %}
{{ ts_display(item.timestamp) }}{% if item.output_tokens %}{{ item.output_tokens }} tokens{% endif %}{% if item.first_progress_ms %}TTFT {{ item.first_progress_ms }}ms{% endif %}{% if item.total_elapsed_ms %}{{ "%.1f"|format(item.total_elapsed_ms / 1000) }}s{% endif %}{% if item.cost_multiplier %}{{ item.cost_multiplier }}{% endif %}
Assistant {% if item.parent_tool_call_id %} (sub-agent response){% endif %} {% if item.stop_reason %}{{ item.stop_reason }}{% endif %}
{% if item.content %}
{{ Markup(md_to_html(item.content)) }}
{% endif %} {% if item.tool_requests %}
Requesting tools: {% for tr in item.tool_requests %}{{ tr.toolName }}{% endfor %}
{% endif %} {% if item.reasoning %}
Show reasoning
{{ item.reasoning }}
{% endif %}
{% elif item.kind == 'tool_start' %} {% set r = item.rendered or {} %}
{{ ts_display(item.timestamp) }}
{% if item.mcp_server %}{{ item.mcp_server }} → {% endif %}{{ item.tool_name }} {% if r.title %}· {{ r.title }}{% endif %}
{% if r.subtitle %}
{{ r.subtitle }}
{% endif %}
{% if r.tool == 'Bash' and r.command %}
{{ r.command }}
{% elif r.tool == 'Edit' %}
{{ r.old_string }}
{{ r.new_string }}
{% if r.replace_all %}
replace_all
{% endif %} {% elif r.tool == 'Write' and r.content %}
{{ r.content }}
{% if r.truncated %}
… truncated ({{ r.lines }} lines)
{% endif %} {% elif r.tool == 'AskUserQuestion' %}
{{ r.question }}
    {% for opt in r.options %}
  • {{ opt }}
  • {% endfor %}
{% elif r.tool == 'TodoWrite' %}
    {% for t in r.todos %}
  • {{ t.get('content', '') }}
  • {% endfor %}
{% else %}
{{ json.dumps(item.arguments, indent=2) }}
{% endif %}
{% elif item.kind == 'tool_complete' %} {% set r = item.rendered or {} %}
{{ ts_display(item.timestamp) }}
{% if item.success %}{% else %}{% endif %} {{ item.tool_name or 'Tool' }}{% if r.title %} · {{ r.title }}{% endif %}
{% if item.images %}
{% for img in item.images %} {{ img.alt }} {% endfor %}
{% endif %}
{% if r.tool == 'Bash' %}
{{ r.output_html|safe }}
{% if r.truncated %}
… truncated
{% endif %} {% elif r.tool == 'Read' and r.content %}
{{ r.content }}
{% if r.truncated %}
… truncated
{% endif %} {% elif r.tool == 'Grep' %}
{{ r.output }}
{% if r.truncated %}
… truncated
{% endif %} {% elif r.tool == 'Glob' %}
    {% for p in r.matches %}
  • {{ p }}
  • {% endfor %}
{% if r.truncated %}
… truncated
{% endif %} {% elif r.tool == 'WebFetch' %} {% if r.url_display %}
{% if r.url %} {{ r.url_display }} {% else %} {{ r.url_display }} {% endif %}
{% endif %}
{{ md_to_html(r.content)|safe }}
{% if r.truncated %}
… truncated
{% endif %} {% elif r.tool == 'WebSearch' %} {% if r.results %}
    {% for hit in r.results %}
  1. {% if hit.url %} {{ hit.title or hit.url_display }} {% else %} {{ hit.title or hit.url_display }} {% endif %}
    {% if hit.snippet %}
    {{ hit.snippet }}
    {% endif %}
  2. {% endfor %}
{% else %}
{{ r.raw }}
{% endif %} {% elif r.tool == 'AskUserQuestion' %}
Answer: {{ r.answer }}
{% else %}
{{ item.result }}
{% endif %}
{% elif item.kind == 'subagent_start' %}
{{ ts_display(item.timestamp) }}
Sub-agent started: {{ item.agent_name }}{% if item.agent_type %} ({{ item.agent_type }}){% endif %} {% if item.agent_prompt or item.transcript %}{% endif %}
{% if item.agent_prompt or item.transcript %}
{% if item.agent_prompt %}
{{ item.agent_prompt }}
{% endif %} {% if item.transcript %}
Inner transcript ({{ item.transcript|length }} events)
{% for inner in item.transcript %} {% if inner.kind == 'user_message' %}
User → {{ inner.content }}
{% elif inner.kind == 'assistant_message' %}
Assistant →
{{ md_to_html(inner.content)|safe }}
{% elif inner.kind == 'tool_start' %}
→ {{ inner.tool_name }}
{% elif inner.kind == 'tool_complete' %}
← {{ 'ok' if inner.success else 'error' }}
{% elif inner.kind == 'slash_command' %}
→ {{ inner.command }} {{ inner.args }}
{% endif %} {% endfor %}
{% endif %}
{% endif %}
{% elif item.kind == 'subagent_complete' %}
{{ ts_display(item.timestamp) }}
Sub-agent completed {% if item.result %}{% endif %}
{% if item.result %}
{{ item.result }}
{% endif %}
{% elif item.kind == 'error' %}
{{ ts_display(item.timestamp) }}
{{ item.message }}
{% elif item.kind == 'warning' %}
{{ ts_display(item.timestamp) }}
{{ item.message }}
{% elif item.kind == 'session_summary' %}
{{ ts_display(item.timestamp) }}
AI-generated session summary
{{ item.content }}
{% elif item.kind == 'model_change' %}
{{ ts_display(item.timestamp) }}
Model changed to {{ item.new_model }}{% if item.reasoning_effort %} (reasoning: {{ item.reasoning_effort }}){% endif %}
{% elif item.kind == 'slash_command' %}
{{ ts_display(item.timestamp) }}
{{ item.command }} {% if item.args %}{{ item.args }}{% endif %}
{% if item.message and item.message != item.command %}
{{ item.message }}
{% endif %} {% if item.stdout %}
stdout
{{ item.stdout }}
{% endif %} {% if item.stderr %}
stderr
{{ item.stderr }}
{% endif %}
{% elif item.kind == 'notification' %}
{{ ts_display(item.timestamp) }}
{{ item.message }}
{% elif item.kind == 'turn_start' %}
── Turn {{ item.turn_id }} ──
{% elif item.kind == 'hook' %}
{{ ts_display(item.timestamp) }}
{{ item.hook_event }}: {{ item.hook_name }}{% if item.command %} → {{ item.command }}{% endif %}
{% elif item.kind == 'file_snapshot' %}
{{ ts_display(item.timestamp) }}
{{ item.file_count }} file{{ 's' if item.file_count != 1 }} tracked: {{ item.files|join(', ') }}{% if item.file_count > 5 %}…{% endif %}
{% elif item.kind == 'last_prompt' %}
{{ ts_display(item.timestamp) }}
Session ended with pending prompt: {{ item.content[:120] }}{% if item.content|length > 120 %}…{% endif %}
{% elif item.kind == 'followups' %}
{% for s in item.suggestions %}{{ s }}{% endfor %}
{% elif item.kind == 'progress_task' %}
{{ item.content }}
{% elif item.kind == 'session_end' %}
{{ ts_display(item.timestamp) }}
Session ended
{% endif %} {% endfor %}
{% endblock %} {% block scripts_extra %} {% endblock %}