乐于分享
好东西不私藏

DeerFlow源码解析--ThreadState 详解

DeerFlow源码解析--ThreadState 详解

ThreadState 详解

ThreadState 是 DeerFlow 代理系统在 LangGraph 图中流转的核心状态容器。定义在 backend/packages/harness/deerflow/agents/thread_state.py:111,继承自 langchain 的 AgentState。它一共 11 个字段(3 继承 + 8 新增),贯穿代理运行的整个生命周期。

全貌

AgentState
├─ messages           Required  add_messages reducer       ← LangGraph 对话核心
├─ jump_to            NotRequired  Ephemeral (不持久化)     ← 图内控制流跳转
└─ structured_response  NotRequired  OmitFromInput         ← 类型化输出扩展点

ThreadState (extends AgentState)
├─ sandbox            merge_sandbox reducer     ← 代码执行沙箱
├─ thread_data        NotRequired               ← 文件系统路径映射
├─ title              NotRequired               ← 线程标题
├─ artifacts          merge_artifacts reducer   ← 输出文件累积
├─ todos              merge_todos reducer       ← Plan 模式任务列表
├─ uploaded_files     NotRequired               ← 当前消息上传文件
├─ viewed_images      merge_viewed_images reducer ← LLM 视觉图片缓存
└─ promoted           merge_promoted reducer    ← 延迟工具激活白名单

一、继承字段(来自 AgentState)

1. messages — Required,add_messages reducer

messages: Required[Annotated[list[AnyMessage], add_messages]]
维度
详情
含义
对话历史的完整消息通道
更新时机
图执行的每一步都在追加——模型输出 → AIMessage 追加,工具调用 → ToolMessage 追加,用户输入 → HumanMessage 追加
写入者
LangGraph 引擎(model_nodetools_node 自动追加)
读取者
所有中间件、所有模型调用、checkpointer(持久化)
初始值[]
设计要点add_messages
 不是简单的 list.append,而是处理 ID 去重、tool_call/tool_result 配对、同名消息合并的语义级 reducer。这是 LangGraph agent loop 最底层的轮子

2. jump_to — EphemeralValue + PrivateStateAttr

jump_to: NotRequired[Annotated[JumpTo | None, EphemeralValue, PrivateStateAttr]]
维度
详情
含义
当前 step 内的控制流跳转指令——"跳过后续节点,直接跳到 X"
更新时机after_model
 阶段,TodoMiddleware 检测到模型想提前退出但还有未完成任务时
写入者TodoMiddleware.after_model
读取者
LangGraph 引擎(Pregel 循环检测到 jump_to 后修改下一个节点路由)
初始值None
为什么 Ephemeral
标注 EphemeralValue → 不持久化到 checkpointer。因为跳转只对「当前 step」有效,下次恢复线程时不应该继续跳
为什么 PrivateStateAttr
标注 OmitFromSchema(input=True, output=True) → API 的 state 读写操作中不可见,纯引擎内部调度字段

更新示例:

# TodoMiddleware.after_model
if unfinished_todos andnot has_tool_calls:
return {"jump_to""model"}  # 强制回到模型节点继续执行

3. structured_response — OmitFromInput

structured_response: NotRequired[Annotated[ResponseT, OmitFromInput]]
维度
详情
含义
结构化输出模式下的类型化响应。仅在 bind_tools(strict=True) + Pydantic schema 模式下使用
更新时机
模型输出被解析为类型化结果时,由 LangChain 内置逻辑写入
写入者
LangChain 引擎(结构化输出解析后)
初始值None
设计要点OmitFromInput
 不出现在下一次模型调用的 state schema 中——它是输出产物,不是输入参数
现状
DeerFlow 主要使用自由对话模式,这个字段在代码中几乎不使用,但保留作为扩展点

二、sandbox — 代码执行沙箱

classSandboxState(TypedDict):
    sandbox_id: NotRequired[str | None]

sandbox: Annotated[NotRequired[SandboxState | None], merge_sandbox]

字段含义

沙箱是代理执行 bash/Python 等代码的隔离环境sandbox 状态追踪当前线程绑定的沙箱实例 ID。

