Add files via upload

This commit is contained in:
公明
2026-07-21 23:48:53 +08:00
committed by GitHub
parent 0152781598
commit 25ceeb2535
2 changed files with 24 additions and 10 deletions
+12 -5
View File
@@ -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 `<persisted-output>` notice (with absolute path) that fits inside the configured budget.
Example:
```text
<bounded output prefix>
<persisted-output>
Output too large (200000). Full output saved to: /path/to/tmp/reduction/conversations/<id>/trunc/<execution_id>
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 …):
</persisted-output>
```
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/<id>` (or `reduction_root_dir`) before truncation; the bounded result includes an absolute path for `read_file`.
+12 -5
View File
@@ -111,17 +111,24 @@ multi_agent:
| PTY 执行路径 | 同样受上限控制 |
| 前端详情弹窗 | 额外有 UI 展示截断保护 |
触发上限后,系统会保留前段内容并追加截断 marker,marker 也计入预算。因此阈值为 50000 时,最终文本不会变成 `50000 + marker`
触发上限后,完整输出先写入本地 trunc 文件,Agent 侧只保留计入预算`<persisted-output>` 预览(含绝对路径)。因此阈值为 50000 时,上下文文本不会超过该上限
示例:
```text
<bounded output prefix>
<persisted-output>
Output too large (200000). Full output saved to: /path/to/tmp/reduction/conversations/<id>/trunc/<execution_id>
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 …):
</persisted-output>
```
当前策略是“前段内容 + marker”。如果需要更强的审计体验,可以后续升级为“前 25k + 后 25k + 完整原文 artifact 路径”
当前策略是「全文落盘 + 上下文预览」:超过 `reduction_max_length_for_trunc` 时,完整输出写入本地文件(默认 `tmp/reduction/conversations/<会话ID>/trunc/<execution_id>`),Agent/DB/监控拿到的是带绝对路径的 `<persisted-output>` 预览;可用 `read_file` 按 offset/limit 回读全文
## DB 与恢复上下文
@@ -204,4 +211,4 @@ PY
## 当前边界
- 外部 MCP 的远端 server 内部如何采集输出不由 CyberStrikeAI 控制;CyberStrikeAI 会在结果进入本系统后统一兜底、限并发和熔断。
- 当前不会为被截断的完整原文自动生成 artifact 路径;如果需要完整审计链路,建议后续实现 spill-to-file,并在 bounded result 中返回文件路径。
- 超长工具输出会在截断前写入本地 `tmp/reduction/.../trunc/<id>`(或 `reduction_root_dir`),bounded result 中包含可 `read_file` 的绝对路径。