Skip to content

fix(#1311): drivers join agent text on line boundaries, so exec's ## Summary reaches the PR body - #1340

Merged
admarble merged 2 commits into
mainfrom
feature/1311-fix-driver-text-join
Oct 6, 2026
Merged

admarble merged 2 commits into
mainfrom
feature/1311-fix-driver-text-join

Conversation

@admarble

@admarble admarble commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Exec's ## Summary reaches the sequant run PR body again. The Claude Code driver, and the Codex and opencode stream parsers, joined the agent's text messages with "". A message ending mid-line glued onto exec's final summary, so extractExecSummary's line-anchored heading never matched. All four runs on 2026-10-05 (PRs #1317–#1320) opened with the placeholder body.

AC Status Evidence
AC-1 ✅ Cause recorded on #1311: capturedOutput += textContent in claude-code.ts. Reproduced on the #1309 run: "Now the edits." + "## Summary…" gives null from the extractor, and joining with "\n" gives 2,446 chars.
AC-2 ✅ New drivers/agent-text.ts: appendAgentText / joinAgentTexts insert a newline only where one is missing. Used by ClaudeCodeDriver (across messages, and across text blocks within one), CodexStreamParser and OpencodeStreamParser. Aider streams raw stdout, so it's unaffected. Fixture tests: agent-text.test.ts (the #1309 run's two messages, plus codex and opencode streams) and a claude-code.test.ts driver case.
AC-3 ✅ The placeholder warning now reads PR body for #N: exec output (K chars) has no Summary or mutation markers; using placeholder. It is printed with console.log, like createPR's own warnings, because the per-issue log is a no-op in parallel mode, which is every MCP run. That is why #1297's warning never appeared on any of today's runs. Test: batch-executor.test.ts, parallel case. Interpretation: "run log" is read as the run's output (what sequant_run returns in rawOutput), not the JSON run-log file, which has no free-text field.

Verification: /verify replayed the four real exec transcripts from today. The old join loses the summary in all four (the placeholder); the fixed join recovers 2,446 / 2,562 / 4,000 (the existing cap) / 2,876 chars. Human-confirmed, evidence on #1311.

Mutation-verified: AC-2 — made appendAgentText never insert a newline; agent-text.test.ts (4 cases) and the claude-code.test.ts #1311 case failed, the no-op-join cases passed; restored.

Mutation-verified: AC-3 — routed the placeholder warning back through the parallel-muted log; only the #1311 AC-3 parallel case failed; restored.

Checks: tsc --noEmit and eslint pass. The targeted vitest run (drivers/, batch-executor.test.ts) passes: 17 files, 436 tests. I didn't run the full suite locally; CI runs it.

Not run through sequant run: a run would have hit this bug while fixing it. Made directly on a branch.

Fixes #1311

🤖 Generated with Claude Code

…xec's ## Summary reaches the PR body

ClaudeCodeDriver, CodexStreamParser and OpencodeStreamParser joined the agent's text messages with "", so a message ending mid-line glued onto exec's final ## Summary and extractExecSummary's line-anchored heading never matched (4 of 4 runs on 2026-10-05 got the placeholder body). A shared appendAgentText/joinAgentTexts inserts a newline only where one is missing. The placeholder warning now prints in parallel mode (every MCP run, where the per-issue log is a no-op) and names the exec output's length.

Claude-Session: https://claude.ai/code/session_01B4TQvM2Ps5mc4jFgHB99bw
Entire-Checkpoint: c20e814fca93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant