<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="drawio" version="26.0.0">
  <diagram name="Architecture">
    <mxGraphModel dx="1422" dy="794" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1050" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>
        <mxCell id="title" value="Agent 任务执行链路图" style="text;html=1;strokeColor=none;fillColor=none;fontSize=26;fontColor=#263238;fontStyle=1;align=left;verticalAlign=middle;whiteSpace=wrap" vertex="1" parent="1"><mxGeometry x="50" y="25" width="1700" height="42" as="geometry"/></mxCell>
        <mxCell id="s1" value="1&#xa;身份与租户解析" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="70" y="180" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s2" value="2&#xa;创建 / 读取 Chat" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="390" y="180" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s3" value="3&#xa;Dispatcher 路由" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="710" y="180" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s4" value="4&#xa;Ledger 去重 + Trigger" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e8f1fb;strokeColor=#3b82a0;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="1030" y="180" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s5" value="5&#xa;Session acquire + owner guard" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f1eafa;strokeColor=#8064a2;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="1350" y="180" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s10" value="10&#xa;释放 Session" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="70" y="570" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s9" value="9&#xa;保存消息 / 终态 / 用量 / 归档" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e9f5ec;strokeColor=#4f8a5b;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="390" y="570" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s8" value="8&#xa;EventBus / ChatTask / Reply" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="710" y="570" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s7" value="7&#xa;工具调用 / 继续输入" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="1030" y="570" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="s6" value="6&#xa;固化快照 → AgentRunner → query()" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff6d9;strokeColor=#c28b20;fontColor=#263238;fontSize=13;fontStyle=1;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="1350" y="570" width="250" height="90" as="geometry"/></mxCell>
        <mxCell id="top-1" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s1" target="s2"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="top-2" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s2" target="s3"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="top-3" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s3" target="s4"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="top-4" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s4" target="s5"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="turn" value="执行" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.5;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s5" target="s6"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="bottom-6" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0;exitY=0.5;entryX=1;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s6" target="s7"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="bottom-7" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0;exitY=0.5;entryX=1;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s7" target="s8"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="bottom-8" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0;exitY=0.5;entryX=1;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s8" target="s9"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="bottom-9" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0;exitY=0.5;entryX=1;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s9" target="s10"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="model-snapshot" value="Agent 配置 + ModelHandle&#xa;任务入口快照" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fff0df;strokeColor=#c96f2d;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="1320" y="365" width="310" height="75" as="geometry"/></mxCell>
        <mxCell id="snapshot-s6" value="固化" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.75;entryY=0;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="model-snapshot" target="s6"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="cancel" value="取消 / 超时 / 异常" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#fdeaea;strokeColor=#b85450;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="300" y="790" width="250" height="75" as="geometry"/></mxCell>
        <mxCell id="continue" value="运行中输入 / 工具结果" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f1eafa;strokeColor=#8064a2;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="1030" y="790" width="270" height="75" as="geometry"/></mxCell>
        <mxCell id="store" value="Chat / Task / Message / Archive" style="shape=cylinder3;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e9f5ec;strokeColor=#4f8a5b;fontColor=#263238;fontSize=13;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="680" y="790" width="280" height="75" as="geometry"/></mxCell>
        <mxCell id="cancel-s9" value="终态收口" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=0;entryX=0.25;entryY=1;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="cancel" target="s9"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="continue-s7" value="回流" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=0;entryX=0.5;entryY=1;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="continue" target="s7"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="s9-store" value="持久化" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#64748b;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=0;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0;entryY=0.5;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="s9" target="store"><mxGeometry relative="1" as="geometry"></mxGeometry></mxCell>
        <mxCell id="store-s2" value="恢复上下文" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=#8064a2;fontColor=#475569;fontSize=11;strokeWidth=1.5;dashed=1;endArrow=block;endFill=1;exitX=0.5;exitY=1;entryX=0.5;entryY=1;exitDx=0;exitDy=0;entryDx=0;entryDy=0" edge="1" parent="1" source="store" target="s2"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="820" y="900"/><mxPoint x="220" y="900"/><mxPoint x="220" y="350"/><mxPoint x="515" y="350"/></Array></mxGeometry></mxCell>
        <mxCell id="legend-current" value="当前已落地" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#e9f5ec;strokeColor=#4f8a5b;fontColor=#263238;fontSize=12;fontStyle=0;dashed=0;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="50" y="930" width="150" height="36" as="geometry"/></mxCell>
        <mxCell id="legend-planned" value="规划 / 待完善" style="rounded=1;arcSize=8;whiteSpace=wrap;html=1;fillColor=#f1eafa;strokeColor=#8064a2;fontColor=#263238;fontSize=12;fontStyle=0;dashed=1;strokeWidth=1.5;spacing=8;align=center;verticalAlign=middle;shadow=0" vertex="1" parent="1"><mxGeometry x="220" y="930" width="160" height="36" as="geometry"/></mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
