Skip to content

fix: enforce 10-file cap across all transcript lines in precompact#140

Merged
claude[bot] merged 1 commit intomainfrom
claude/issue-137-20260227-1820
Feb 27, 2026
Merged

fix: enforce 10-file cap across all transcript lines in precompact#140
claude[bot] merged 1 commit intomainfrom
claude/issue-137-20260227-1820

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Feb 27, 2026

Fixes a bug where filesInFocus in cmd/precompact.go could exceed the intended 10-file cap when processing long transcripts.

The break inside the inner strings.Fields word loop only exited that inner loop. The outer loop over transcript lines continued processing, appending unique file paths from subsequent lines even after the cap was reached.

Fix: Added a guard at the top of the outer loop to stop processing once len(filesInFocus) >= 10.

Closes #137

Generated with Claude Code

The break in the inner word loop only exited that loop, allowing
filesInFocus to grow unboundedly across many transcript lines.
Add a guard at the top of the outer loop to stop processing once
the 10-file cap is reached.

Fixes #137

Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@claude claude bot merged commit f8a1d14 into main Feb 27, 2026
1 check passed
@claude claude bot deleted the claude/issue-137-20260227-1820 branch February 27, 2026 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: filesInFocus in precompact.go can exceed 10-file cap across multiple transcript lines

0 participants