Skip to content

review: aggregate size-budget guard across optional comment collapsibles #6069

Description

@JSONbored

Part of #6065.

Problem

A maximally-featured PR can carry up to ~18 independent <details> blocks in the converged comment (Nits, Copy-for-AI-agents, Flagged checks, Linked issue satisfaction, Review context, Contributor next steps, Signal definitions, Chat, Manifest validation, Auto-merge readiness, Changed files, Finding categories, Impact map, Fix handoff, Visual findings/preview, Scroll preview), each capping ITS OWN size independently (e.g. changed-files alone up to 200 rows / 30KB, unified-comment-bridge.ts:531-532) with no shared budget across sections. deterministicBody flows straight from buildUnifiedCommentBody/buildPublicPrIntelligenceComment into createOrUpdatePrIntelligenceComment (src/queue/processors.ts:10366-10374) with no length check anywhere in between -- a comment that trips GitHub's real body-size limit fails the PATCH/POST silently (caught, logged to failedOutputs, never retried with a trimmed body).

Proposed fix

  • Add an aggregate byte-budget check over the fully-assembled comment body, comfortably under GitHub's real per-comment limit.
  • When over budget, drop the LOWEST-priority optional collapsibles first, in a defined priority order -- disposition-relevant content (headline, chips, Suggested Action, blockers, per-blocker AI context, decision-driver chips/gate result) must NEVER be droppable.
  • Log which sections were dropped (so it's debuggable, not silently lossy).
  • Add tests exercising a maximally-featured PR (every optional collapsible + a large changed-files table) to confirm the guard trips correctly and the protected sections survive.
  • Out of scope for this issue: a hosted "full report" page to link out to for the dropped detail -- no such per-PR dashboard view exists yet (checked: only /v1/app/maintainer-dashboard and /v1/repos/:owner/:repo/pulls/:number/maintainer-packet exist today, both maintainer-only API endpoints, not a public per-PR page). That's a bigger separate feature; file it as its own issue if wanted later.

Files

  • src/review/unified-comment.ts / unified-comment-bridge.ts
  • src/queue/processors.ts (~10366-10374)
  • src/github/comments.ts

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions