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

Open Beginner friendly
#1,582 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript

Research direction

Read capImportedText in src/lib/workflow/worktree-manager.ts and the related cases in src/lib/workflow/worktree-manager.build-pr-body.test.ts. Run npx vitest run src/lib/workflow/worktree-manager.build-pr-body.test.ts to see the current behavior. Add a visible cut marker for both callers while preserving under-cap text, comment guards, and the stated length bound; update the changelog entry.

Written by the indexing model from the issue text.

Description

bug

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 #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).
Dominant language
TypeScript
Stars
1
Forks
1
Avg merge
11h 3m
Merged PRs (30d)
84

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sequant-io/sequant

All issues in sequant-io/sequant

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.