From 25ceeb2535b19276b0858848e70dda7cd7204c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:48:53 +0800 Subject: [PATCH] Add files via upload --- docs/en-US/tool-execution-governance.md | 17 ++++++++++++----- docs/zh-CN/tool-execution-governance.md | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/docs/en-US/tool-execution-governance.md b/docs/en-US/tool-execution-governance.md index f6ce8fd9..ad8d2ba7 100644 --- a/docs/en-US/tool-execution-governance.md +++ b/docs/en-US/tool-execution-governance.md @@ -111,17 +111,24 @@ Coverage: | PTY execution path | Uses the same output cap | | Frontend detail modal | Has an additional UI display cap | -When the cap is reached, CyberStrikeAI keeps a prefix and appends a truncation marker. The marker is counted inside the configured budget, so a 50000-byte cap does not become `50000 + marker`. +When the cap is reached, the full output is written to a local trunc file and the agent-facing payload becomes a `` notice (with absolute path) that fits inside the configured budget. Example: ```text - + +Output too large (200000). Full output saved to: /path/to/tmp/reduction/conversations//trunc/ +Use read_file with offset/limit to read parts of the file. +Preview (first …): +… -...[tool output limit reached: kept 50000 bytes; further output suppressed]... +Preview (last …): +… + + ``` -The current strategy is “prefix + marker.” For stronger auditability, a future enhancement can use “head 25k + tail 25k + full-output artifact path.” +The current strategy is “spill full text to disk + bounded preview in context.” Agents can recover the original via `read_file`. ## Database and Resume Context @@ -202,4 +209,4 @@ Expected behavior: ## Boundaries - CyberStrikeAI cannot control how a remote external MCP server collects output internally; it caps results after they enter CyberStrikeAI and protects calls with concurrency limits and circuit breakers. -- Full original output is not automatically written to an artifact path today. If complete audit recovery is required, add spill-to-file and include the artifact path in the bounded result. +- Oversized tool output is spilled to local `tmp/reduction/.../trunc/` (or `reduction_root_dir`) before truncation; the bounded result includes an absolute path for `read_file`. diff --git a/docs/zh-CN/tool-execution-governance.md b/docs/zh-CN/tool-execution-governance.md index f07f9d59..d2815fdf 100644 --- a/docs/zh-CN/tool-execution-governance.md +++ b/docs/zh-CN/tool-execution-governance.md @@ -111,17 +111,24 @@ multi_agent: | PTY 执行路径 | 同样受上限控制 | | 前端详情弹窗 | 额外有 UI 展示截断保护 | -触发上限后,系统会保留前段内容并追加截断 marker,marker 也计入总预算。因此当阈值为 50000 时,最终文本不会变成 `50000 + marker`。 +触发上限后,完整输出先写入本地 trunc 文件,Agent 侧只保留计入预算的 `` 预览(含绝对路径)。因此阈值为 50000 时,上下文文本不会超过该上限。 示例: ```text - + +Output too large (200000). Full output saved to: /path/to/tmp/reduction/conversations//trunc/ +Use read_file with offset/limit to read parts of the file. +Preview (first …): +… -...[tool output limit reached: kept 50000 bytes; further output suppressed]... +Preview (last …): +… + + ``` -当前策略是“前段内容 + marker”。如果需要更强的审计体验,可以后续升级为“前 25k + 后 25k + 完整原文 artifact 路径”。 +当前策略是「全文落盘 + 上下文预览」:超过 `reduction_max_length_for_trunc` 时,完整输出写入本地文件(默认 `tmp/reduction/conversations/<会话ID>/trunc/`),Agent/DB/监控拿到的是带绝对路径的 `` 预览;可用 `read_file` 按 offset/limit 回读全文。 ## DB 与恢复上下文 @@ -204,4 +211,4 @@ PY ## 当前边界 - 外部 MCP 的远端 server 内部如何采集输出不由 CyberStrikeAI 控制;CyberStrikeAI 会在结果进入本系统后统一兜底、限并发和熔断。 -- 当前不会为被截断的完整原文自动生成 artifact 路径;如果需要完整审计链路,建议后续实现 spill-to-file,并在 bounded result 中返回文件路径。 +- 超长工具输出会在截断前写入本地 `tmp/reduction/.../trunc/`(或 `reduction_root_dir`),bounded result 中包含可 `read_file` 的绝对路径。