Reducer 语义:merge_sandbox

defmerge_sandbox(existing, new):
if new isNone:  return existing          # 没有新信息,不动
if existing isNone:  return new           # 首次写入
if existing_id == new_id:  return existing # 幂等——同一沙箱多写
raise ValueError(...)                      # 冲突——不同沙箱 ID,fail-closed

为什么是"冲突抛错"而不是"选一个"?
多个工具并发惰性初始化沙箱,理论上它们都拿到同一个 sandbox_id——这是幂等情况。如果出现不同 ID,说明沙箱生命周期/隔离出 bug,静默选择一个会掩盖严重问题,所以故意 fail-closed。

更新时序

线程首次启动
  │
  ├─ before_agent  ─── SandboxMiddleware(eager 模式)
  │   创建沙箱 → 写入 {"sandbox": {"sandbox_id": "sbox_abc123"}}
  │
  ├─ [模型多轮对话]
  │   │
  │   ├─ wrap_tool_call  ─── SandboxMiddleware(lazy 模式)
  │   │   检测到 sandbox 为 None → 创建沙箱
  │   │   → 写入 Command(update={"sandbox": {"sandbox_id": "sbox_abc123"}})
  │   │
  │   └─ wrap_tool_call  ─── ToolOutputBudgetMiddleware(读取)
  │       读取 sandbox → 用于外部化大工具输出
  │
  └─ after_agent  ─── SandboxMiddleware(读取后释放)
      读取 sandbox_id → provider.release(sandbox_id)
      注意:释放沙箱资源,但不清除 state 中的 sandbox 字段
钩子
操作
before_agent写入
(eager 模式创建沙箱)
SandboxMiddleware
wrap_tool_call写入
(lazy 模式延迟创建)
SandboxMiddleware
wrap_tool_call读取
(外部化工具输出)
ToolOutputBudgetMiddleware
after_agent读取
(释放沙箱资源)
SandboxMiddleware
工具内部
读取
(子 agent 传递沙箱)
task_tool
、sandbox 工具辅助函数

三、thread_data — 文件系统路径映射

classThreadDataState(TypedDict):
    workspace_path: NotRequired[str | None]  # 工作目录
    uploads_path: NotRequired[str | None]     # 上传文件目录
    outputs_path: NotRequired[str | None]     # 输出文件目录

thread_data: NotRequired[ThreadDataState | None]

字段含义

代理和 LLM 通过虚拟路径(如 /mnt/user-data/workspace)引用文件,而工具需要真实的主机路径来执行指令。thread_data 就是这张映射表,每个线程有独立的工作区。

设计要点

  • • 无 reducer:每次 before_agent 全量覆盖写入,因为每个线程的路径是确定的,不存在并发写入冲突。
  • • 最先执行ThreadDataMiddleware 在中间件链中排第 0 位,确保后续所有工具和中间件都能读取到路径。
  • • 线程隔离:不同线程(对话)有独立的 workspace/upload/output 目录。

更新时序

线程每次 agent run 启动
  │
  └─ before_agent  ─── ThreadDataMiddleware(第0位)
      计算三个路径 → 写入 {"thread_data": {"workspace_path": "...", ...}}

贯穿整个 agent run
  │
  ├─ wrap_tool_call  ─── ToolOutputBudgetMiddleware(读取 outputs_path)
  ├─ 工具内部  ─── present_file_tool(读取 outputs_path 做路径校验)
  ├─ 工具内部  ─── view_image_tool(读取 outputs_path 做路径掩码)
  ├─ 工具内部  ─── task_tool(读取后传给子 agent)
  └─ 工具内部  ─── sandbox/tools.py 各 helper 函数
钩子
操作
before_agent写入
(全量覆盖)
ThreadDataMiddleware
wrap_tool_call读取
(输出外部化)
ToolOutputBudgetMiddleware
工具调用时
读取
(路径校验/映射)
present_file_tool、view_image_tool、task_tool 等

四、title — 线程标题

title: NotRequired[str | None]

字段含义

由 LLM 自动生成的对话标题,显示在对话列表、搜索等 UI 中。用户也可通过 API 手动覆盖。

更新时序

首轮用户消息 → 模型回复 → after_model 触发
  │
  ├─ 检查条件:
  │  1. title 当前为 None(未生成过)
  │  2. 配置启用标题生成
  │  3. 已有 1 条用户消息 + ≥1 条助手消息
  │
  └─ 条件满足 → TitleMiddleware.after_model
      调用 LLM 异步生成标题
      → 返回 {"title": "如何使用 Python 生成报表"}
钩子
操作
after_model条件写入
(仅在 title 为空时)
TitleMiddleware
after_model读取
(判断是否需要生成)
TitleMiddleware._should_generate_title

关键行为:一旦 title 存在,永不再生成。用户通过 PATCH /{thread_id}/state 手动修改 title 后,也会同步到 ThreadMetaStore,确保搜索立即可见。


五、artifacts — 输出文件累积

artifacts: Annotated[list[str], merge_artifacts]

Reducer 语义

defmerge_artifacts(existing, new):
if existing isNonereturn new or []
if new isNonereturn existing
returnlist(dict.fromkeys(existing + new))  # 合并去重,existing 在前

字段含义

代理在对话中生成的产出文件路径列表(HTML、图片、报告等)。累积式收集——每次 present_files 工具调用追加新路径,不会覆盖旧路径。

更新时序

模型调用 present_files 工具
  │
  └─ wrap_tool_call  ─── present_files 工具执行
      标准化文件路径 → 追加到 artifacts
      → Command(update={"artifacts": ["report.html", "chart.png"]})

      注意:不直接追加到旧列表,而是发一个新列表
      merge_artifacts reducer 自动合并去重
钩子
操作
工具调用
写入
(追加新文件路径)
present_file_tool
无中间件读取
前端直接通过 stream values 事件消费

为什么用 reducer?
同一 graph step 可能并发调用多次 present_files,每个都有自己的输出——reducer 确保不丢文件。

设计问答:如果 artifacts 不用 Reducer 会怎样?

会丢文件,而且是静默丢失。

原因出在 LangGraph 的并行工具执行。present_file_tool 每次被调用时,它只知道自己要输出的文件,不知道别的并行工具也在输出文件:

# present_file_tool 的典型调用
Command(update={"artifacts": ["report.html"]})

如果 artifacts 是普通字段(无 reducer),同一 graph step 中两个并行的 present_files 调用会互相覆盖:

同一 step,模型并行调用两个 present_files:

Tool A: Command(update={"artifacts": ["report.html"]})
Tool B: Command(update={"artifacts": ["chart.png"]})

无 reducer → 两次写入都是全量覆盖
write(artifacts=["report.html"])  →  artifacts = ["report.html"]
write(artifacts=["chart.png"])    →  artifacts = ["chart.png"]  ← 上一个被吞了
最终 artifacts = ["chart.png"]    → report.html 永远丢了

有 reducer → 每次追加,累积合并:

merge_artifacts(None, ["report.html"]) → ["report.html"]
merge_artifacts(["report.html"], ["chart.png"]) → ["report.html", "chart.png"]
最终 artifacts = ["report.html", "chart.png"]  ✓

更阴险的是这个问题在单工具调用场景下完全不可见——只在并发工具调用时才出现。而且前端不会报任何错,用户只会发现"生成的文件少了"。

本质原因:LangGraph 的 Command(update={}) 对普通字段是全量覆盖,不是合并。Reducer 是 LangGraph 提供给你自定义"怎么合并"的机制。没有 reducer,就是最后写入者胜出。


六、todos — Plan 模式任务列表

todos: Annotated[list | None, merge_todos]

Reducer 语义

defmerge_todos(existing, new):
if new isNonereturn existing    # 没碰 todos,保持原样
return new                          # 显式写入(即使是空列表),全量替换

为什么是全量替换而不是增量合并?
LLM 通过 write_todos 工具一次性写入完整列表——它不是追加"完成了一个任务",而是"现在任务列表是这个"。语义上就是全量替换。

字段含义

Plan 模式下,LLM 自主通过 write_todos 工具管理待办事项。仅在 plan_mode=True 时激活。

更新时序

Plan 模式下的 agent run

before_agent
  └─ 清理之前运行残留的 completion_reminders

before_model(每轮 LLM 调用前)
  ├─ 检查:todos 中有未完成任务 AND write_todos 调用已滚出上下文
  └─ 是 → 注入 todo_reminder 消息提醒模型

after_model(每轮 LLM 回复后)
  ├─ LLM 调用了 write_todos → TodoListMiddleware(父类)拦截
  │   → 解析参数 → 写入 {"todos": [...]}
  │
  └─ LLM 想结束对话但还有未完成任务
      → 注入完成提醒 → 写入 {"jump_to": "model"} 强制回去

after_agent
  └─ 清理当前运行的 completion_reminders
钩子
操作
before_agent
(清理之前提醒)
TodoMiddleware
before_model
(上下文丢失检测)
TodoMiddleware
after_model读 + 写
(退出拦截 + 任务更新)
TodoMiddleware + TodoListMiddleware
after_agent
(清理当前提醒)
TodoMiddleware

七、uploaded_files — 当前消息上传文件

uploaded_files: NotRequired[list[dict] | None]

字段含义

当前消息中用户上传的文件元数据列表(路径、名称、大小、MIME 类型)。不是累积列表——每次新的 agent run 覆盖写入。

更新时序

用户发送带文件的消息
  │
  └─ before_agent  ─── UploadsMiddleware
      从 HumanMessage.additional_kwargs.files 提取
      → 写入 {"uploaded_files": [
          {"path": "/.../report.pdf", "name": "report.pdf", ...}
        ]}
      同时格式化后注入到消息内容(<uploaded_files> 块)
钩子
操作
before_agent写入
(从当前消息提取)
UploadsMiddleware
记忆处理
(记忆持久化前剥离 <uploaded_files> 块)
memory/message_processing.py

设计注意uploaded_files 只存当前消息的新文件。历史文件通过扫描 uploads 目录获取,不写入此字段。

设计问答:为什么是 NotRequired 而不是带 Reducer 的 Annotated?

因为 uploaded_files只有单一写入者,且在单一时刻写入一次

before_agent  →  UploadsMiddleware  →  写入 uploaded_files
                          ↓
                   只运行一次,非并发

整个 agent run 生命周期中,只有 UploadsMiddleware.before_agent 会写 uploaded_files。不是从工具并发写入的,不存在多写入者互相覆盖的问题。

语义是"当前消息的文件",不是"累积历史" —— 这是关键:

用户消息1:上传了 report.pdf  → uploaded_files = [report.pdf]
用户消息2:上传了 chart.png   → uploaded_files = [chart.png]    ← 覆盖,不累积

如果用带 reducer 的累积合并(像 artifacts 那样),会发生:

merge 行为 → uploaded_files = [report.pdf, chart.png]
→ 前端会认为用户当前消息上传了两个文件,而实际上第二个消息没有 report.pdf
→ 历史文件信息通过扫描 uploads 目录获取,不应该混在这个字段里

所以不用 reducer 是对的 —— 每次覆盖恰好表达了"当前消息的文件"这个语义。

为什么是 NotRequired 而不是 Required? 新线程启动时没有上传文件 → None。不是每条消息都有附件 → NoneNotRequired 精确表达了"这个字段可能不存在"的语义。如果设为 Required,每个新线程初始时都必须显式设为空列表,增加无意义的默认值维护成本。

什么时候需要改成 Annotated + Reducer? 当且仅当出现多个中间件或工具需要在同一 agent run 中并发写入上传文件信息时。当前架构中不存在这种情况——uploads 是一个单一职责的中间件。如果未来架构变了,再加 reducer 也不迟:NotRequired 到 Annotated 的迁移是向后兼容的。


八、viewed_images — LLM 视觉图片缓存

classViewedImageData(TypedDict):
    base64: str# base64 编码的图像数据
    mime_type: str# 如 "image/png"

viewed_images: Annotated[dict[str, ViewedImageData], merge_viewed_images]

Reducer 语义

defmerge_viewed_images(existing, new):
if existing isNone:  return new or {}
if new isNone:  return existing
iflen(new) == 0:  return {}          # 空字典 = 清空缓存!
return {**existing, **new}             # 合并,新值覆盖同路径

巧妙的"脏标记"设计:空字典 {} 不是"无变化",而是**"全部清除"**。ViewImageMiddleware 在成功将图片注入 LLM 上下文后,通过 Command(update={"viewed_images": {}}) 清空缓存,防止下一轮调用重复看到同一批图片。

字段含义

代理调用 view_image 工具"看"图片时,工具将图片 base64 编码后缓存到这里。中间件在 LLM 调用前检测到有缓存图片,注入含图片数据的 HumanMessage,让多模态 LLM 真正"看到"图片。

更新时序

LLM 调用 view_image("/path/to/chart.png")
  │
  └─ wrap_tool_call  ─── view_image_tool
      读取图片 → base64 编码 → 写入 viewed_images
      → Command(update={
            "viewed_images": {"/path/to/chart.png": {"base64": "...", "mime_type": "image/png"}}
        })

下一轮 before_model
  │
  ├─ ViewImageMiddleware 检测到 viewed_images 非空
  ├─ 检查消息中是否已有 "Here are the images you've viewed" 标记 → 避免重复注入
  ├─ 构建含 base64 图片数据的 HumanMessage → 注入到消息列表
  └─ 注入完成后 → Command(update={"viewed_images": {}})  ← 清空缓存
钩子
操作
工具调用
写入
(缓存图片 base64)
view_image_tool
before_model读 + 写(清空)
ViewImageMiddleware

限制

  • • 单张图片 ≤ 20 MiB
  • • 仅允许访问 /mnt/user-data/workspace/mnt/user-data/uploads/mnt/user-data/outputs 下的图片
  • • 仅在 feat.vision is not False 时生效

设计问答:用空字典 {} 表示"清空"是否是一个好的设计?

是务实的设计,但不是优雅的设计。

好在哪

零额外开销。 不需要新字段、不需要 sentinel 对象、不需要改动数据结构。一行判断搞定:

iflen(new) == 0:
return {}

语义在 reducer 内部完全自洽。 读取 state 的代码(ViewImageMiddleware.before_model)只需要 state.get("viewed_images") —— 它不需要知道"清空"的特殊语义,因为清空前它已经读取完数据了,清空后它拿到空字典也正确(没有图片可注入)。

糟在哪

隐式约定。 只看类型定义的人,永远不知道 {} 和 {"a": ...} 有完全不同的语义差异。写工具代码的人可能无意中传入空字典,触发非预期的"清空":

# 某天有人写了类似的工具:
defsome_new_image_tool(...):
    images = load_images()  # 返回空字典因为没找到图片
return Command(update={"viewed_images": images})  # 意外清空了已有缓存!

虽然当前代码没有这个问题(只有 view_image_tool 写入,且 ViewImageMiddleware 写入 {} 是显式的),但这种隐式约定是潜在的 bug 来源。

有什么更好的替代方案?

方案 A:sentinel 对象

_CLEAR = object()

defmerge_viewed_images(existing, new):
if new is _CLEAR:
return {}
    ...

语义清晰明确。但 _CLEAR 需要放进 Command(update={}) 并经过 checkpointer 序列化(pickle/json)—— 自定义 object 在序列化/反序列化后身份可能丢失,导致 new is _CLEAR 失效。

方案 B:独立 boolean channel

viewed_images: Annotated[dict, merge_viewed_images]
_clear_viewed_images: Annotated[bool, ...]   # 独立的"脏标记" channel

语义清晰,两个字段各司其职。但增加了复杂度:两个字段需要协调—— before_model 读完 viewed_images 后设置 _clear_viewed_images = True,下一个 reducer 检测到后清空。

方案 C:不清空,靠消息标记防重复

ViewImageMiddleware 已经在检查"图片是否已经注入过"(_should_inject_image_message 遍历消息找标记)。可以完全不使用 {} 清空,纯靠这个检查防止重复注入。

但问题在于:base64 图片数据会持久化到 checkpointer。一张图片几百 KB 的 base64 存在 checkpoint 里,线程关闭再打开还在——这是不必要的数据膨胀。

结论

当前设计是一个工程权衡:牺牲一点语义纯粹性,换取零额外复杂度的数据清理。评分 7/10 —— 能用,文档写清楚了,但不够自解释。如果要改进,倾向方案 C + 不回写 viewed_images 到 checkpointer(如果 LangGraph 支持某字段不持久化的话),但从目前 LangGraph 的机制来看做不到这一点。

核心洞察:当前设计本质上是一个"用完即弃"的内存标记 —— 使用 {} 清空是为了在正确的时刻把它从持久化状态中删掉,避免 base64 图片数据污染 checkpoint 存储。


九、promoted — 延迟工具激活白名单

classPromotedTools(TypedDict):
    catalog_hash: str# 工具目录 SHA256 前16位
    names: list[str]      # 已激活的工具名称

promoted: Annotated[PromotedTools | None, merge_promoted]

字段含义

MCP 工具数量可能上百,全部暴露给 LLM 会炸上下文窗口 + 引发幻觉调用。解决思路:MCP 工具默认"延迟"(deferred),只暴露名字不暴露 schema。LLM 必须通过 tool_search 工具主动查询后,该工具才被"promote"(激活),后续可见可调用。

Reducer 语义

defmerge_promoted(existing, new):
ifnot new:  return existing                      # 没新查询,不动
if existing isNoneor hash_mismatch:              # 首次 或 catalog 已过期
return {"catalog_hash": new["catalog_hash"],
"names"list(dict.fromkeys(new["names"]))}    # 全量替换
# hash 相同 → 同类 catalog → 累积合并
return {"catalog_hash": existing["catalog_hash"],
"names"list(dict.fromkeys(existing["names"] + new["names"]))}

catalog_hash 的安全价值

场景——checkpointer 恢复时的"僵尸工具"问题

  1. 1. 线程 A 激活了 send_email → promoted: {catalog_hash: "abc123", names: ["send_email"]} → 持久化
  2. 2. 用户关闭线程,MCP 配置更新,send_email 变成了不同的实现
  3. 3. 用户重新打开线程,checkpointer 恢复 → promoted.names 里还躺着 "send_email"
  4. 4. 如果没 hash 校验 → _promoted() 直接放行这个"已改名"的工具
  5. 5. 有 hash 校验 → 恢复时的 catalog_hash 与当前不匹配 → _promoted() 返回空集 → 工具重新被过滤

更新时序

LLM 决定查找工具:tool_search("github")
  │
  └─ wrap_tool_call  ─── tool_search 工具
      查询匹配 → 返回结果 + 写入 promoted
      → Command(update={
            "promoted": {"catalog_hash": "abc123...", "names": ["github_search_repos", "github_create_issue"]}
        })

下一轮 before_model 和 wrap_model_call
  │
  ├─ DeferredToolFilterMiddleware._promoted(state) 读取 promoted
  │   → hash 匹配 → 返回激活工具名集合
  │
  ├─ _hidden(state) → 所有 deferred 工具 - 已激活工具 = 仍需隐藏的
  │
  ├─ wrap_model_call → 从 bind_tools 中移除隐藏工具的 schema
  │   LLM 现在能看到 github_search_repos 和 github_create_issue 的完整 schema ✓
  │
  └─ wrap_tool_call → 如果有人试图直接调用未激活的工具
      → 返回错误 ToolMessage: "Tool 'X' is deferred. Call tool_search first"

双重防线

  • • 第一道(before_model):LLM 根本看不到未激活工具的 schema,正常不会调用
  • • 第二道(before_tool):即使 LLM 幻觉或状态不一致尝试调用,也返回错误拦截
钩子
操作
工具调用
写入
(激活工具名 + catalog_hash)
tool_search
before_model读取
(计算隐藏的工具集)
DeferredToolFilterMiddleware
wrap_model_call读取
(过滤模型绑定工具)
DeferredToolFilterMiddleware
wrap_tool_call读取
(拦截未激活工具调用)
DeferredToolFilterMiddleware

