Skip to content

Comments

Refactor TokenStreamTranscriber duplication#71

Open
ysdede wants to merge 2 commits intostagingfrom
refactor-token-stream-transcriber-18133579909554393049
Open

Refactor TokenStreamTranscriber duplication#71
ysdede wants to merge 2 commits intostagingfrom
refactor-token-stream-transcriber-18133579909554393049

Conversation

@ysdede
Copy link
Owner

@ysdede ysdede commented Feb 7, 2026

Extracted shared logic for result merging, state updates, and callbacks into _handleProcessingResult to fix code duplication in TokenStreamTranscriber.ts. Added unit tests in src/lib/transcription/TokenStreamTranscriber.test.ts. Verified with new tests.


PR created automatically by Jules for task 18133579909554393049 started by @ysdede

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@ysdede ysdede changed the base branch from release/r1 to staging February 10, 2026 20:59
@ysdede
Copy link
Owner Author

ysdede commented Feb 10, 2026

Review Summary (Post r1→master merge)

Status: ✅ MERGEABLE

Changes: Refactors TokenStreamTranscriber to eliminate code duplication between processChunk() (audio path) and processChunkWithFeatures() (precomputed mel path). Extracts shared post-processing logic into a new _handleProcessingResult() private method.

Assessment: Clean DRY refactor. Both methods had ~30 lines of identical merge/format/callback logic that is now consolidated. The extracted method handles:

  • LCS merger processing
  • State updates (timestamp, chunk count)
  • Text formatting via tokenizer
  • Callback notifications
  • Building the return result

No behavioral changes, just structural improvement. Makes future pipeline additions easier.

Recommendation:Merge — Good code quality improvement, reduces maintenance burden

@google-labs-jules
Copy link
Contributor

Review Summary (Post r1→master merge)

Status: ✅ MERGEABLE

Changes: Refactors TokenStreamTranscriber to eliminate code duplication between processChunk() (audio path) and processChunkWithFeatures() (precomputed mel path). Extracts shared post-processing logic into a new _handleProcessingResult() private method.

Assessment: Clean DRY refactor. Both methods had ~30 lines of identical merge/format/callback logic that is now consolidated. The extracted method handles:

  • LCS merger processing
  • State updates (timestamp, chunk count)
  • Text formatting via tokenizer
  • Callback notifications
  • Building the return result

No behavioral changes, just structural improvement. Makes future pipeline additions easier.

Recommendation:Merge — Good code quality improvement, reduces maintenance burden

Acknowledged. Thank you for the review.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Repository owner deleted a comment from google-labs-jules bot Feb 17, 2026
Repository owner deleted a comment from coderabbitai bot Feb 17, 2026
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