Skip to content

[codex] 簡単設定のAI/音声プロバイダー設定を改善#533

Merged
tegnike merged 4 commits into
developfrom
codex/quick-start-provider-settings
Jun 23, 2026
Merged

[codex] 簡単設定のAI/音声プロバイダー設定を改善#533
tegnike merged 4 commits into
developfrom
codex/quick-start-provider-settings

Conversation

@tegnike

@tegnike tegnike commented Jun 23, 2026

Copy link
Copy Markdown
Owner

概要

  • Vercel AI SDK と各AIプロバイダーSDKのバージョンを更新しました。
  • AI SDKの型定義に合わせてAIモデル一覧を更新し、OpenAIのデフォルトモデルを gpt-5.4-mini に変更しました。
  • 簡単設定のAI/音声設定で、選択したプロバイダーごとに必要最低限の入力項目を表示するようにしました。
  • 簡単設定のAIプロバイダー選択をアイコン付きにし、AI/音声の選択欄の幅を揃えつつコンパクトにしました。
  • 日本語の簡単設定説明文を実際の設定内容に合わせて更新しました。

背景

簡単設定でAPIキーや話者、モデルUUIDなどの必須級項目が入力できないプロバイダーがあり、選択欄の見た目も詳細設定画面と揃っていませんでした。簡単設定だけで初期セットアップに必要な最低限の項目を埋められるようにしています。

検証

  • npx eslint src/components/settings/quickStart.tsx src/features/constants/aiModels.ts src/__tests__/features/constants/aiModels.test.ts
  • npm test -- --runTestsByPath src/__tests__/features/constants/aiModels.test.ts src/__tests__/features/constants/aiModels.reasoning.test.ts
  • npm run build
  • Playwrightで簡単設定画面を確認
    • AI/音声の選択欄が同じ幅で表示されること
    • AIプロバイダー選択とドロップダウン内の全選択肢にアイコンが表示されること

Summary by CodeRabbit

リリースノート

  • 新機能
    • クイックスタートのAIサービス選択UIを改善し、選択内容に応じて設定項目を動的に切り替え可能にしました。
    • 音声(TTS/音声合成)設定を拡張し、対応エンジンごとの入力(APIキー/エンドポイント/話者など)を反映しました。
  • ドキュメント
    • クイックスタート文言(AI会話・音声)を更新しました。
  • チョア
    • 対応AIモデルと既定モデル候補を更新しました。
    • AI SDK依存を更新しました。
  • テスト
    • モデル切り替えに関するE2E期待値を更新しました。

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2d072ef6-eeec-46ef-85fc-cb0c08ca9313

📥 Commits

Reviewing files that changed from the base of the PR and between 731b3be and 0d9aa18.

📒 Files selected for processing (4)
  • locales/ja/translation.json
  • src/components/settings/modelProvider.tsx
  • src/components/settings/modelProvider/ServiceLogo.tsx
  • src/components/settings/quickStart.tsx
✅ Files skipped from review due to trivial changes (2)
  • src/components/settings/modelProvider.tsx
  • locales/ja/translation.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/settings/quickStart.tsx

Walkthrough

@ai-sdk/*ai パッケージのバージョンを更新し、OpenAI・Anthropic・Google・XAI・Groq・Cohere・Mistral・FireworksのAIモデル定義(defaultModels/音声モデルリスト含む)を刷新した。QuickStartコンポーネントにサービス別・音声エンジン別の設定UIを大幅追加し、AIサービス選択をListboxに置き換えた。型安全性を向上させ、対応するテストと日本語翻訳テキストも更新した。

Changes

AIモデル定数・依存パッケージ更新

Layer / File(s) Summary
依存パッケージバージョン更新
package.json
@ai-sdk/*(anthropic/azure/cohere/deepseek/fireworks/google/mistral/openai/openai-compatible/perplexity/xai)と ai パッケージを新しいバージョン系列へ更新した。
各プロバイダのmodelDefinitions更新
src/features/constants/aiModels.ts
OpenAI/Anthropic/Google/XAI/Groq/Cohere/Mistral/FireworksのmodelDefinitions配列を刷新。multiModalreasoningEffortsreasoningTokenBudgetフラグを整備し、新世代モデル(gpt-5.4-mini、gpt-4o-audio-preview、gemini-2.5-flash*等)を追加し旧モデルを削除・置換した。
デフォルトモデルと音声モデルリスト更新
src/features/constants/aiModels.ts
defaultModels.openaiAudiotts-1からgpt-4o-mini-audio-previewへ変更。openAIAudioModelsopenAITTSModelsopenAIWhisperModelsgoogleSearchGroundingModelsの候補リストを新モデルに対応させた。
aiModelsテスト期待値の修正
src/__tests__/features/constants/aiModels.test.ts
getDefaultModelgetSpecificDefaultModelgetMultiModalModelsgetOpenAIAudioModelsの期待値をmodelDefinitions更新に合わせて修正した。

QuickStart型安全化・UIコンポーネント拡張

Layer / File(s) Summary
ServiceLogo型安全化
src/components/settings/modelProvider/ServiceLogo.tsx, src/components/settings/modelProvider.tsx
ServiceLogoのpropsをAIService型で直接定義し、aiServiceLogosをRecord<AIService, string>として明示的に型付けした。modelProviderのas anyキャストを削除。
QuickStartのインポート・定数・状態初期化
src/components/settings/quickStart.tsx
useEffect/useStateを導入し、ModelSelector・ApiKeyInput・ServiceLogo・getServiceConfigByKey・getOpenAITTSModels等の依存を追加。入力フィールド共通クラス定数(inputClassName・choiceControlClassName)とopenAITTSVoiceOptionsを定義した。
動的状態管理:aivis_speech話者フェッチ
src/components/settings/quickStart.tsx
aivis_speech選択時に/speakers_aivis.jsonを非同期フェッチして話者配列をuseStateへ反映するuseEffectを追加。型ガード(isSpeakerOption)とエラーログ出力(console.error)を実装し、失敗時は空配列を設定。
サービス別・音声別設定UI生成関数
src/components/settings/quickStart.tsx
getSelectedServiceApiKey・updateSelectedServiceApiKey・handleModelChangeを追加。renderQuickAIServiceSettings(switch分岐でAzure/Dify/LocalLLM/OpenRouter/custom URL等を生成)とrenderQuickVoiceSettings(switch分岐でvoicevox/google/stylebertvits2/aivis_speech/openai等のUI生成)を実装。各サービス固有の入力フィールド(URL/APIキー/モデル/話者/スタイル)をレンダリング。
QuickStart JSX: Listbox置換・動的UI挿入
src/components/settings/quickStart.tsx
AI会話セクションのselect要素をHeadlessUI Listboxに置換してServiceLogo表示を追加。getServiceConfigByKeyでserviceConfigを導出し、存在時のみApiKeyInputを表示。renderQuickAIServiceSettings()呼び出しを各AIサービス設定ブロック直後に挿入。音声セクションのclassNameを共通クラス合成へ変更し、renderQuickVoiceSettings()呼び出しを挿入。
日本語UIテキスト更新
locales/ja/translation.json
QuickStartAIConversationDescriptionとQuickStartVoiceDescriptionの説明文を刷新。AI/音声の設定に必要な項目(APIキー、エンドポイント、URL、モデル、話者、スタイル等)を明記した新文面に差し替えた。

E2Eテストの更新

Layer / File(s) Summary
settings-modesテスト:定数化と期待値更新
tests/e2e/settings-modes.spec.ts
OPENAI_AUDIO_MODE_MODEL定数を追加し、オーディオモード切替テストで旧来のハードコード「tts-1」から新しいモデルID定数への参照へ変更。toggle後のpoll値の比較対象も定数参照へ置き換え。

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant QuickStart
  participant settingsStore
  participant getServiceConfigByKey
  participant ApiKeyInput
  participant renderQuickAIServiceSettings
  participant renderQuickVoiceSettings

  User->>QuickStart: AIサービスをListboxで選択
  QuickStart->>getServiceConfigByKey: selectAIServiceでserviceConfig取得
  getServiceConfigByKey-->>QuickStart: serviceConfig(ラベル/プレースホルダ/リンク等)
  QuickStart->>ApiKeyInput: serviceConfigが存在する場合のみ表示
  QuickStart->>renderQuickAIServiceSettings: サービス別追加設定UI生成(Azure/Dify/LocalLLM等)
  renderQuickAIServiceSettings->>settingsStore: エンドポイント/URLモデルID更新

  User->>QuickStart: 音声エンジンをselectで選択
  QuickStart->>renderQuickVoiceSettings: エンジン別設定UI生成(話者/スタイル/モデル/APIキー等)
  renderQuickVoiceSettings->>settingsStore: 話者/スタイル/モデルID等更新
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • tegnike/aituber-kit#227: OpenAIの利用可能モデル(gpt-4oの世代/派生名)の扱いを更新しており、AIモデル定義変更と取得PRのモデル選択肢更新が同一領域で結びつく。
  • tegnike/aituber-kit#520: src/features/constants/aiModels.tsaiModels.test.tsの両方でモデルリスト・フラグ定義を更新しており、本PRと同じ変更領域に該当する。
  • tegnike/aituber-kit#522: QuickStart設定UIの再設計とモデル/プロバイダ更新が本PRの同一ファイル・機能変更と重複する。
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PRタイトルは、AIと音声プロバイダー設定の改善という主要な変更を明確に要約しており、変更セット全体を適切に表現しています。
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/quick-start-provider-settings

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Comment @coderabbitai help to get the list of available commands.

@tegnike tegnike marked this pull request as ready for review June 23, 2026 13:24

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/features/constants/aiModels.ts (1)

234-355: 🎯 Functional Correctness | 🔴 Critical

claude-fable-5は2026年6月12日に利用停止されており、削除する必要があります

検証結果により、ほとんどのモデル名は有効であることが確認されました:

  • claude-opus-4-8claude-sonnet-4-6claude-haiku-4-5:有効でアクティブ
  • gemini-3.5-flash:2026年5月19日にGA公開、有効でアクティブ

ただし、claude-fable-5は重大な問題があります

  • Anthropic公式によると、2026年6月9日にリリースされましたが、6月12日にUS輸出規制に関連する指令によりアクセスが停止されました
  • 現在(6月23日時点)も利用不可のままです
  • このモデルをmodelDefinitionsに含めると、実行時にAPI呼び出しが失敗します

claude-fable-5modelDefinitionsから削除してください。

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/constants/aiModels.ts` around lines 234 - 355, Remove the
claude-fable-5 model entry from the anthropic array in the aiModels.ts file. The
claude-fable-5 model was discontinued on June 12, 2026 due to US export control
restrictions and is no longer available, which means API calls to this model
will fail at runtime. Delete the entire object containing the name
'claude-fable-5' property and its associated configuration (multiModal,
reasoningEfforts, reasoningTokenBudget) from the anthropic models array.
🧹 Nitpick comments (1)
src/components/settings/quickStart.tsx (1)

811-831: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

ServiceLogo への as any を避けてください。

AI サービス追加時のロゴ定義漏れを型で検知できなくなります。aiServiceOptionsServiceLogo の props を共通のサービス型でそろえ、キャストなしで渡せる状態にしてください。

局所修正例
-                  <ServiceLogo service={modelState.selectAIService as any} />
+                  <ServiceLogo service={modelState.selectAIService as AIService} />
...
-                        <ServiceLogo service={option.value as any} />
+                        <ServiceLogo service={option.value as AIService} />

As per coding guidelines, src/**/*.{ts,tsx}: Use TypeScript strict mode for type safety.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/settings/quickStart.tsx` around lines 811 - 831, The
ServiceLogo component is receiving as any casts for the service prop in two
places (modelState.selectAIService and option.value), which bypasses TypeScript
type checking and prevents detection of missing logo definitions when adding new
AI services. Ensure that both modelState.selectAIService and the values in
aiServiceOptions are properly typed to match the expected service type of the
ServiceLogo component, then remove both as any casts so the types align without
explicit casting.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@locales/ja/translation.json`:
- Around line 249-253: The description strings
QuickStartAIConversationDescription and QuickStartVoiceDescription do not
accurately reflect all required configuration inputs. Update
QuickStartAIConversationDescription to include mention of URLs and endpoints
that are required depending on the AI service selected (Azure/Dify/Local/Custom
API), not just API key and model. Similarly, update QuickStartVoiceDescription
to include additional required settings such as model UUID and style alongside
API key and speaker selection.

In `@src/components/settings/quickStart.tsx`:
- Around line 33-39: The className constants inputClassName,
selectButtonClassName, and choiceControlClassName use hardcoded Tailwind color
values like bg-white, border-gray-300, and ring-primary/20 that do not respect
the darkMode: class theme switching configuration. Replace these fixed color
classes with CSS variable-based Tailwind tokens from your existing theme
configuration that support both light and dark modes. Ensure all background
colors, border colors, and ring colors use the theme-aware tokens instead of
hardcoded Tailwind color values to maintain consistent styling across theme
switches.
- Around line 118-120: The fetch call for '/speakers_aivis.json' does not
validate the HTTP status code or verify that the response data is actually an
array before passing it to setAivisSpeakers. If the fetch fails or returns a
non-array response (such as an error JSON object), the downstream
aivisSpeakers.map(...) call will crash. Add a check for response.ok after the
fetch call, and validate that the parsed data is an array using Array.isArray()
before calling setAivisSpeakers. Handle error cases appropriately by logging or
setting an empty array as a fallback.
- Around line 15-26: Replace all relative imports in the quickStart.tsx file
with the `@/`* path alias pattern to align with the repository's import
conventions. Convert the imports from './modelProvider/ModelSelector',
'./modelProvider/ApiKeyInput', './modelProvider/ServiceLogo',
'./modelProvider/utils/aiServiceConfigs',
'./modelProvider/hooks/useAIServiceHandlers',
'./modelProvider/hooks/useModelProviderState', '../toggleSwitch', and
'../speakers.json' to use absolute paths starting with `@/components` instead of
relative paths.
- Around line 532-537: The onChange handler for the aivisCloudStyleId input
field is directly converting the input value to a number without validation,
which allows NaN to be saved to the state when users enter invalid or empty
values during editing. Fix this by adding validation to check if the converted
number is valid (not NaN) before updating the settings state in the
settingsStore.setState call, or implement a conditional check that only updates
when a valid number is provided.

---

Outside diff comments:
In `@src/features/constants/aiModels.ts`:
- Around line 234-355: Remove the claude-fable-5 model entry from the anthropic
array in the aiModels.ts file. The claude-fable-5 model was discontinued on June
12, 2026 due to US export control restrictions and is no longer available, which
means API calls to this model will fail at runtime. Delete the entire object
containing the name 'claude-fable-5' property and its associated configuration
(multiModal, reasoningEfforts, reasoningTokenBudget) from the anthropic models
array.

---

Nitpick comments:
In `@src/components/settings/quickStart.tsx`:
- Around line 811-831: The ServiceLogo component is receiving as any casts for
the service prop in two places (modelState.selectAIService and option.value),
which bypasses TypeScript type checking and prevents detection of missing logo
definitions when adding new AI services. Ensure that both
modelState.selectAIService and the values in aiServiceOptions are properly typed
to match the expected service type of the ServiceLogo component, then remove
both as any casts so the types align without explicit casting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 31a4fca1-5391-4a78-9fca-a76d37a7e960

📥 Commits

Reviewing files that changed from the base of the PR and between 8220c1c and 40e38c0.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • locales/ja/translation.json
  • package.json
  • src/__tests__/features/constants/aiModels.test.ts
  • src/components/settings/quickStart.tsx
  • src/features/constants/aiModels.ts

Comment thread locales/ja/translation.json Outdated
Comment thread src/components/settings/quickStart.tsx Outdated
Comment thread src/components/settings/quickStart.tsx
Comment thread src/components/settings/quickStart.tsx Outdated
Comment thread src/components/settings/quickStart.tsx
@tegnike tegnike merged commit 7a2fd77 into develop Jun 23, 2026
7 checks passed
@tegnike tegnike deleted the codex/quick-start-provider-settings branch June 23, 2026 14:29
@coderabbitai coderabbitai Bot mentioned this pull request Jun 23, 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