tts: --multi-speaker accepts extra '=' separators during --dry-run and normal execution

オープン
#188 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

Read internal/cli/custom/tts.go at buildSpeechConfig near line 412 and the TestBuildSpeechConfig cases. The issue reports that strings.Cut accepts extra = separators; verify the malformed examples in dry-run mode and compare with the proposed validation check. Done means malformed mappings return ExitUsage with a clear flag error, while valid mappings still pass the focused test.

索引モデルが issue の本文から書いたものです。

説明

Description

buildSpeechConfig in internal/cli/custom/tts.go uses strings.Cut(pair, "="), which splits only at the first =. Entries such as Alice=Kore=oops, Alice==Kore, and Alice=Kore= are accepted as speaker mappings. Dry-run exits 0; normal execution sends the malformed voice to the API.

Reproduction
gemini-api --no-keyring tts 'Alice: hi. Bob: hello.' \
  --multi-speaker 'Alice=Kore=oops,Bob=Puck' --dry-run -o json
echo $?

Current: 0, with "voice":"Kore=oops" in the preview. Expected: 2 (ExitUsage), with a clear flag error. With the fix below, the same command exits 2.

Proposed fix

Add the extra separator check at internal/cli/custom/tts.go:412:

if !ok || name == "" || voice == "" || strings.Contains(voice, "=") {

The fix branch changes this line and adds four cases to TestBuildSpeechConfig. The focused test, full test suite, and go vet ./internal/cli/custom pass.

I can open a PR if you'd like one.

主要言語
Go
スター
514
フォーク
84
平均マージ
1日 15時間
マージ済み PR(30日)
69

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google-gemini/gemini-api-cli のほかの issue

google-gemini/gemini-api-cli の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。