[PR #1310] [MERGED] Fix provider lookup fallback metadata #5027

Closed
opened 2026-10-22 04:12:35 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1310
Author: @cha1latte
Created: 5/26/2026
Status: ✅ Merged
Merged: 5/26/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/refactor-issue-1251-provider-lookup-failures


📝 Commits (2)

  • 289b366 Fix provider lookup fallback metadata
  • a0be8af Address provider fallback review notes

📊 Changes

6 files changed (+403 additions, -24 deletions)

View changed files

📝 src-tauri/src/commands/storage/integrations/tts.rs (+165 -10)
📝 src-tauri/src/commands/storage/llm.rs (+179 -7)
📝 src/engine/contracts/types/tts.ts (+6 -0)
📝 src/features/catalog/connections/hooks/use-connections.ts (+8 -1)
📝 src/features/shell/connections/components/ConnectionEditor.tsx (+34 -6)
📝 src/features/shell/settings/components/settings/TTSConfigCard.tsx (+11 -0)

📄 Description

Linked issue

Closes #1251

Why this change

  • Live LLM model lookup and TTS voice lookup failures were being collapsed into fallback/default catalogs with no error metadata.
  • That made bad API keys, bad endpoints, provider outages, and parse failures look like successful provider catalog loads.

What changed

  • LLM model lookup now returns fallback metadata and provider error details through connection_models, while keeping llm_list_models array-compatible and annotating fallback model rows.
  • TTS voice lookup now marks fallback voice catalogs with fallback: true and includes providerError / providerErrorCode when a live provider request fails or returns unusable data.
  • The connection model picker and TTS settings card now surface provider lookup failures while still showing fallback choices.
  • Added Rust regression coverage for provider-failure and should-not-match success/disabled-fallback rows.

Refactor impact

Primary owner:

Rust storage / shared API / shell settings

Impact areas reviewed:

  • Tauri commands for LLM model lookup and TTS voice lookup
  • Shared TTS voice response contract
  • Connection model picker
  • TTS settings voice picker

Boundary notes:

  • connection_models remains backward-compatible for callers that only read models.
  • llm_list_models remains an array response; fallback rows are annotated instead of changing the command shape.
  • tts_voices preserves existing voices, voiceOptions, fromProvider, and source fields while adding optional fallback/error metadata.

Pressure points touched:

  • src-tauri/src/commands/storage/llm.rs
  • src-tauri/src/commands/storage/integrations/tts.rs
  • Shell settings/components that consume these lookup responses

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Codex reproduced the pre-fix failure by adding focused Rust regression tests and running cargo test marks_fallback; the LLM and TTS fallback metadata assertions failed before the production patch.
  • Codex verified the fix with cargo test marks_fallback; both provider-failure tests passed.
  • Codex verified edge controls with cargo test lookup; TTS provider success stayed fromProvider=true/fallback=false, failed lookup returned providerError, and disabled TTS fallback had no provider error.
  • Codex verified LLM positive and negative rows with cargo test connection_models; provider failure returned fallback/error metadata, while provider success stayed distinct from fallback.
  • Codex ran pnpm check; architecture, frontend typecheck, Rust check, and docs check passed.
  • Codex ran the local proof gate against scratch/bugfix-verification.json; it passed.
  • Browser/Tauri click-through was not run. The core native command behavior is covered by Rust harnesses; the UI change is conditional rendering of the new response fields and was covered by TypeScript via pnpm check.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs, release metadata, schema, or dependency declarations changed.

UI evidence

No screenshot attached. This is a native command contract/error-state fix with small settings UI conditional copy. The changed UI paths typecheck under pnpm check; the provider failure behavior is covered by Rust command harnesses.

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced error transparency when voice and model providers fail—system now displays warning messages while seamlessly showing fallback options.
  • Improvements

    • UI now clearly distinguishes between fallback voices/models and those from live providers.
    • Richer error context captured when external providers become unavailable.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1310 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/26/2026 **Status:** ✅ Merged **Merged:** 5/26/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-issue-1251-provider-lookup-failures` --- ### 📝 Commits (2) - [`289b366`](https://github.com/Pasta-Devs/Marinara-Engine/commit/289b366cfa45b3c1daa7bae7efa00cd29f18bd3d) Fix provider lookup fallback metadata - [`a0be8af`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a0be8af27f40317aea6478fe0342fa636f34f323) Address provider fallback review notes ### 📊 Changes **6 files changed** (+403 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/integrations/tts.rs` (+165 -10) 📝 `src-tauri/src/commands/storage/llm.rs` (+179 -7) 📝 `src/engine/contracts/types/tts.ts` (+6 -0) 📝 `src/features/catalog/connections/hooks/use-connections.ts` (+8 -1) 📝 `src/features/shell/connections/components/ConnectionEditor.tsx` (+34 -6) 📝 `src/features/shell/settings/components/settings/TTSConfigCard.tsx` (+11 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1251 ## Why this change - Live LLM model lookup and TTS voice lookup failures were being collapsed into fallback/default catalogs with no error metadata. - That made bad API keys, bad endpoints, provider outages, and parse failures look like successful provider catalog loads. ## What changed - LLM model lookup now returns fallback metadata and provider error details through `connection_models`, while keeping `llm_list_models` array-compatible and annotating fallback model rows. - TTS voice lookup now marks fallback voice catalogs with `fallback: true` and includes `providerError` / `providerErrorCode` when a live provider request fails or returns unusable data. - The connection model picker and TTS settings card now surface provider lookup failures while still showing fallback choices. - Added Rust regression coverage for provider-failure and should-not-match success/disabled-fallback rows. ## Refactor impact Primary owner: Rust storage / shared API / shell settings Impact areas reviewed: - Tauri commands for LLM model lookup and TTS voice lookup - Shared TTS voice response contract - Connection model picker - TTS settings voice picker Boundary notes: - `connection_models` remains backward-compatible for callers that only read `models`. - `llm_list_models` remains an array response; fallback rows are annotated instead of changing the command shape. - `tts_voices` preserves existing `voices`, `voiceOptions`, `fromProvider`, and `source` fields while adding optional fallback/error metadata. Pressure points touched: - `src-tauri/src/commands/storage/llm.rs` - `src-tauri/src/commands/storage/integrations/tts.rs` - Shell settings/components that consume these lookup responses ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [ ] `pnpm check` passes locally - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - Codex reproduced the pre-fix failure by adding focused Rust regression tests and running `cargo test marks_fallback`; the LLM and TTS fallback metadata assertions failed before the production patch. - Codex verified the fix with `cargo test marks_fallback`; both provider-failure tests passed. - Codex verified edge controls with `cargo test lookup`; TTS provider success stayed `fromProvider=true`/`fallback=false`, failed lookup returned `providerError`, and disabled TTS fallback had no provider error. - Codex verified LLM positive and negative rows with `cargo test connection_models`; provider failure returned fallback/error metadata, while provider success stayed distinct from fallback. - Codex ran `pnpm check`; architecture, frontend typecheck, Rust check, and docs check passed. - Codex ran the local proof gate against `scratch/bugfix-verification.json`; it passed. - Browser/Tauri click-through was not run. The core native command behavior is covered by Rust harnesses; the UI change is conditional rendering of the new response fields and was covered by TypeScript via `pnpm check`. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No docs, release metadata, schema, or dependency declarations changed. ## UI evidence No screenshot attached. This is a native command contract/error-state fix with small settings UI conditional copy. The changed UI paths typecheck under `pnpm check`; the provider failure behavior is covered by Rust command harnesses. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Enhanced error transparency when voice and model providers fail—system now displays warning messages while seamlessly showing fallback options. * **Improvements** * UI now clearly distinguishes between fallback voices/models and those from live providers. * Richer error context captured when external providers become unavailable. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1310?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:35 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5027
No description provided.