完整生命周期时序

按一次完整 agent run 的时间线,展示所有字段的读写窗口:

┌── 线程启动,LangGraph 从 checkpointer 恢复 state ──────────────────┐
│  messages 有历史,viewed_images 为空,promoted 可能已持久化      │
└──────────────────────────────────────────────────────────────────┘

▼  before_agent
   thread_data     ◀── ThreadDataMiddleware 写入(第 0 位,最先执行)
   sandbox         ◀── SandboxMiddleware 写入(eager 模式)
   uploaded_files  ◀── UploadsMiddleware 写入(从当前消息提取)

▼  before_model(第一次 LLM 调用)
   todos           ◀── TodoMiddleware 读取(上下文丢失检查)
   viewed_images   ◀── ViewImageMiddleware 读取 → 有缓存则注入图片消息 → 写入 {} 清空
   promoted        ◀── DeferredToolFilterMiddleware 读取 → 决定隐藏哪些工具
   wrap_model_call  ◀── DeferredToolFilterMiddleware 过滤工具 schema

▼  模型节点 → LLM 输出 AIMessage(可能含 tool_calls + write_todos 工具调用)
   messages        ◀── AIMessage 通过 add_messages 追加

▼  工具节点 → 执行 tool_calls
   sandbox         ◀── SandboxMiddleware lazy 创建(如果需要)
   artifacts       ◀── present_file_tool 写入新文件路径
   viewed_images   ◀── view_image_tool 写入 base64 图片缓存
   promoted        ◀── tool_search 写入激活工具列表
   todos           ◀── TodoListMiddleware(父类)拦截 write_todos 写入
   messages        ◀── ToolMessage 通过 add_messages 追加

▼  after_model
   title           ◀── TitleMiddleware 条件写入(首次对话后)
   todos           ◀── TodoMiddleware 读取 → 未完成则强制 jump_to: model

▼  (可能的多轮 "before_model → 模型 → 工具 → after_model" 循环)

▼  after_agent
   sandbox         ◀── SandboxMiddleware 读取 sandbox_id → 释放资源
   todos           ◀── TodoMiddleware 清理提醒

▼  持久化到 checkpointer ─────────────────────────────────────
   messages, sandbox, title, artifacts, todos, viewed_images, promoted
   注意:jump_to 不持久化(EphemeralValue)

汇总表

字段
类型
Reducer
写入者
写入时机
读取者
messages
Required list
add_messages
LangGraph 引擎
每一步
所有中间件/模型
jump_to
Ephemeral
TodoMiddleware
after_model
LangGraph 引擎
structured_response
OmitFromInput
LangChain 引擎
结构化解析后
API 输出
sandbox
Annotated
merge_sandbox
SandboxMiddleware
before_agent / wrap_tool_call
after_agent / 工具
thread_data
NotRequired
ThreadDataMiddleware
before_agent
工具 / ToolOutputBudgetMiddleware
title
NotRequired
TitleMiddleware
after_model
TitleMiddleware
artifacts
Annotated
merge_artifacts
present_file_tool
工具调用
前端 stream
todos
Annotated
merge_todos
TodoListMiddleware
after_model
TodoMiddleware / TokenUsageMiddleware
uploaded_files
NotRequired
UploadsMiddleware
before_agent
记忆处理
viewed_images
Annotated
merge_viewed_images
view_image_tool
工具调用
ViewImageMiddleware before_model
promoted
Annotated
merge_promoted
tool_search
工具调用
DeferredToolFilterMiddleware

设计哲学总结

设计原则
体现
中间件驱动
每个字段都有专职中间件管理,不在主引擎代码中掺状态逻辑
Reducer 保证并发安全sandbox
artifactstodosviewed_imagespromoted 全部用了 reducer——同一 graph step 多工具并发写入不丢数据
生命周期匹配jump_to
 只活当前 step(Ephemeral),sandbox 活一次 agent run,title 活整个线程,messages 永远存活
Fail-closedsandbox
 reducer 冲突抛错,promoted hash 不匹配拒绝激活——宁可拒绝也比静默出错安全
类型化 but 灵活
子状态用 TypedDict(SandboxStateThreadDataStateViewedImageDataPromotedTools)而不是 dict,兼顾类型安全和扩展性
删除 = 语义viewed_images
 空字典 = 清空缓存,todos None = 别碰——用值本身表达意图,不引入额外 flag
基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-02 16:49:39 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/828913.html
  2. 运行时间 : 0.247506s [ 吞吐率:4.04req/s ] 内存消耗:4,819.20kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=856e720a198cb8b36e0cba7307be409f
  1. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_static.php ( 6.05 KB )
  7. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/ralouphie/getallheaders/src/getallheaders.php ( 1.60 KB )
  10. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  11. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  12. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  13. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  14. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  15. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  16. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  17. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  18. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  19. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions_include.php ( 0.16 KB )
  21. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions.php ( 5.54 KB )
  22. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  23. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  24. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  25. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/provider.php ( 0.19 KB )
  26. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  27. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  28. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  29. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/common.php ( 0.03 KB )
  30. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  32. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/alipay.php ( 3.59 KB )
  33. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  34. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/app.php ( 0.95 KB )
  35. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cache.php ( 0.78 KB )
  36. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/console.php ( 0.23 KB )
  37. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cookie.php ( 0.56 KB )
  38. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/database.php ( 2.48 KB )
  39. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/filesystem.php ( 0.61 KB )
  40. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/lang.php ( 0.91 KB )
  41. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/log.php ( 1.35 KB )
  42. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/middleware.php ( 0.19 KB )
  43. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/route.php ( 1.89 KB )
  44. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/session.php ( 0.57 KB )
  45. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/trace.php ( 0.34 KB )
  46. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/view.php ( 0.82 KB )
  47. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/event.php ( 0.25 KB )
  48. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  49. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/service.php ( 0.13 KB )
  50. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/AppService.php ( 0.26 KB )
  51. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  52. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  53. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  54. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  55. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  56. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/services.php ( 0.14 KB )
  57. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  58. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  59. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  60. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  61. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  62. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  63. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  64. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  65. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  66. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  67. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  68. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  69. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  70. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  71. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  72. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  73. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  74. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  75. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  76. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  77. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  78. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  79. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  80. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  81. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  82. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  83. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  84. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  85. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  86. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  87. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/Request.php ( 0.09 KB )
  88. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  89. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/middleware.php ( 0.25 KB )
  90. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  91. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  92. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  93. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  94. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  95. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  96. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  97. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  98. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  99. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  100. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  101. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  102. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  103. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/route/app.php ( 3.94 KB )
  104. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  105. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  106. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Index.php ( 9.87 KB )
  108. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/BaseController.php ( 2.05 KB )
  109. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  110. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  111. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  112. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  113. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  114. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  115. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  116. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  117. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  118. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  119. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  120. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  121. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  122. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  123. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  124. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  125. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  126. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  127. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  128. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  129. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  130. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  131. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  132. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  133. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  134. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  135. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Es.php ( 3.30 KB )
  136. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  137. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  138. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  139. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  140. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  141. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  142. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  143. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  144. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/runtime/temp/c935550e3e8a3a4c27dd94e439343fdf.php ( 31.50 KB )
  145. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000820s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001350s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.009389s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000613s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001207s ]
  6. SELECT * FROM `set` [ RunTime:0.000534s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001308s ]
  8. SELECT * FROM `article` WHERE `id` = 828913 LIMIT 1 [ RunTime:0.001293s ]
  9. UPDATE `article` SET `lasttime` = 1782982179 WHERE `id` = 828913 [ RunTime:0.028847s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000566s ]
  11. SELECT * FROM `article` WHERE `id` < 828913 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.015897s ]
  12. SELECT * FROM `article` WHERE `id` > 828913 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000937s ]
  13. SELECT * FROM `article` WHERE `id` < 828913 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.012961s ]
  14. SELECT * FROM `article` WHERE `id` < 828913 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001821s ]
  15. SELECT * FROM `article` WHERE `id` < 828913 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.008570s ]
0.251496s