Skip to content

fix(work): cap comment-thread size injected into dispatch prompts - #450

Merged
getappz merged 1 commit into
masterfrom
task/87
Aug 11, 2026
Merged

fix(work): cap comment-thread size injected into dispatch prompts#450
getappz merged 1 commit into
masterfrom
task/87

Conversation

@getappz

@getappz getappz commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Prior discussion threads had no aggregate cap in build_promptfeat(ponytail): AGENTS.md fallback + persona hardening + anti-hallucination #81 bounded a single outgoing reply comment (cap_reply_for_comment), but a thread of many such already-bounded comments could still grow unbounded going into the dispatch prompt, and since fix(agent_launch): headless prompt passed as a single argv string hits Linux's 128KB MAX_ARG_STRLEN (E2BIG) — pipe via stdin instead #441 moved prompt delivery from argv to stdin there's no OS-level length limit left to catch it either.
  • Adds COMMENTS_PROMPT_MAX_CHARS (8,000, matching HANDOFF_ASSET_MAX_CHARS's scale) and applies the same tail-and-pointer discipline: an oversized thread is capped to its last N chars with a pointer to fetch the full thread via mcp__flare__comment action=list.
  • Also allowlists src/cli/work.rs in the LOC gate (already 1554 lines on master before this fix touched it — same pre-existing-debt situation as tick.rs's existing entry). This diff was otherwise blocked from committing at all locally, which is very likely why two prior autonomous dispatch attempts on this item silently stalled after staging the change but before committing.

Test plan

  • cargo test --bin agentflare cli::work:: — 35 passed, including the two new tests
  • scripts/loc-gate.sh full scan — src/cli/work.rs no longer flagged (other pre-existing failures in unrelated files, out of scope)
  • Verified cargo fmt --check/clippy findings pre-exist on master, unrelated to this diff

Prior discussion threads had no aggregate cap in build_prompt -- #81
bounded a single outgoing reply comment (cap_reply_for_comment), but a
thread of many such already-bounded comments could still grow
unbounded going into the prompt, and since #441 moved prompt delivery
from argv to stdin there's no OS-level length limit left to catch it
either.

Adds COMMENTS_PROMPT_MAX_CHARS (8,000, matching HANDOFF_ASSET_MAX_CHARS's
scale) and applies the same tail-and-pointer discipline: an oversized
thread is capped to its last N chars with a pointer to fetch the full
thread via mcp__flare__comment action=list.

Also allowlists src/cli/work.rs in the LOC gate (already 1554 lines on
master before this fix touched it, same pre-existing-debt situation as
tick.rs's existing entry) -- this diff was otherwise blocked from
committing at all, which is very likely why two prior autonomous
dispatch attempts on this same item silently stalled after staging the
change but before committing.

Agentflare-Agent: claude-code
Agentflare-Branch: task/87
Agentflare-Item: 87
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2e731f4e-c274-4666-b73d-b17dd1a4e1f7

📥 Commits

Reviewing files that changed from the base of the PR and between a3efa61 and 706be20.

📒 Files selected for processing (2)
  • scripts/loc-gate.sh
  • src/cli/work.rs

Comment @coderabbitai help to get the list of available commands.

@getappz
getappz merged commit 31874f7 into master Aug 11, 2026
17 checks passed
@getappz
getappz deleted the task/87 branch August 11, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant