Skip to content

fix(cli): keep punctuation-only speaker turns - #74

Open
2ynn wants to merge 1 commit into
mainfrom
fix/bb-1
Open

2ynn wants to merge 1 commit into
mainfrom
fix/bb-1

Conversation

@2ynn

@2ynn 2ynn commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #71. A speaker turn that contains only punctuation was dropped from the request when it came right after its label on the same line:

Script main (1f78c8a) This PR
Alice: ... Bob: Yes? Bob only Alice ..., Bob Yes?
Alice: — Bob: Sorry, go on. Bob only Alice —, Bob
Alice: ?! Bob: What? Bob only Alice ?!, Bob
Alice: - Bob: yo. Bob only Alice -, Bob

Cause: lineMarkerStart stops scanning at the end of the previous label (floor), which is what keeps emoji speaker names (😀: 🤖:) from panicking. The side effect was that "only whitespace since the previous label" also counted as the start of a line. A turn right after a label was then taken for the next label's list marker and dropped with it. #71 fixed this for numbers only (Alice: 42. Bob:).

Fix: the scan still stops at floor, but the start-of-line check now looks at the whole text for every kind of marker. This also removes the number-only special case.

Verification:

  • The live API accepts annotated turns that contain only ..., — or - (HTTP 200 on gemini-3.8-flash-tts).
  • go test ./... passes.
  • Dry-runs still give the expected turns for 42., numbered and bulleted lines, emoji names and श्रीराम.

Bounding lineMarkerStart at the previous label also made "only
whitespace since the previous label" count as the start of a line, so
a short turn after a label was read as the next label's list marker
and dropped with it. #71 fixed that for numbers (`Alice: 42. Bob:`), but
punctuation-only turns were still lost: `Alice: ... Bob: Yes?`,
`Alice: — Bob: Sorry, go on.` and `Alice: ?! Bob: What?` each sent only
Bob's turn.

Judge the line start on the whole text for every marker. The scan still
stops at the previous label, so emoji names (`😀: 🤖:`) don't panic.
The live API accepts annotated turns of only `...`, `—` or `-` (HTTP
200).
@2ynn
2ynn requested a review from a team October 6, 2026 22:43

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the logic in lineMarkerStart within internal/cli/custom/tts.go by removing the redundant check variable and directly evaluating the line start using the full text context. It also updates TestSpeakerTurns in internal/cli/custom/custom_test.go to include test cases verifying that punctuation-only turns following a label are correctly preserved. There are no review comments, so I have no feedback to provide.

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