"帮我打开PPT,制作一个「AI时代下SaaS数据产品的护城河与壁垒」为主题的PPT"
处理管线总览
①查询接收&归一化→②Gateway路由&队列→③Bootstrap文件注入→④ Prompt组装→⑤第1次LLM推理→⑥工具执行层→⑦ReAct工具循环→⑧ PPT文件生成→⑨回复投递
S0 查询接收 & 渠道归一化
📡 这个阶段 OpenClaw 在做什么
渠道 SDK(如 Telegram grammY、WhatsApp Baileys、Discord.js)接收到原始消息,将其转换为内部统一的
InboundMessage数据结构。此阶段无 LLM 参与,是纯数据归一化层。
涉及模块: src/channels、 src/media
内部数据结构(InboundMessage)
// 渠道SDK将原始消息归一化为此结构interfaceInboundMessage{// 消息内容text:"帮我打开PPT,制作一个「AI时代下...",// 来源识别channel:"telegram",// 或 whatsapp/discord/...accountId:"default",// 渠道账号peerId:"telegram:123456789",// 发件人唯一ID// 媒体附件(本例无)media:null,// 群组信息(本例为私聊)chatType:"direct",chatId:"telegram:123456789",// 元数据messageId:"msg_8821",timestamp:"2026-03-10T10:00:00Z"}
媒体处理管线(本 Query 无媒体,跳过)
如果用户发送了语音、图片或视频,此处会先经过 Media Pipeline( src/media):
- 图片 → 格式检测 → 尺寸压缩 → base64 或临时文件
- 语音 → 格式检测 → 可选 Transcription(语音转文字)
- 视频 → 格式检测 → 截帧/临时文件
本 Query 为纯文字,媒体管线直接跳过。
🔐 DM Policy 安全检查
在处理消息前,先核查
dmPolicy:若为"pairing"(默认),检查 peerId 是否已被管理员批准。未批准的发件人将收到配对码请求,消息不继续处理。
S1 Gateway 路由 & 队列调度
🌐 这个阶段 OpenClaw 在做什么
Gateway 的核心路由引擎执行:Binding 匹配 → 确定目标 agentId;SessionKey 生成 → 确定对话上下文;命令检测 → 识别内置命令(/new /reset /stop);入队 → 按 per-session lane 串行化。此阶段无 LLM 参与。
涉及模块: src/routing、 src/commands
Binding Engine 路由决策(无 Prompt,纯逻辑)
路由配置(~/.openclaw/openclaw.json):
{"agents":{"list":[{"id":"main","workspace":"~/.openclaw/workspace","default":true}]},"session":{"dmScope":"per-channel-peer"}}//路由决策过程:// channel=telegram, peerId=telegram:123456789//→Binding匹配(无特定绑定规则)//→回落到 default agent:"main"//→SessionKey:"agent:main:telegram:dm:telegram:123456789"
命令检测 & 队列入队
// 1. 命令检测(优先级最高)消息文本:"帮我打开PPT..."检测/new/reset /stop 前缀:未检测到→普通消息,继续正常处理// 2. 检查 SessionKey 是否有正在运行的任务sessionKey:"agent:main:telegram:dm:..."当前 session lane 状态:空闲→直接获取执行权,无需排队// 3. Gateway 发出 RPC 调用method:"agent"params:{message:"帮我打开PPT,制作...",sessionKey:"agent:main:telegram:dm:...",thinking:"auto"}→立即返回{ runId:"run_xyz", acceptedAt:"..."}
S2 Bootstrap 文件注入 — Agent 人格 & 记忆加载
🧠 这个阶段 OpenClaw 在做什么
Agent 运行时读取工作区(
~/.openclaw/workspace/)中的 Bootstrap 文件,这些文件是 Agent 的"长期记忆"和"人格设定"。所有非空文件都会被注入到 System Prompt 的上下文区域。文件过大时自动截断并附加截断标记。
涉及模块:Workspace Files、 src/agents
📄 AGENTS.md — 操作指令 & 长期记忆
文件路径:~/.openclaw/workspace/AGENTS.md(用户可编辑 / Agent 可自写)
# Operating Instructions## WorkspaceWorking directory:/Users/leslee/.openclaw/workspaceAll file operations default to this directory.## Memory Notes# (Agent 在此处写入持久记忆,跨会话保持)-User prefers concise replies inChinese-User timezone:Asia/Shanghai(UTC+8)-Preferred PPT style: dark theme, modern design-Last created: sales-report.pptx (2026-02-15)## Task Conventions-When creating PPT: always use the pptx skill workflow-File naming:use kebab-case,Chinese topics use pinyin prefix-Output files to ~/Desktopunless specified## Tool Usage Notes- pptx skill location:~/.openclaw/skills/pptx/- html2pptx.js path: skills/pptx/scripts/html2pptx.js-Always validate thumbnails after PPT creation
💡 此文件由用户和 Agent 共同维护——Agent 执行任务后会将重要信息写回此文件作为"记忆"
🎭 SOUL.md — Agent 人格 & 边界设定
文件路径:~/.openclaw/workspace/SOUL.md(用户配置,定义 Agent 性格)
# Soul & PersonaYou are a highly capable personal AI assistant.Your core traits:## Tone & Style-CommunicateinChinesebydefaultunless asked otherwise-Be direct and efficient —no unnecessary preamble-Use structured formatting (headers, bullets)for complex outputs-When creating documents/presentations: aim for professional quality## Capabilities & Boundaries-You CAN execute shell commands, create files, run scripts-You CAN create and edit presentations, documents, spreadsheets-You SHOULD ask for clarification when requirements are ambiguous-You SHOULD NOT expose system credentials orprivate paths in responses## Work Philosophy-Prefer complete solutions over partial ones —if asked to make a PPT,actually make a good one, don't just describe how- Validate your work (check thumbnails, verify file was created)- Report results clearly: what was done, where the file is
💡 SOUL.md 决定了 Agent 的性格底色——中文优先、专业、直接、偏向完整解决方案
👤 USER.md — 用户画像
文件路径:~/.openclaw/workspace/USER.md(用户配置,关于用户自己的信息)
# User ProfileName:LesleeRole:产品经理/数据产品负责人Company:互联网行业Language preference:Chinese(Simplified)## Context-Works on B2B SaaS data products-Frequently creates presentations forinternal reviews and client pitches-Technical background: understands architecture, AI systems-Preferred tools:Mac, modern dark-theme apps## Communication Preferences-Address me as:Leslee-ReplyinChinese-Keep responses concise but thorough for technical topics
💡 USER.md 让 Agent 了解"它在服务谁",可据此个性化回复内容与风格
🏷️ IDENTITY.md — Agent 身份标识
文件路径:~/.openclaw/workspace/IDENTITY.md(用户配置,Agent 自我认知)
# IdentityName:小助手Emoji:🤖Tagline:Your personal AI — fast, capable, always on.## Self-descriptionI am a personal AI assistant running locally on your devices.I can help with research, writing, coding, file management,creating presentations and documents,and web browsing.
💡 IDENTITY.md 通常比较短,主要影响 Agent 的自我介绍和称谓
🔧 TOOLS.md — 工具使用约定(本 Query 关键!)
文件路径:~/.openclaw/workspace/TOOLS.md(用户配置,工具使用规范)
# Tool Usage Guide## PPTX CreationWhen creating PowerPoint presentations:1.Load the pptx skill:Read SKILL.md at~/.openclaw/skills/pptx/SKILL.md for full workflow2.Use the html2pptx workflow fornew presentations from scratch3.Script location: skills/pptx/scripts/html2pptx.js4.Always generate thumbnail validation after creation:python skills/pptx/scripts/thumbnail.py output.pptx## File Conventions-Output directory:~/Desktop(unless user specifies)- PPT naming:{topic-kebab}.pptx## Shell Execution-Use bash for file operations-Use node or bun forJavaScript scripts
S3 Context & Prompt 完整组装
📐 这个阶段 OpenClaw 在做什么
Pi Agent 运行时将所有来源的内容合并成一个完整的 API 请求 payload。包括:Base System Prompt(pi-mono内核基础指令)+ Skills Prompt(已加载的 pptx skill 指令摘要)+ Bootstrap Context(S2 阶段的所有文件内容)+ 会话历史(当前 sessionKey 的 JSONL 历史,首轮为空)+ 用户当前消息。
涉及模块: src/agents/runEmbeddedPiAgent
🔵 Base System Prompt(pi-mono 内核基础提示词)
来源:pi-mono 内核生成,用户不可直接编辑
You are a capable AI assistant running as part of OpenClaw,a personal AI assistant system.## Core CapabilitiesYou have access to the following tools and can use them tocomplete tasks:FILE TOOLS:- read_file(path)—Read the contents of a file- write_file(path, content)—Write content to a file- edit_file(path, old,new)—Edit specific parts of a file- list_directory(path)—List files in a directory- create_directory(path)—Create a directorySHELL TOOLS:- shell_exec(command, cwd)—Execute a shell commandWorking directory defaults to:/Users/leslee/.openclaw/workspaceBROWSER TOOLS:- browser_open(url)—Open a URL in managed Chrome- browser_snapshot()—Get page accessibility tree- browser_click(ref)—Click an element- browser_fill(ref, text)—Fill an inputMESSAGING TOOLS:- send_message(channel, peer, text)—Send a message back## Behavior Guidelines1.Think before acting —For complex tasks, reason about theapproach before calling tools2.Use tools sequentially —Each tool call waits for result3.Validate your work —Check that files were created/editedcorrectly before reporting success4.Be concise in your final reply — don't narrate every step## WorkspaceCurrent working directory: /Users/leslee/.openclaw/workspaceAll relative paths resolve to this directory.
💡 Base Prompt 由 pi-mono 内核固化,提供工具定义和基础行为规范
🟣 Skills Prompt Block(pptx skill 注入的提示词摘要)
来源: ~/.openclaw/skills/pptx/SKILL.md 的关键摘要
## Loaded Skills### SKILL: pptxPowerPoint creation, editing,and analysis skill.WORKFLOW for creating a NEW presentation from scratch:STEP 1:Design approach-Analyze content → choose colors, layout, typography-State design rationale before writing codeSTEP 2:Create HTML slides-Dimensions:720pt×405pt(16:9)-Use web-safe fonts:Arial,Helvetica,Verdana, etc.-Useclass="placeholder"for chart areas-Rasterize gradients/icons as PNG first usingSharpSTEP 3:Convert HTML → PPTX-Script: skills/pptx/scripts/html2pptx.js-Runwith: node skills/pptx/scripts/html2pptx.jsSTEP 4:Visual validation-Run: python skills/pptx/scripts/thumbnail.py output.pptx-Read thumbnail image-Checkfor text cutoff, overlap, contrast issues-Fixand regenerate if neededDESIGN PRINCIPLES (apply to this task):-Consider subject matter: AI/SaaS/BusinessStrategy-Suggested palette forthis topic:ClassicBlue(#1C2833,#2E4053) or Bold accent colors-Create clear visual hierarchy-Use structured layouts: title + content, two-column for comparisonsCRITICAL RULE:After creating the file, always verifyit exists and generate thumbnails for visual validation.
💡 Skills Prompt 是 Skill SKILL.md 的关键摘要注入——告诉模型"如何制作 PPT 的完整工作流"
🔴 最终 API 请求 Payload 完整结构
发送给 LLM 的完整 Messages Array(Anthropic Claude API / OpenAI API 格式):
// ═══ SYSTEM PROMPT(合并层)═══{role:"system",content:`[BASE LAYER]You are a capable AI assistant running as part of OpenClaw...(工具定义+行为规范)[SKILLS LAYER]##LoadedSkills### SKILL: pptxWORKFLOW for creating a NEW presentation...(完整 pptx 技能工作流)[BOOTSTRAP CONTEXT]=== AGENTS.md ===Working directory:/Users/leslee/.openclaw/workspaceMemoryNotes:-User prefers concise replies in Chinese-Preferred PPT style: dark theme, modern design...=== SOUL.md ===You are a highly capable personal AI assistant.Communicate in Chinese by default...(性格设定)=== USER.md ===Name:LesleeRole:产品经理/数据产品负责人...=== TOOLS.md ===When creating PowerPoint presentations:1.Load the pptx skill...(工具使用规范)=== IDENTITY.md ===Name:小助手🤖...`}// ═══ 会话历史(本例为首轮对话,历史为空)═══// 如有历史: [ {role:"user",...}, {role:"assistant",...}, ... ]// ═══ 当前用户消息 ═══{role:"user",content:"帮我打开PPT,制作一个「AI时代下SaaS数据产品的护城河与壁垒」为主题的PPT"}// ═══ 工具定义(tools array)═══tools:[{ name:"shell_exec", description:"Execute shell command",...},{ name:"read_file",...},{ name:"write_file",...},{ name:"browser_open",...},// ... 全部可用工具]
💡 这是真正发给 LLM 的完整 Payload——System Prompt 是所有层的合并结果,而非单独文件
S4 第 1 次 LLM 推理 — 任务理解 & 规划
🤔 这个阶段 OpenClaw 在做什么
LLM 接收到 S3 组装的完整 Prompt,进行第一次推理。模型会:① 理解用户意图(制作 PPT);② 识别需要的技能(pptx skill);③ 规划执行步骤;④ 输出第一个工具调用(通常是先读取技能文档或开始构建内容)。整个过程以流式方式推送 Assistant Token。
LLM 第一次推理 — Thinking(内部规划,若启用 Extended Thinking)
stream:"reasoning",仅在 --thinking high/low 时出现
【模型内部推理过程(ExtendedThinking)】用户要求制作一个关于"AI时代下SaaS数据产品的护城河与壁垒"的PPT。任务分析:1.这是一个 PPT 创建任务2.主题是 B2B SaaS+数据产品+竞争战略(护城河/壁垒)3.用户是数据产品负责人(来自 USER.md),所以内容需要专业且有深度执行路径(按 TOOLS.md 和 pptx skill 规范):Step1:需要先读取 pptx skill 文档(SKILL.md)获取完整工作流Step2:规划 PPT 结构和内容(5-8页)Step3:设计颜色方案(深色商务风格,符合主题)Step4:为每页创建 HTML 文件Step5:运行 html2pptx.js 转换Step6:生成缩略图验证PPT 内容结构规划:-Slide1:封面—主题+副标题-Slide2:目录/议程-Slide3: AI时代下数据产品的战略价值-Slide4:五大护城河(数据网络效应/规模效应/技术壁垒/生态壁垒/转换成本)-Slide5:护城河量化评估框架-Slide6:竞争对手分析(内外部威胁)-Slide7:建立壁垒的行动路线图-Slide8:总结与展望颜色方案选择:主题:AI/科技/商业战略→选择DeepBlue+AccentGold-背景:#0D1B2A (深海军蓝)-主色:#1A3A5C (深蓝)-强调:#E8A020 (金色)-文字:#E8EDF5 (近白)第一步行动:先读取 pptx skill 的 html2pptx.md 文档,获取语法细节
💡 Thinking Block 是模型的"草稿本",不直接发送给用户,但会影响后续输出质量
LLM 第一次推理 — 实际输出(Assistant 回复 + 第一个工具调用)
stream:"assistant",流式推送到 Gateway
【Assistant流式文本输出】好的,我来为您制作这份 PPT。主题是「AI时代下SaaS数据产品的护城河与壁垒」,我会创建一份专业的商业战略演示文稿。让我先读取 PPT 制作工具的详细说明...// 然后模型立即输出第一个 tool_call
⚒️ 第 1 个工具调用 — 读取 html2pptx 语法文档
工具调用: read_file
{"path":"skills/pptx/html2pptx.md"}//实际路径解析为:///Users/leslee/.openclaw/workspace/skills/pptx/html2pptx.md//(相对路径基于 agents.defaults.workspace)
返回结果: ✅
# html2pptx Documentation## Usageconst html2pptx =require('./html2pptx.js')await html2pptx(pptx, htmlContent,{ width:720, height:405})## HTML Structure-Use standard HTML elements: h1-h6, p, ul, ol, li-Inline styles for positioning and colors-class="placeholder"for chart areas (renders as gray box)...(文档内容,约300行)
S5 工具执行层 & ReAct 循环规划
🔄 ReAct 工具循环机制
每次工具调用的结果被追加到 messages 历史中,然后再次调用 LLM 进行推理。这个循环持续进行,直到 LLM 输出纯文本的最终回复(无工具调用)为止。对于 PPT 制作任务,这个循环通常会执行 10-20次工具调用。
ReAct Loop — LLM Call #2(读取文档后的规划)
messages 数组在追加了 tool_call+tool_result 后再次推理:
// messages 数组现在包含(增量追加):[// ... 之前的 system prompt + user message + ...{ role:"assistant", content:[{ type:"text", text:"好的,我来为您制作这份 PPT..."},{ type:"tool_use", id:"tool_1", name:"read_file",input:{ path:"skills/pptx/html2pptx.md"}}]},{ role:"user", content:[{ type:"tool_result", tool_use_id:"tool_1",content:"# html2pptx Documentation\n## Usage\n..."}]}]// LLM 收到工具结果后,进行第二次推理// → 输出:开始创建 HTML 文件(第一张幻灯片)
⚒️ 工具调用 #2 — 创建工作目录
工具调用: shell_exec
{"command":"mkdir -p slides && mkdir -p slides/assets","cwd":"/Users/leslee/.openclaw/workspace"}
⚒️ 工具调用 #3 — 创建封面 Slide HTML
工具调用: write_file → slides/slide-01-cover.html
{"path":"slides/slide-01-cover.html","content":"<!DOCTYPE html>\n<html>\n<head>\n <style>\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body {\n width: 720pt; height: 405pt;\n background: linear-gradient(135deg, #0D1B2A 0%, #1A3A5C 100%);\n ...\n }\n h1 { font-size: 32pt; color: #E8EDF5; ... }\n h1 span { color: #E8A020; }\n ...\n </style>\n</head>\n<body>\n <div class=\"logo-area\">SaaS Strategy 2026</div>\n <div class=\"tag\">战略竞争力分析</div>\n <h1>AI时代下SaaS数据产品的<br><span>护城河与壁垒</span></h1>\n <p class=\"subtitle\">从数据网络效应到技术生态的竞争战略框架</p>\n</body>\n</html>"}
返回结果: ✅ File written: slides/slide-01-cover.html (1,243 bytes)
↓ ↓ ↓ (循环重复,每张 Slide 1次 write_file)
🔁 ReAct 循环中每次 LLM 推理时,messages 数组如何增长
每完成一次工具调用,messages 数组都会追加:1条 assistant(含 toolcall)+ 1条 user(含 toolresult)。到第5张 Slide 时,messages 数组中已包含约 15条 历史记录,LLM 每次推理都能"看到"之前所有的操作记录,从而保持上下文一致性(例如颜色风格保持统一、幻灯片编号正确递增)。
S6 ReAct 工具循环 — 完整执行序列
完整工具调用序列表(约 16 次工具调用)
read_file | ||||
shell_exec | ||||
write_file | ||||
write_file | ||||
write_file | ||||
write_file | ||||
write_file | ||||
write_file | ||||
write_file | ||||
write_file | ||||
write_file | ||||
shell_exec | ||||
shell_exec | ||||
shell_exec | ||||
read_file | ||||
write_fileshell_exec |
关键 LLM 推理 — T11 生成 create-pptx.js 时的完整 Prompt 上下文
此时 messages 已有约30条历史记录:
// [system]: 完整 System Prompt(Base + Skills + Bootstrap)// [user]: "帮我打开PPT,制作..."// [assistant]: "好的..." + tool_call read_file// [user]: tool_result(html2pptx.md 内容)// [assistant]: tool_call mkdir// [user]: tool_result(目录创建成功)// [assistant]: tool_call write_file slide-01-cover.html// [user]: tool_result(✅ 1.2KB)// ... (T3-T10 共8次写入 Slide HTML)// [assistant]: tool_call write_file slide-08-summary.html// [user]: tool_result(✅ 成功)// 此时 LLM 推理,决定生成转换脚本:【LLM 第11次推理意图】所有8张Slide的 HTML 文件已全部创建。现在需要生成一个Node.js 脚本,调用 html2pptx.js 将它们合并成.pptx 文件。根据 html2pptx.md 的语法,脚本应该:1. require html2pptx2.创建 pptx 实例3.对每张Slide HTML 调用 html2pptx()4.调用 pptx.writeFile('saas-moat-2026.pptx')
LLM 输出的 create-pptx.js 内容:
constPptxGenJS= require('pptxgenjs');const html2pptx = require('../skills/pptx/scripts/html2pptx');const fs = require('fs');const path = require('path');async function createPresentation(){const pptx =newPptxGenJS();pptx.layout ='LAYOUT_WIDE';// 16:9const slides =['slide-01-cover.html','slide-02-agenda.html','slide-03-value.html','slide-04-moats.html','slide-05-framework.html','slide-06-competition.html','slide-07-roadmap.html','slide-08-summary.html'];for(const slideFile of slides){const html = fs.readFileSync(path.join(__dirname, slideFile),'utf8');await html2pptx(pptx, html,{ width:720, height:405});}await pptx.writeFile({ fileName:'saas-moat-2026.pptx'});console.log('✅ Created: saas-moat-2026.pptx');}createPresentation().catch(console.error);
👁️ T15 读取缩略图后的 LLM 推理 — 视觉验证
messages 中包含图片格式的 tool_result:
{role:"user",content:[{type:"tool_result",tool_use_id:"tool_14",content:[{type:"image",// 图片格式source:{type:"base64",media_type:"image/jpeg",data:"[thumbnails.jpg base64编码]"}}]}]}【LLM 对缩略图的分析推理】查看缩略图:-Slide1(封面):✅布局正确,标题居中,金色强调色-Slide2(目录):✅4个议题清晰可见-Slide3(价值):✅两栏布局,左右均衡-Slide4(护城河):✅五列卡片,内容适中-Slide5(框架):⚠️表格右侧有文字被截断-Slide6(竞争):✅正常-Slide7(路线图):✅三阶段时间轴清晰-Slide8(总结):✅封底风格与封面呼应检测到问题:Slide5文字溢出→需要修复 slide-05-framework.html 的表格宽度
💡 模型直接"看"缩略图来验证输出质量——视觉验证是 pptx skill 工作流的强制步骤
S7 PPT 文件最终生成 & 验证完成
修复 Slide 5 后重新生成
工具调用: write_file — 修复 slide-05-framework.html
{"path":"slides/slide-05-framework.html","content":"...(修复表格宽度、减小字体后的 HTML)..."}
工具调用: shell_exec — 重新生成 PPTX
node slides/create-pptx.jscp saas-moat-2026.pptx~/Desktop/
最终文件输出:
✅Created: saas-moat-2026.pptxFile size:2.8 MBLocation:~/Desktop/saas-moat-2026.pptxSlides:8Dimensions:33.87cm×19.05cm(16:9)
最终 PPT 内容结构
💾 Agent 写入记忆
任务完成后,Agent 会将关键信息写入 AGENTS.md(Memory Notes 区域),如:"Last PPT created: saas-moat-2026.pptx (2026-03-10), 8 slides, dark blue theme",供下次会话引用。
S8 最终回复成形 & 渠道投递
📤 这个阶段 OpenClaw 在做什么
所有工具调用完成后,最后一次 LLM 推理输出纯文本回复(不含 tool_call),Loop 检测到无工具调用,视为任务完成。回复经过分块(Chunking)处理后,通过原渠道的 SDK 发送回用户。同时触发
agent_endHook、会话历史落盘、usage 统计更新。
最后一次 LLM 推理 — 最终回复(无工具调用)
stream:"assistant",无 tool_call,此为 Loop 终止条件:
【LLM 最终回复文本(发送给用户)】✅ PPT 制作完成!已为您创建「AI时代下SaaS数据产品的护城河与壁垒」演示文稿:📁文件位置:~/Desktop/saas-moat-2026.pptx📊共8张幻灯片内容结构:1.封面2.议程目录3. AI时代数据产品的战略价值4.五大护城河(数据网络效应/规模/技术/生态/转换成本)5.护城河量化评估框架6.竞争格局分析7.行动路线图(3阶段)8.总结与展望设计风格:深海蓝主色+金色强调,专业商业风格。如需调整内容、配色或添加具体数据图表,请告诉我🎨
💡 LLM 输出纯文本(无 tool_call)→ pi-mono 检测到 Loop 结束条件 → 触发 lifecycle:end 事件
回复分块(Chunking)& 投递
分块策略:回复文本按渠道的消息长度限制进行分块(如 Telegram 限制4096字符)。本次回复约200字,不需要分块,直接投递。
渠道投递:
- Telegram →
bot.sendMessage(chatId,text) - WhatsApp →
sock.sendMessage(jid,{text}) - Discord →
message.reply(text) - WebChat → WS event push
任务完成后的系统操作
- agent_end Hook 触发:插件可在此处做后处理(如通知/日志)
- JSONL 会话历史落盘:全部 messages(含工具调用)追加到
~/.openclaw/agents/main/sessions/<sessionId>.jsonl - usage 统计更新:inputTokens + outputTokens 写入 sessions.json
- 会话写锁释放:per-session lane 解锁,允许下一条消息进入
- 临时文件清理:Media Pipeline 生成的临时文件按生命周期回收
夜雨聆风