You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Source: static audit of main@384439634. Candidates are static and not reproduced — confirm each before changing code.
Template: agent-task (agent-ready, docs/ISSUE_TRIAGE.md). Labels: bug, agent-ready.
Goal / Why
Network responses, files, child pipes, and artifact reads are consumed with .text()/read_to_string/read_to_end (or a growing buffer) before any size bound. A single oversized response, artifact, or pipe can OOM the process or wedge a worker, and several paths buffer the whole body before they even consult the configured cap. The sources differ (HTTP, filesystem, child stdin/stdout, artifact store) but the failure mode is the same and the fix is one bounded reader. Apply a byte cap with a truncation note at ingest, not after materialising content.
Confirmed static findings in this class: 23 (reassessed severity noted per line).
Scope / Plan
Re-read each candidate below at the cited file:line on current main; drop anything already fixed or misread.
Apply a bounded reader (byte cap + truncation note) at every listed site before materialising content; add a regression test per reader.
Add the smallest regression/gate that would catch a re-introduction (focused test, budget script, or grep guard).
Key files
crates/tui/src/tools/web_run.rs
crates/tui/src/skills/audit.rs
crates/tui/src/skills/mod.rs
crates/tui/src/skills/install.rs
crates/tui/src/repl/runtime.rs
crates/tui/plugins/computer-use/mcp/server.mjs
crates/tui/src/tui/diff_render.rs
crates/tui/src/tui/history/tool_output.rs
crates/tui/src/tui/widgets/workflow_panel.rs
crates/tui/src/tools/fetch_url.rs
crates/tui/src/tools/truncate.rs
crates/tui/src/tools/tool_result_retrieval.rs
crates/tui/src/client/anthropic.rs
crates/tui/src/client/responses.rs
Acceptance criteria
Every listed candidate is either fixed with a test, or downgraded with a written reason in the PR.
No new instance of this class is introduced (guarded by the test/budget).
Existing behavior for unrelated paths is unchanged.
Verification
cargo check -p codewhale-tui -p codewhale-cli -p codewhale-release -p codewhale-telemetry -p codewhale-workflow-js
cargo test -p codewhale-tui --lib
cargo clippy --workspace --all-targets --locked -- -D warnings
( cd web && npm run check )
( cd integrations/bridge-core && npm run test )
Out of scope
Findings that belong to another systemic class or to the localized backlog.
D03-07 · D03 — Git/GitHub/review/web tools · crates/tui/src/tools/web_run.rs:367 — operation fan-out and .text() bodies are unbounded; one model call can exhaust memory/network. audit severity: high; reassessed: major
F02-02 · F02 — Skills, hooks, LSP, snapshots, REPL, RLM, work graph · crates/tui/src/skills/audit.rs:426, crates/tui/src/skills/mod.rs:503 — special/unbounded files can hang/OOM audit/discovery. audit severity: high; reassessed: major
F02-04 · F02 — Skills, hooks, LSP, snapshots, REPL, RLM, work graph · crates/tui/src/skills/install.rs:557 — remote download fully buffers response before the max_size check. audit severity: high; reassessed: major
F02-06 · F02 — Skills, hooks, LSP, snapshots, REPL, RLM, work graph · crates/tui/src/repl/runtime.rs:292 — stdout unbounded and stderr drained after round, allowing OOM/deadlock. audit severity: high; reassessed: major
CU01-09 · CU01 — Computer-use · crates/tui/plugins/computer-use/mcp/server.mjs:1319 — JSON-lines/socket/CDP frames and screenshots unbounded. audit severity: high; reassessed: major
U04-01 · U04 — History, transcript, markdown, diff, streaming · crates/tui/src/tui/diff_render.rs:49, crates/tui/src/tui/history/tool_output.rs:379 — huge tool output/diff materializes all wrapped rows and unbounded summary before head/tail. audit severity: high; reassessed: major
D01-08 · D01 — Shell/file/read/search tools · crates/tui/src/tools/fetch_url.rs:520 — JSONPath fan-out does not bound fields/matches/serialized result. audit severity: major; reassessed: major
D01-09 · D01 — Shell/file/read/search tools · crates/tui/src/tools/truncate.rs:530 — on artifact publication failure the original unbounded result returns to model context. audit severity: major; reassessed: major
D01-10 · D01 — Shell/file/read/search tools · crates/tui/src/tools/tool_result_retrieval.rs:137 — retrieval fully reads artifact before applying max_bytes; a single giant line already bloats memory. audit severity: major; reassessed: major
T02-05 · T02 — Model HTTP/SSE clients · crates/tui/src/client/anthropic.rs:314, crates/tui/src/client/responses.rs:258 — endless small SSE chunks bypass idle timer and grow buffer without cap. audit severity: major; reassessed: major
T04-11 · T04 — Config, credentials, sandbox, trust · crates/tui/src/sandbox/opensandbox.rs:94 — response body unbounded/raw, cancellation is not propagated to remote exec. audit severity: major; reassessed: major
R02-03 · R02 — CLI, build-support, release/update · crates/cli/src/update.rs:1561, crates/release/src/lib.rs:256 — .bytes/.text unbounded and raw error body printed to terminal. audit severity: major; reassessed: major
Goal / Why
Network responses, files, child pipes, and artifact reads are consumed with
.text()/read_to_string/read_to_end(or a growing buffer) before any size bound. A single oversized response, artifact, or pipe can OOM the process or wedge a worker, and several paths buffer the whole body before they even consult the configured cap. The sources differ (HTTP, filesystem, child stdin/stdout, artifact store) but the failure mode is the same and the fix is one bounded reader. Apply a byte cap with a truncation note at ingest, not after materialising content.Confirmed static findings in this class: 23 (reassessed severity noted per line).
Scope / Plan
file:lineon currentmain; drop anything already fixed or misread.Key files
crates/tui/src/tools/web_run.rscrates/tui/src/skills/audit.rscrates/tui/src/skills/mod.rscrates/tui/src/skills/install.rscrates/tui/src/repl/runtime.rscrates/tui/plugins/computer-use/mcp/server.mjscrates/tui/src/tui/diff_render.rscrates/tui/src/tui/history/tool_output.rscrates/tui/src/tui/widgets/workflow_panel.rscrates/tui/src/tools/fetch_url.rscrates/tui/src/tools/truncate.rscrates/tui/src/tools/tool_result_retrieval.rscrates/tui/src/client/anthropic.rscrates/tui/src/client/responses.rsAcceptance criteria
Verification
Out of scope
Related existing work (do not duplicate)
#6147 (bound engine channels), #6333 (read budgets), #6504 (sub-agent input cap), #6540 (compaction), #5404/#5468 (SSE tail fail-closed)
Candidate findings (23)
crates/tui/src/tools/web_run.rs:367— operation fan-out and.text()bodies are unbounded; one model call can exhaust memory/network.audit severity: high; reassessed: major
crates/tui/src/skills/audit.rs:426,crates/tui/src/skills/mod.rs:503— special/unbounded files can hang/OOM audit/discovery.audit severity: high; reassessed: major
crates/tui/src/skills/install.rs:557— remote download fully buffers response before themax_sizecheck.audit severity: high; reassessed: major
crates/tui/src/repl/runtime.rs:292— stdout unbounded and stderr drained after round, allowing OOM/deadlock.audit severity: high; reassessed: major
crates/tui/plugins/computer-use/mcp/server.mjs:1319— JSON-lines/socket/CDP frames and screenshots unbounded.audit severity: high; reassessed: major
crates/tui/src/tui/diff_render.rs:49,crates/tui/src/tui/history/tool_output.rs:379— huge tool output/diff materializes all wrapped rows and unbounded summary before head/tail.audit severity: high; reassessed: major
crates/tui/src/tui/widgets/workflow_panel.rs:777— attackerchild_countcauses huge allocation/OOM.audit severity: high; reassessed: major
crates/tui/src/tools/fetch_url.rs:520— JSONPath fan-out does not bound fields/matches/serialized result.audit severity: major; reassessed: major
crates/tui/src/tools/truncate.rs:530— on artifact publication failure the original unbounded result returns to model context.audit severity: major; reassessed: major
crates/tui/src/tools/tool_result_retrieval.rs:137— retrieval fully reads artifact before applyingmax_bytes; a single giant line already bloats memory.audit severity: major; reassessed: major
crates/tui/src/client/anthropic.rs:314,crates/tui/src/client/responses.rs:258— endless small SSE chunks bypass idle timer and grow buffer without cap.audit severity: major; reassessed: major
crates/tui/src/sandbox/opensandbox.rs:94— response body unbounded/raw, cancellation is not propagated to remote exec.audit severity: major; reassessed: major
crates/tui/src/acp_server.rs:94— ACP lines/text/tool JSON/history unbounded, invalid UTF-8 terminates server.audit severity: major; reassessed: major
crates/tui/src/runtime_api.rs:841— managed Fleet does not limit task count/aggregate workflow size.audit severity: major; reassessed: major
crates/tui/src/tui/file_frecency.rs:132— sync global-mutex FS, no per-workspace key, unbounded JSONL.audit severity: major; reassessed: major
crates/cli/src/update.rs:1561,crates/release/src/lib.rs:256—.bytes/.textunbounded and raw error body printed to terminal.audit severity: major; reassessed: major
crates/telemetry/src/actor.rs:75— Unbounded telemetry queue + append/sync per event allows memory pressure.audit severity: major; reassessed: major
crates/telemetry/src/buffer.rs:246— Telemetry buffer read_to_string unbounded and fails on invalid UTF-8.audit severity: major; reassessed: major
crates/workflow-js/src/vm.rs:199— Untrusted source/args unbounded before QuickJS; recursive Fleet validation before depth cap; textualworkflowdecoy.audit severity: major; reassessed: major
crates/tui/src/tui/gate_receipts.rs:51— Auto-Review risk unbounded/control-containing.audit severity: minor; reassessed: medium
web/app/[locale]/digest/page.tsx:48— Malformed KVsections:nullfails; list/reads/sections unbounded.audit severity: major; reassessed: major
web/lib/deepseek.ts:28— LLM request without timeout and unbounded errorres.text().audit severity: major; reassessed: major
integrations/bridge-core/src/lib.mjs:430— SSE only newline-newline, unbounded buffer, EOF accepted without terminal/thread identity.audit severity: high; reassessed: high