Repository navigation
fix(review-runs): size the combined evidence body, not the existing comment - #945
Conversation
…omment The append guard checked the existing comment against 50000, implying a maximum append of 15536 characters. Measured appends on the target's tracking issue reach 16947, so the guard could take the append branch on a body that overflows GitHub's 65536-character limit; the PATCH has no fallback, so a 422 drops the leg's findings while the run reports success. Build the combined body first and branch on its size.
tend-agent
left a comment
There was a problem hiding this comment.
The logic change is right: combined.md is exactly the body that gets PATCHed, so branching on its own size removes the implicit maximum-append assumption rather than re-tuning it, and wc -c on bytes is a safe over-estimate of the character limit. Two notes, neither blocking.
The comment carries the history of the check it replaces. CLAUDE.md's skill-authoring rules ask to "cut motivation, anecdotes, and historical context unless required to apply the rule" and to date-stamp values expected to drift — once the recipe sizes the combined body, that it used to size the existing comment, and that appends have been measured at 16 KB, aren't needed to apply it, and the 16 KB figure will age. What is missing from the recipe is why the bound is 60000 rather than 65536: the bytes-vs-characters reasoning lives only in the PR description. Inline suggestion swaps one for the other.
The spill and create-new branches still -F body=@/tmp/findings.md with no size check, which is the same silent-422 shape for a single leg's findings — remote today at a ~17 KB measured maximum, but it's the residual half of the failure mode this PR names. Worth leaving alone until findings grow, rather than adding a second threshold now.
review-runsappends each leg's findings to a single evidence comment on the monthly tracking issue, and guards the 65,536-character comment limit by checking the size of the comment before appending (review-runs/SKILL.md#L111-L112—EXISTING_SIZE=$(wc -c < /tmp/existing.md),-lt 50000). That threshold implies a maximum append of 15,536 characters. Appends are larger than that.Measured on
max-sixty/cargo-affected's tracking issue #73, splitting both evidence comments on their## Runheadings (character counts, not bytes):5150650688(Aug 1–7)5225265385(Aug 8–11)The Aug 10 append (run 31369370104) was 16,947 characters — 1,411 more than the headroom the guard leaves. Had it landed on a comment sized in
[48,590, 50,000), the guard would have taken the append branch and the PATCH would have exceeded 65,536. Appends have also grown steadily: ~4 KB on Aug 1, 12–17 KB since Aug 8.max-sixty/tend's own tracking issue #801 shows the same distribution (largest append 14,695).The failure mode is invisible.
gh api ... -X PATCHreturns 422 on an over-length body, the recipe has no fallback branch, and the surrounding step is notset -e— so the leg's findings are dropped and the run still reportssuccess. The next leg then reads a log missing its predecessor and counts occurrences against incomplete history.The fix sizes the body it is about to POST rather than a proxy for it, which removes the assumption entirely: build
/tmp/combined.mdfirst, branch on its size, spill to a new comment when it wouldn't fit.wc -ccounts bytes and bytes ≥ characters in UTF-8, so 60,000 is a conservative bound under the 65,536-character limit with room for the multi-byte overhead these bodies carry (~0.6%).No behavior changes when the append fits, which is the common case; the spill branch it already had is simply reached on the correct condition.
Gate assessment
append < 15,536) is falsified by measurement rather than inferred from behavior. Occurrences of a realized overflow: 0 — all 11 daily legs of August are present in the log on both repos, so no evidence has been lost yet. Occurrences of an append exceeding the guard's headroom: 1 of 11 on the target this month, with 5 more within 1 KB of it.| last) and #938 (window anchor), which touch the same recipe but not the size check.Window analyzed: 2026-08-11T08:11:35Z → 09:11:35Z on
max-sixty/cargo-affected, run 31476466100. Evidence log: https://gist.github.com/dca23a6e6a0d8cae2665944ba31676fb