Skip to content

fix(run): the PR body's imported exec text is cut at 4,000 characters with no marker — #1577 and #1578 both ended mid-word and read as complete #1582

Open

Description

@admarble

Problem

capImportedText (src/lib/workflow/worktree-manager.ts:2342, added in #1297) limits the exec text imported into a PR body to EXEC_SUMMARY_MAX_LENGTH (4,000 characters). Both callers use it: the ## Summary section (extractExecSummary, :2333) and the AC table (:2405). When the cap applies, the text stops at character 4,000 with no sign that anything was cut, often in the middle of a word. A cut-off body reads as complete.

This happened twice on 2026-10-21. #1577's body ended at "most of the 41 converted files have no test that ex", and #1578's at "`qa-markdown-on". Both were found only because the runner read each body to the end, and both were fixed by hand. A reviewer who stops at a clean-looking end won't know the rest is missing, for example the pre-PR confidence check or the coverage-gap notes.

The cap itself stays. It exists so a runaway section can't bloat the body (#1297). This issue adds only the signal.

Acceptance Criteria

  • AC-1: A capped text ends with a visible marker that says it was cut, e.g. … (exec text cut at 4,000 characters). The marker applies to both callers, since both go through capImportedText. Evidence: npx vitest run src/lib/workflow/worktree-manager.build-pr-body.test.ts -t "cut marker" → ≥ 1 passed, 0 failed (new case; today it matches no test)
  • AC-1 is classified as a gate test by isGateTestEvidence; the PR body carries its SEQUANT_MUTATION record (remove the marker from capImportedText → the new test fails; restore).
  • AC-2: Text under the cap is unchanged, and the fix(run): PR body falls back to the placeholder when exec writes no "## Summary" heading, dropping exec's mutation markers and AC table #1297 comment guard still holds: a cut inside <!-- drops the partial comment, and the markers are re-appended whole after the cut marker. Evidence: npx vitest run src/lib/workflow/worktree-manager.build-pr-body.test.ts → 0 failed (59 pass today)
  • AC-3: The cap still bounds the body: the capped text plus the marker is at most EXEC_SUMMARY_MAX_LENGTH plus the marker's length. Evidence: the existing "caps a runaway summary to ~4KB" case (worktree-manager.build-pr-body.test.ts:245, which today asserts length is exactly 4000) is updated to assert the new bound and that the text ends with the marker; npx vitest run src/lib/workflow/worktree-manager.build-pr-body.test.ts -t "caps a runaway summary" → 1 passed, 0 failed

May touch

src/lib/workflow/worktree-manager.ts (capImportedText only), src/lib/workflow/worktree-manager.build-pr-body.test.ts, CHANGELOG entry.

Non-Goals

  • Changing the 4,000-character cap or which sections are imported.
  • Cutting at a word or sentence boundary. Nice to have, but the marker is what tells a reader text is missing.
  • No edits under plugin/, .claude/skills/, templates/skills/ (plugin freeze).

Activity

  1. added
    bug
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions