Repository navigation
Closed
Labels
auto-readyCan be resolved via automated workflowbugSomething isn't workingready-for-reviewReady for code review
Description
Description
During sequant run, Claude's streamed output during phases (spec, exec, qa) appears truncated in several places, with characters or words cut off mid-stream.
Reproduction
npx sequant run 1 --quality-loop --verboseObserved Behavior
Multiple truncated strings in Claude's phase output:
| Observed | Expected |
|---|---|
autoLab and skipLabels |
autoLabels and skipLabels |
All state files are valid JN |
All state files are valid JSON |
Budget Constrain Satisfied |
Budget Constraints Satisfied |
the speposted to the issue |
the spec was posted to the issue |
These truncations appear in the streamed text from Claude's responses during phase execution, not in sequant's own output strings.
Possible Causes
- Streaming buffer issue: Characters dropped when the output capture buffer flushes mid-token
- Terminal rendering artifact: Spinner redraws overwriting partial output lines
- Subprocess stdout buffering: Claude Code subprocess output not fully flushed before the next read
- Related to #[spinner issue]: The spinner interleaving bug may also cause character loss, not just line garbling
Acceptance Criteria
- Claude's phase output is displayed without character or word truncation
- Long-running phases with spinner updates preserve all streamed text
- Investigate whether this shares a root cause with the spinner interleaving bug
Investigation Notes
- Truncations appear at irregular intervals (not at fixed positions), suggesting a timing-related buffer issue rather than a fixed-length truncation
- All truncated text is from Claude's responses, never from sequant's own log strings
- Issue may be more visible in verbose mode due to additional
console.log()calls competing for stdout
Context
Discovered during pm-projects experiment (sequant run 1 --quality-loop --verbose). May share a root cause with the spinner/verbose interleaving bug.
Metadata
Metadata
Assignees
Labels
auto-readyCan be resolved via automated workflowbugSomething isn't workingready-for-reviewReady for code review
Activity
fix(run): prevent output truncation during phase streaming
admarble commentedon Feb 18, 2026
/exec Progress Update
AC Coverage
src/commands/run.ts:1018-1097- Spinner paused once per streaming sessionRoot Cause
Identified: Ora's
stop()method (called byspinner.pause()) includesclear()which erases the current terminal line. In verbose mode, every streaming chunk triggered pause/resume, causing:The rapid line-clearing truncated text mid-stream.
Solution
Changed from per-chunk pause/resume to per-session pause/resume:
verboseStreamingActiveflag to track stateFiles Changed
src/commands/run.tsQuality Checks
npm run buildnpm run lintnpm testTest Coverage
src/commands/run.tssrc/commands/run.test.ts)PR
✅ Created: #290
Relation to Spinner Interleaving Bug
This shares root cause with spinner interleaving issues - both stem from ora's line-clearing behavior. The same fix (pausing spinner during output) addresses both concerns.
admarble commentedon Feb 18, 2026
QA Review for Issue #283
AC Coverage
verboseStreamingActiveflag pauses spinner once per streaming session, preventing truncation from rapid pause/resume cyclesstop()method (called bypause()) includesclear()which erases the current terminal lineCoverage: 3/3 AC items fully met
Quality Plan Verification
N/A - No quality plan found in issue comments
CI Status
build (18.x)build (20.x)build (22.x)typecheckvalidate-skillsvalidate-pluginCI Summary: 6 passed, 0 pending, 0 failed
Quality Metrics
any)Test Coverage Analysis
src/commands/run.tssrc/commands/run.test.tsCoverage: 1/1 changed source files have corresponding tests
Note: Existing tests cover utility functions. The streaming fix is behavioral and affects runtime terminal interaction (integration-level, not unit-testable).
Code Review
Strengths:
Issues:
Suggestions:
Anti-Pattern Detection
Dependency Audit
N/A - No dependency changes
Code Patterns
Critical Issues: 0
Warnings: 0
Execution Evidence
N/A - No CLI/script changes. The change is to internal streaming behavior in
executePhase().Self-Evaluation
Verdict: READY_FOR_MERGE
Rationale:
Documentation
Next Steps
/docs 283if any documentation is desired (not required for this internal fix)QA completed: All AC met, code quality is A+
admarble commentedon Feb 18, 2026
QA Review for Issue #283 (Re-run)
AC Coverage
verboseStreamingActiveflag pauses spinner once per streaming session, preventing truncation from rapid pause/resume cyclesstop()method (called bypause()) includesclear()which erases the current terminal lineCoverage: 3/3 AC items fully met
Quality Plan Verification
N/A - No quality plan found in issue comments
CI Status
build (18.x)build (20.x)build (22.x)typecheckvalidate-skillsvalidate-pluginCI Summary: 6 passed, 0 pending, 0 failed
Quality Metrics
any)Cache Status
N/A - Fresh run
Build Verification
N/A - Build passed
Test Coverage Analysis
src/commands/run.tssrc/commands/run.test.tsCoverage: 1/1 changed source files have corresponding tests
Note: Streaming fix is behavioral (terminal interaction) — not unit-testable without terminal mocking. Existing tests cover utility functions.
Code Review
Strengths:
executePhasefunctionIssues:
Suggestions:
Test Quality Review
N/A - No test files modified
Anti-Pattern Detection
Dependency Audit
N/A - No dependency changes
Code Patterns
No anti-patterns detected. Clean implementation using optional chaining (
spinner?.pause()).Critical Issues: 0
Warnings: 0
Execution Evidence
N/A - No standalone scripts or CLI changes
Skill Command Verification
N/A - No skill files changed
Self-Evaluation
for awaitloop, spinner stays paused until function exits. Minor impact since catch block handles cleanup.Verdict: READY_FOR_MERGE
All 3 AC items fully met. CI passes on all Node versions (18, 20, 22). Code quality is high with clear documentation. Minimal, focused change with no side effects.
Documentation
Next Steps
QA re-run completed: All AC met, CI fully green
fix(run): prevent output truncation during phase streaming (#290)
admarble commentedon Feb 18, 2026
Documentation Review Complete
This issue is an internal bug fix (streaming output truncation). No new user-facing features or flags were added — the fix makes existing
--verbosemode work correctly.Status:
--verbosemode indocs/reference/run-command.mdNo documentation changes required.
docs: update what-weve-built and run-command for v1.15.1 changes