乐于分享
好东西不私藏

OpenClaw源码学习 | 上下文剪枝(context pruning)

OpenClaw源码学习 | 上下文剪枝(context pruning)

OpenClaw 的上下文管理遵循“持久化与运行时分离”的原则,将剪枝机制拆分为两个独立的层面——硬剪枝(Hard Pruning) 与 软剪枝(Soft Pruning)。这两类剪枝在触发时机、作用对象和影响范围上有着本质区别,共同构成了从存储到交互的完整上下文管控体系。

🪓 硬剪枝

硬剪枝发生在工具执行结果写入会话文件(.jsonl)之前。它的核心职责是对单条 toolResult 进行大小裁剪,防止单个工具返回的数据量过大导致会话文件膨胀或后续加载失败。这种剪枝是永久性的——一旦写入,原始数据将被截断版本替代,保证了会话历史的一致性和可加载性,但代价是部分信息的丢失。

🌿 软剪枝

与硬剪枝不同,软剪枝发生在构建发送给模型的上下文请求时(即从会话文件读取历史后、发送给API前)。它根据当前模型的上下文窗口限制,对即将送入的 tool_result 等内容进行临时截断或压缩摘要。软剪枝是临时性的——它只影响单次模型调用,不会修改已持久化的会话记录。这种“阅后即焚”的方式,在控制输入体积的同时,完整保留了原始会话数据。

硬剪枝

调用链路如下:

runEmbeddingAttemp
 --> guardSessionManager
   ---> installSessionToolResultGuard
       ---> guardedAppend
        ---> capToolResultSize 

首先,runEmbeddingAttemp通过guardSessionManager包装并注入会话 Guard。

// src/agents/pi-embedded-runner/run/attemp.ts
exportasyncfunctionrunEmbeddedAttempt(...){
 ...
 sessionManager = guardSessionManager(SessionManager.open(params.sessionFile)
 ...
}

guardSessionManager内部会通过调用installSessionToolResultGuard方法替换sessionManagerappendMessage方法,在一条工具结果类型消息持久化之前,实施结果截断操作。我们先看看这个函数替换的逻辑。

// src/agents/pi-embedded-runner/run/attemp.ts
exportfunctioninstallSessionToolResultGuard(sessionManager,...){
// 1、把原始的 appendMessage 方法保存到 originalAppend 变量,并把它的 this 绑定到当前 sessionManager 实例上。
const originalAppend = sessionManager.appendMessage.bind(sessionManager);

// 2、新实现的 guardedAppend,执行硬剪枝,在消息写入前执行工具结果关联、验证、清理和持久化等逻辑,确保工具结果的正确性和上下文一致性,
const guardedAppend = (message: AgentMessage) => {
  ...
if (nextRole === "toolResult") { // 如果消息是工具执行结果类型
// 工具名规范化,例如去除前后空格等
const normalizedToolResult = normalizePersistedToolResultName(nextMessage, toolName);
// 持久化前执行硬剪枝
const capped = capToolResultSize(persistMessage(normalizedToolResult));
   ...  
  }
  ...
 }
// 3、用上述新实现版本替换 sessionManager 的 appendMessage 默认实现
 sessionManager.appendMessage = guardedAppend as SessionManager["appendMessage"];

}

真正做硬剪枝的是capToolResultSize函数。这里有一点需要注意,硬剪枝是在单条消息粒度执行的,目的是为了防止在后续调用大模型时,上下文窗口被某条超长工具执行结果所占用。下一节讨论的软剪枝,则是针对当前上下文中所有的工具结果消息一起执行的。capToolResultSize进一步调用了truncateToolResultMessage函数来实现。

// src/agents/session-tool-result-guard.ts
// 如果对工具结果执行了截断,则在消息后添加的提示文本
const TRUNCATION_SUFFIX =
"\n\n⚠️ [Content truncated — original was too large for the model's context window. " +
"The content above is a partial view. If you need more, request specific sections or use " +
"offset/limit parameters to read smaller chunks.]";

functioncapToolResultSize(msg: AgentMessage): AgentMessage{
if ((msg as { role?: string }).role !== "toolResult") {
return msg;
 }
return truncateToolResultMessage(msg, HARD_MAX_TOOL_RESULT_CHARS, {
  suffix: GUARD_TRUNCATION_SUFFIX,
  minKeepChars: 2_000,
 });
}

truncateToolResultMessage函数输入以下三个参数:

  • maxChars:工具执行结果文本上限(包含截断后要追加的 suffix)。默认值为HARD_MAX_TOOL_RESULT_CHARS=400000
  • suffix:截断后附加到每个工具执行输出末尾的提示文本(默认内容见上一个代码块的TRUNCATION_SUFFIX变量),实现上在计算可保留正文时会把 suffix.length 从 maxChars 中扣除,所以 suffix 的长度会影响正文可用空间。
  • minKeepChars:截断时强制每个工具的执行结果至少保留的正文字符数(默认 MIN_KEEP_CHARS,库中为 2000)。也就是说即便 maxChars 很小也会至少保留 minKeepChars 的头部内容(然后再加上 suffix),以保证截断后的片段仍有足够上下文供模型/人类理解。
// src/agents/tool-result-truncation.ts
exportfunctiontruncateToolResultMessage(msg,maxChars,options){
const suffix = options.suffix ?? TRUNCATION_SUFFIX;
const minKeepChars = options.minKeepChars ?? MIN_KEEP_CHARS;
const content = (msg as { content?: unknown }).content;
// 1、计算当前消息的工具结果部分字符数,小于 maxChars 的不用截断
const totalTextChars = getToolResultTextLength(msg);
if (totalTextChars <= maxChars) {
return msg;
 }
// 2、content 是一个数组类型,下面的实现是把预算分配到内一个块,对每个块单独截断
const newContent = content.map((block: unknown) => {
// 2.1 按照块大小占整个消息内容大小比例分配截断预算
const blockShare = textBlock.text.length / totalTextChars;
const blockBudget = Math.max(minKeepChars + suffix.length, Math.floor(maxChars * blockShare));
return {
   ...textBlock,
// 2.2 按照分配给当前块的预算执行截断
   text: truncateToolResultText(textBlock.text, blockBudget, { suffix, minKeepChars }),
  };
 }
}

truncateToolResultText函数是对单个块(一条工具执行结果)执行截断。对某个文本块,它会先通过一些规则检查消息尾部是否有重要内容。如果尾部有重要内容,则实施head + tail 策略则分配0.3的预算给尾部,剩余的分配给头部。默认是保留head的消息为主。 阶段算法的流程如下:

算法:truncateToolResultText(text, maxChars, {suffix, minKeepChars})

输入:
text:原始字符串
maxChars:目标最大字符数(包含 suffix)
suffix:截断后追加的提示(默认 TRUNCATION_SUFFIX)
minKeepChars:至少保留的正文字符数(默认 2000)

步骤:
1. 若 |text| ≤ maxChars,则返回 text(不变)。
2. 计算正文预算:
   B = max(minKeepChars, maxChars - |suffix|)
3. 若尾部可能包含重要信息(hasImportantTail(text) 为真)且 B > 2 * minKeepChars,则使用 head+tail 策略:
   - T = min(floor(0.3 * B), 4000)  // 尾部预算
   - H = B - T - |MIDDLE_OMISSION_MARKER|  // 头部预算
   - 若 H > minKeepChars:
     - 在头部取截断点 h(优先选择靠近 H 的换行,否则 h = H)
     - 在尾部取起点 s(默认 |text|-T,若靠近换行则调整到换行后)
     - 返回 text[0:h) + MIDDLE_OMISSION_MARKER + text[s:] + suffix
4. 否则只保留头部:
   - 令 c = B,若在 ≤B 范围内存在靠近 B 的换行 n(n > 0.8*B),则 c = n
   - 返回 text[0:c) + suffix
5. 复杂度:O(n) 时间(n = |text|),常数额外空间(返回新字符串视为输出成本)

代码如下:

// arc/agents/pi-embedded-runner/tool-result-truncation.ts
exportfunctiontruncateToolResultText(
 text: string,
 maxChars: number,
 options: ToolResultTruncationOptions = {},
): string
{
const suffix = options.suffix ?? TRUNCATION_SUFFIX;
const minKeepChars = options.minKeepChars ?? MIN_KEEP_CHARS;
if (text.length <= maxChars) {
return text;
 }
const budget = Math.max(minKeepChars, maxChars - suffix.length);

// If tail looks important, split budget between head and tail
if (hasImportantTail(text) && budget > minKeepChars * 2) {
const tailBudget = Math.min(Math.floor(budget * 0.3), 4_000);
const headBudget = budget - tailBudget - MIDDLE_OMISSION_MARKER.length;
if (headBudget > minKeepChars) {
// Find clean cut points at newline boundaries
let headCut = headBudget;
const headNewline = text.lastIndexOf("\n", headBudget);
if (headNewline > headBudget * 0.8) {
   headCut = headNewline;
  }
let tailStart = text.length - tailBudget;
const tailNewline = text.indexOf("\n", tailStart);
if (tailNewline !== -1 && tailNewline < tailStart + tailBudget * 0.2) {
   tailStart = tailNewline + 1;
  }
return text.slice(0, headCut) + MIDDLE_OMISSION_MARKER + text.slice(tailStart) + suffix;
  }
 }

// Default: keep the beginning
let cutPoint = budget;
const lastNewline = text.lastIndexOf("\n", budget);
if (lastNewline > budget * 0.8) {
  cutPoint = lastNewline;
 }
return text.slice(0, cutPoint) + suffix;
}

判断一条工具执行结果消息的尾部是否重要的算法也很简单,取消息尾部2000条结果,然后检查其中是否包含一些指示出错的关键词(error, exception,exit code),或者是否包含一些跟总结有关的关键词(total,summary,complete )。

// arc/agents/pi-embedded-runner/tool-result-truncation.ts
functionhasImportantTail(text: string): boolean{
// Check last ~2000 chars for error-like patterns
const tail = text.slice(-2000).toLowerCase();
return (
/\b(error|exception|failed|fatal|traceback|panic|stack trace|errno|exit code)\b/.test(tail) ||
// JSON closing — if the output is JSON, the tail has closing structure
  /\}\s*$/.test(tail.trim()) ||
// Summary/result lines often appear at the end
  /\b(total|summary|result|complete|finished|done)\b/.test(tail)
 );
}

截断的内容则会使用一个占位符内容表示。

// arc/agents/pi-embedded-runner/tool-result-truncation.ts
/**
* Marker inserted between head and tail when using head+tail truncation.
*/

const MIDDLE_OMISSION_MARKER =
"\n\n⚠️ [... middle content omitted — showing head and tail ...]\n\n";

软剪枝

上下文的软剪枝会在调用大模型之前对工具调用结果进行压缩,但是这不会影响工具调用结果的持久化。

installToolResultContextGuard在运行时替换 agent.transformContext,对发送到模型的上下文执行临时截断/压缩。 先看看installToolResultContextGuard的行为: 调用链路如下:

runEmbeddingAttemp 
   --> installToolResultContextGuard 
     ---> enforceToolResultContextBudgetInPlace
// src/agents/pi-embedded-runner/tool-result-context-guard.ts
exportfunctioninstallToolResultContextGuard(params: {
 agent: GuardableAgent;
 contextWindowTokens: number;
}
): () => void
{
const contextWindowTokens = Math.max(1Math.floor(params.contextWindowTokens));
const contextBudgetChars = Math.max(1_024,Math.floor(contextWindowTokens * CHARS_PER_TOKEN_ESTIMATE * CONTEXT_INPUT_HEADROOM_RATIO),);
//单条工具最大的输出结果字符
const maxSingleToolResultChars = Math.max(1_024,Math.floor(contextWindowTokens * TOOL_RESULT_CHARS_PER_TOKEN_ESTIMATE *SINGLE_TOOL_RESULT_CONTEXT_SHARE,),);

const mutableAgent = params.agent as GuardableAgentRecord;
// agent 原始的 transformContext
const originalTransformContext = mutableAgent.transformContext;
// 以下做运行时临时拦截
 mutableAgent.transformContext = (async (messages: AgentMessage[], signal: AbortSignal) => {
const transformed = originalTransformContext? await originalTransformContext.call(mutableAgent, messages, signal): messages;
const contextMessages = Array.isArray(transformed) ? transformed : messages;
// 这里根据配置和预算实施 工具调用结果 软剪枝
  enforceToolResultContextBudgetInPlace({
   messages: contextMessages,
   contextBudgetChars,
   maxSingleToolResultChars,
  }
); 
return contextMessages;
 }
asGuardableTransformContext;
 // 返回恢复 默认 transformContext 的函数
return() =>
 {
  mutableAgent.transformContext = originalTransformContext;
 };
}

在上面的代码中,enforceToolResultContextBudgetInPlace负责真正的软剪枝。对agenttransformContext函数的临时拦截的恢复操作以函数形式返回,在runEmbeddedAttemp中保存为变量removeToolResultContextGuard。在runEmbeddedAttempfinally模块会运行这个拦截卸载工作。

// src/agents/pi-embedded-runner/run/attemp.ts
exportasyncfunctionrunEmbeddedAttempt(...){
try{
  ...
// 临时拦截 agent.transformContex函数,增加工具执行结果软剪枝逻辑
  removeToolResultContextGuard = installToolResultContextGuard({
   agent: activeSession.agent,
   contextWindowTokens: Math.max(1,Math.floor(params.model.contextWindow ?? params.model.maxTokens ?? DEFAULT_CONTEXT_TOKENS,),),});
   ...
  } finally {
// 卸载拦截 agent.transformContex函数
   removeToolResultContextGuard?.();
  } 
}

下面我们先看看,在agent调用大模型之前是如何感知这个操作的,然后再看看enforceToolResultContextBudgetInPlace函数的实现。给大模型发送请求的函数位于pi-mono项目的packages/agent/src/agent-loop.ts中的streamAssistantResponse函数,这个函数在发送大模型调用前会先调用transformContext对消息进行转换操作,而在上面openclaw的注入拦截操作中,我们已经增加了工具执行结果的剪枝了,因此大模型收到的消息已经是剪枝后的结果了。代码如下:

// packages/agent/src/agent-loop.ts
asyncfunctionstreamAssistantResponse(...){
// Apply context transform if configured (AgentMessage[] → AgentMessage[])
let messages = context.messages;
if (config.transformContext) {
// 下面的 transformContext 会执行我们之前拦截注入的工具结果剪枝
  messages = await config.transformContext(messages, signal);
 }
// 消息格式转换
const llmMessages = await config.convertToLlm(messages); 
// 构建 LLM 上下文
const llmContext: Context = {
  systemPrompt: context.systemPrompt,
  messages: llmMessages,  // 这个已经值剪枝后的消息了
  tools: context.tools,
 };
// 下面真正调用大模型
const streamFunction = streamFn || streamSimple;
const response = await streamFunction(config.model, llmContext, ...}
  ...
}

下面看看上下文软剪枝实现的核心函数enforceToolResultContextBudgetInPlace。它会从当前agent上下文所有消息中筛选出toolresult类型的消息,然后对每条toolresult消息实施截断操作。如果这一步截断还不满足约束。则进一步会对消息列表中较早的toolresult消息进行压缩操作。

// src/agents/pi-embedded-runner/tool-result-context-guard.ts
functionenforceToolResultContextBudgetInPlace(params: {
 messages: AgentMessage[];
 contextBudgetChars: number;
 maxSingleToolResultChars: number;
}
): void
{
// 读取上下文软剪枝的设置 maxSingleToolResultChars 为单条工具结果消息最大字符数,contextBudgetChars为估算的给所有工具结果的总预算
const { messages, contextBudgetChars, maxSingleToolResultChars } = params;
const estimateCache = createMessageCharEstimateCache();
// 对每一条工具结果消息实施截断
for (const message of messages) {
if (!isToolResultMessage(message)) {
continue;
  }
const truncated = truncateToolResultToChars(message, maxSingleToolResultChars, estimateCache);
  applyMessageMutationInPlace(message, truncated, estimateCache);
 }

let currentChars = estimateContextChars(messages, estimateCache);
if (currentChars <= contextBudgetChars) {
return;
 }
// 如果还不满足约束,则从最老的工具结果消息开始实施压缩,直到满足约束为止
 compactExistingToolResultsInPlace({
  messages,
  charsNeeded: currentChars - contextBudgetChars,
  cache: estimateCache,
 });

}

对于单条工具结果,跟上一节的硬剪枝可能采用head+tail策略不同,这里只使用了head策略。真正实现的函数为truncateTextToBudget。调用链路为truncateToolResultToChars-->truncateTextToBudget。这个函数的实现要点:

  • 只做“头部截断”(不做 head+tail 或复杂保留尾部);适合在上下文预算紧张时快速保留前文线索。
  • 优先在接近预算末尾的换行处断开(阈值 0.7)以避免在行中间生硬截断。
  • 当预算极小或被后缀耗尽时,函数会放弃正文并返回统一的截断提示字符串,避免产生空或无意义输出。
// src/agents/pi-embedded-runner/tool-result-context-guard.ts
functiontruncateTextToBudget(text: string, maxChars: number): string{

if (text.length <= maxChars) {
return text;
 }

if (maxChars <= 0) {
return CONTEXT_LIMIT_TRUNCATION_NOTICE;
 }

const bodyBudget = Math.max(0, maxChars - CONTEXT_LIMIT_TRUNCATION_SUFFIX.length);
// 当预算极小或被后缀耗尽时,函数会放弃正文并返回统一的截断提示字符串
if (bodyBudget <= 0) {
return CONTEXT_LIMIT_TRUNCATION_NOTICE;
 }
// 优先在接近预算末尾的换行处断开
let cutPoint = bodyBudget;
const newline = text.lastIndexOf("\n", bodyBudget);
if (newline > bodyBudget * 0.7) {
  cutPoint = newline;
 }

return text.slice(0, cutPoint) + CONTEXT_LIMIT_TRUNCATION_SUFFIX;
}
基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-30 13:15:04 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/477525.html
  2. 运行时间 : 0.130535s [ 吞吐率:7.66req/s ] 内存消耗:4,624.66kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=687032e46c1f7b9eb5f1210c49921ec6
  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.000548s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000709s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.005728s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000304s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000492s ]
  6. SELECT * FROM `set` [ RunTime:0.000230s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000717s ]
  8. SELECT * FROM `article` WHERE `id` = 477525 LIMIT 1 [ RunTime:0.004437s ]
  9. UPDATE `article` SET `lasttime` = 1777526104 WHERE `id` = 477525 [ RunTime:0.014407s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.004212s ]
  11. SELECT * FROM `article` WHERE `id` < 477525 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.002905s ]
  12. SELECT * FROM `article` WHERE `id` > 477525 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.002763s ]
  13. SELECT * FROM `article` WHERE `id` < 477525 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000695s ]
  14. SELECT * FROM `article` WHERE `id` < 477525 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000695s ]
  15. SELECT * FROM `article` WHERE `id` < 477525 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003546s ]
0.132280s