Conversation
… asset
parse_claude_reply's fallback returns the entire raw captured stdout when a
headless run's last line isn't the expected {"result": ...} JSON shape, and
format_success_comment embedded that unbounded. Item #78 hit a 1,068,249-char
comment thread this way from a stream-json transcript with no valid trailing
result line.
cap_reply_for_comment now caps the reply to DIAGNOSTIC_TAIL_CHARS (reusing
agent_launch's existing tail-only-capped-diagnostic constant/helper) before
it reaches the comment; anything over budget is staged in
~/.agentflare/staging/ and attached to the item as a versioned asset via
asset_impl, with the comment carrying a bounded tail preview plus a pointer
to the asset instead of the raw dump. release_and_comment's failure path was
already bounded the same way via diagnostic_suffix, so it needed no change.
Agentflare-Agent: claude-code
Agentflare-Branch: task/81
Agentflare-Item: 81
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
Committed as
3cb83f9.Summary
Root cause confirmed:
parse_claude_reply's fallback (work.rs) returned the entire raw captured stdout unbounded whenever a headless Claude Code run's last line wasn't the expected{"result": ...}JSON shape, andformat_success_commentembedded that unbounded reply directly into the item comment — this is exactly what produced item #78's 1,068,249-char comment thread.Fix:
cap_reply_for_comment(mcp, item_id, reply)insrc/cli/work.rs, called just beforeformat_success_commentinexecute_work's success branch.agent_launch::DIAGNOSTIC_TAIL_CHARS(2000 chars) rather than inventing a new constant — same precedent the failure-diagnostic path already uses (tail-only, capped). Made it andtail_strpub(crate)so both paths share one definition.~/.agentflare/staging/and attached to the item viaasset_impl(action=attach) — the same mechanismmcp__flare__assetexposes — and the comment carries only a bounded tail preview plus a pointer to the asset id (fetch via mcp__flare__asset action=get id=...).release_and_comment/notify: their failure-message input is already bounded viadiagnostic_suffix's existing 2000-char cap, so no change was needed there — confirmed by tracing every caller.item_done'ssummary(PR body) untouched — out of scope per the task's explicit instruction not to conflate with [ponytail#303] Log errors to stderr, never swallow silently #70/[ponytail#99] Bare /ponytail reports active mode, doesn't reset #75.Tests added (both pass):
cap_reply_for_comment_leaves_a_reply_within_budget_unchanged— small replies pass through untouched, no I/O.cap_reply_for_comment_offloads_an_oversized_reply_to_a_retrievable_asset— feeds a 450KB raw string (item [ponytail#523] Numbered review and audit findings in output #78's shape), asserts the comment body stays far under the raw size, and verifies the full original content is byte-for-byte retrievable via the attached asset.Full
cargo build, andcargo testforcli::work::(29 tests) andagent_launch::(23 tests) all pass — 52/52.