Skip to content

fix(claude): move the transcript import's commit batching into its own file to clear max-lines - #51292

Merged
AmoabaKelvin merged 2 commits into
mainfrom
fix/claude-transcript-import-plan-max-lines
Nov 28, 2026
Merged

AmoabaKelvin merged 2 commits into
mainfrom
fix/claude-transcript-import-plan-max-lines

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

One Claude transcript file grew past the 300-line limit after two recent merges, which fails the max-lines check on every open PR. This moves one self-contained step out of it, with no behaviour change.

Files Added Deleted Net
Test 0 0 0 0
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​90 $\color{#cf222e}{\Huge{\mathbf{−}}}$​56 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34

What Changed

  • claude-transcript-import-plan.ts (305 → 261 lines): finish() now hands the collected rows to a new claudeTranscriptImportBatches() instead of building the commits inline.
  • claude-transcript-import-batches.ts (new): the moved code, unchanged. It marks rows that revise saved items, expects the untouched dependencies on the first commit, adds the "continued outside" divider before the first created row, revises or pushes each row, then finishes the batch with the same key.

Why

config/max-lines-baseline.txt is a ratchet that may only shrink, so the file has to be split rather than allow-listed. Turning rows into catch-up commits is the one step of the import plan that needs nothing from its closure except values passed in, so it moves cleanly and keeps the row-by-row restore logic in one place.

Linked Issue

None. #48929 and #47819 together took the file over the limit; #51272 fixed the type error from the same merges.

Visual Proof

N/A. Nothing visible changes; the code moved as is.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

The existing transcript tests cover this path, including claude-transcript-compaction-catch-up.test.ts (5 files, 17 tests pass). Node typecheck passes. No test added: nothing changed in behaviour.

Performance

None, because the same code runs in the same order; only one function boundary was added.

Risk

Low. The moved code is unchanged and keeps its order: the cancellation check before batch.finish is still there, and no new check was added. Back out with a plain revert.

Level: Low

AI Disclosure

Review

Self-reviewed against the original block line by line.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The import plan now delegates catch-up batch construction and completion to claudeTranscriptImportBatches. The helper handles dependency expectations, continuation notices, saved-row revisions, other-row pushes, pauses, input checks, and final plan metadata.

Merge Risk: Minimal · up to c692c

This is a refactor that moves transcript import batching into its own file to meet the line-count limit. No behavior change or performance impact is evidenced, and it looks safe to merge once the normal checks pass.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the transcript import's commit batching moved into its own file to clear the max-lines check. It also uses the conventional fix(claude) prefix. The title is 94 charact…
Description check Passed The description follows the template sections (ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, Checklist) and expla…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the transcript import's commit batching moved into its own file to clear the max-lines check. It also uses the conventional fix(claude) prefix. The title is 94 characters, slightly long, but it is still specific and accurate to the changeset.

Full details: Description check

Explanation

The description follows the template sections (ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, Checklist) and explains the split, the reason for it, and the low risk. Gaps: the Linked Issue section says 'None' even though the template requires an issue for outside contributors (the author may be a maintainer, so this may be acceptable). The 'None, because' Performance line is filled in. The AI Disclosure section is empty. The Testing section leaves manual testing unchecked, and the lint, typecheck, test, and build checklist item is unchecked. The description also cites the test file result but does not fully state the Node typecheck outcome beyond 'passes'.

Resolution

Optionally confirm the Linked Issue requirement applies (the author appears to be a maintainer), complete or remove the empty AI Disclosure section, and run pnpm lint, typecheck, test, and build before merge.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 92d78bd9-c082-436b-82b9-a70046620efc
Commits

Reviewing files that changed from the base of the PR and between b354f4b and c692ca6.

Files selected for processing: 1

  • src/main/claude/transcripts/claude-transcript-import-plan.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@AmoabaKelvin
AmoabaKelvin merged commit e328d04 into main Nov 28, 2026
55 checks passed
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.

1 participant