Repository navigation
🤖 Deferred review findings from the tool-cap and compaction-trim PRs (#6312, #6324) #6353
Description
Review findings deferred while fixing the #6247 follow-ups in #6312 (tool output caps) and #6324 (compaction input trim). Each one is valid but does not block: it is no worse than main before those PRs, or it is rare. Each item names the PR whose code it changes.
Tool output caps (#6312)
-
A foreground
task(run_in_background: false) still returns the sub-agent report whole in its result, with no paging. Found while fixing 🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312. Done in 🤖 fix: page foreground task reports and stop repeating unbounded fields on later pages #6427. -
Bound the background-bash log read itself (local probe and remote
tail, UTF-8-safe), so a read loads at most a page from disk. 🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312 caps only the unread output kept in memory (64 KB). Each later page reads the rest of the file again, so draining a large log page by page reads it repeatedly (O(N²) disk reads). Found by Codex on 🤖 fix: trim an over-window compaction request instead of failing it #6324. Done in 🤖 fix: read background output in bounded, UTF-8-safe pages #6435 and 🤖 fix: page through background-bash logs without rereading them #6439. -
skills_catalog_readpages: return the skill's frontmatter only on the first page, or bound it. Itslicenseandmetadatastrings are unbounded, so a huge frontmatter repeats on every page. Found in round 4 of 🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312. Done in 🤖 fix: page foreground task reports and stop repeating unbounded fields on later pages #6427. -
task_awaitreport pages: return a workflow'sstructuredOutputonly on the first page, or bound it. Eachoffset_charspage repeats it today. Found in round 5 of 🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312. Done in 🤖 fix: page foreground task reports and stop repeating unbounded fields on later pages #6427. -
Task card report pages: keep the later pages when the agent rereads an earlier
offset_chars. Today the card shows a shorter report while the await rows stay hidden. Found in round 6 of 🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312. Done in 🤖 fix: page foreground task reports and stop repeating unbounded fields on later pages #6427. -
Background-bash capped reads: say in the note whether the next part starts a new line or continues the same line, so line-oriented output such as JSONL rebuilds exactly. Found in round 6 of 🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312. Done in 🤖 fix: say whether a capped bash read's next part continues the line #6436.
-
Background-bash memory limit (🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312): the 64 KB limit holds only when the dropped text maps 1:1 onto raw bytes. After a U+FFFD (binary output, or a read that ends inside a character) more stays in memory, as on
main. Fix the comment atbackgroundProcessManager.ts("at most this many pages") or tighten the limit. Found in the second 🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312 review. Done in 🤖 fix: read background output in bounded, UTF-8-safe pages #6435 and 🤖 fix: page through background-bash logs without rereading them #6439. -
Remote background-bash reads can lose a BOM: when a rewind lands on a line that starts with U+FEFF,
streamToString'sTextDecoderstrips it and 3 bytes come back twice. Fix:new TextDecoder("utf-8", { ignoreBOM: true }). Very rare. Found in the second 🤖 fix: cap background-bash reads, task reports and catalog skill bodies #6312 review. Done in 🤖 fix: read background output in bounded, UTF-8-safe pages #6435. -
Task card (🤖 fix: page foreground task reports and stop repeating unbounded fields on later pages #6427): after a
task_send_messagere-send to the same task ID, an older foreground card can show the new attempt's joined report, because its own first page gives way to the linked join. Make the card's own first page win when the linked join did not start from it. Background cards already behave this way onmain. Found by the 🤖 fix: page foreground task reports and stop repeating unbounded fields on later pages #6427 merge advisor. -
Task card (🤖 fix: page foreground task reports and stop repeating unbounded fields on later pages #6427): a child that the user wakes by typing in its workspace leaves no send in the parent's transcript, so the card does not start a new join for that attempt.
-
Task card (🤖 fix: page foreground task reports and stop repeating unbounded fields on later pages #6427): a report read out of order (a later page, then page 0, then a middle page) keeps await rows that repeat text the card already shows. Nothing is hidden.
Compaction input trim (#6324)
Each item ends in the same terminal context_exceeded error that main gives today, or affects replay only.
- Size a tool record typed
mediaonly when it has the validated media shape (asextractToolMediaAsUserMessageschecks). Today an invalid one is charged as one attachment and its text is not counted. Done in 🤖 fix: size compaction input the way the provider receives it #6429. - Record a refusal-fallback model's own compaction budget on its DevTools run, so replay rebuilds the same request. Done in 🤖 fix: budget compaction retries and fallbacks by the model that ran #6430.
- Count MCP Apps request-only context in the compaction budget. Today it is added after the trim. Done in 🤖 fix: budget compaction retries and fallbacks by the model that ran #6430.
- Derive the compaction retry plan from the model that overflowed (a refusal fallback), not from the original model. Done in 🤖 fix: budget compaction retries and fallbacks by the model that ran #6430.
- Size SVG attachments as the text they become (
inlineSvgAsTextForProvider), not as one 1,024-token image. Found in round 5. Done in 🤖 fix: size compaction input the way the provider receives it #6429. - Run
sanitizeToolInputsbefore sizing, so a malformed tool input is not counted at full size. Found in round 5. Done in 🤖 fix: size compaction input the way the provider receives it #6429. - A compact-agent resume without compaction metadata on a 1M-capable model skips the first-attempt trim but gets no retry. Trim on the first attempt when no retry is registered. Found in round 5. Done in 🤖 fix: budget compaction retries and fallbacks by the model that ran #6430.
- The placeholder's "about N tokens" counts the whole tool part, including its input, so it overstates the result's size. Count the output only. Found in the final 🤖 fix: trim an over-window compaction request instead of failing it #6324 review. Done in 🤖 fix: size compaction input the way the provider receives it #6429.
- With OpenAI
store=true, a trimmed request keeps afunction_callitem ID whose reasoning item was removed. Not a bug: no item ID is sent. The SDK sends a plainfunction_callwithcall_idonly, Xum persists no provider metadata on text or tool parts, andattachReasoningReplayMetadataremoves the reasoningitemIdbefore the request is built. A request probe found noitem_referenceand noidwithstoreat its default (true for direct OpenAI) or false, trimmed or not.
Owner: ThomasK33. Trigger: the next change to background-bash reads or to compaction input sizing picks up the items of its area.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $140.35
Activity
🤖 fix: budget compaction retries and fallbacks by the model that ran (c…
🤖 fix: size compaction input the way the provider receives it (coder#…
🤖 fix: say whether a capped bash read's next part continues the line (c…
🤖 fix: read background output in bounded, UTF-8-safe pages (coder#6435)
🤖 fix: page foreground task reports and stop repeating unbounded fiel…
🤖 fix: page through background-bash logs without rereading them (code…