feat(web): serve custom/command voice provider options in config schema (salvage #40338) - #67436
Merged
Conversation
…ards with desktop (#40338 follow-up) Refactor the cherry-picked #40338 backend half: - Move option merging from import-time _SCHEMA_OVERRIDES mutation to a per-request overlay in GET /api/config/schema — options now reflect the current config.yaml (no restart needed) and the module-level CONFIG_SCHEMA is never mutated. The endpoint gains an optional ?profile= param scoped via _config_profile_scope. - Keep builtin display order first, customs appended (drop the sorted(set(...)) re-sort) — matches desktop enumOptionsFor. - Only command-type provider blocks count (type absent or 'command' plus non-empty command string), enumerated from the canonical <kind>.providers.* location AND the legacy top-level <kind>.<name> fallback — the same dual resolution as _get_named_provider_config / _get_named_stt_provider_config. Builtin-name collisions are excluded case-insensitively against the RUNTIME builtin sets (not the display shortlist), mirroring apps/desktop/src/app/settings/helpers.ts commandProviderNames (#67209). - Drop the plugin.yaml 'provides: [tts]' manifest scan — that convention does not exist (manifests carry provides_tools/provides_hooks only); plugin TTS/STT providers register at runtime via ctx.register_tts_provider(). Instead, opportunistically include names from agent.tts_registry / agent.transcription_registry when plugins happen to be loaded in this process. - Current tts.provider/stt.provider value preserved in options. - Tests: custom command provider merge (tts+stt), builtin-order preservation, EDGE collision exclusion, non-command block exclusion, current-value preservation, per-request freshness, legacy top-level block support.
Collaborator
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Salvage of the non-superseded half of #40338 by @lost9999:
/api/config/schemanow serves merged custom/command voice provider options fortts.provider/stt.provider, so the web dashboard (and any schema consumer) lists user-configured providers instead of the static builtin shortlist.The desktop got equivalent dropdown merging client-side in #67209 — this PR brings the backend schema in line, which is what the dashboard reads. @lost9999 submitted this idea a month before the desktop-side PR; their commit lands with authorship preserved (rebase merge).
Changes
_custom_provider_options()— mergestts.providers.*/stt.providers.*+ current provider value into schema options_schema_with_voice_provider_options()) instead of import-time mutation — no stale options, moduleCONFIG_SCHEMAnever mutated,?profile=scopedplugin.yaml provides: [tts]scan (convention doesn't exist — manifests carryprovides_tools/provides_hooks); replaced with best-efforttts_registry/transcription_registryenumeration that degrades gracefully when plugins aren't loadedhelpers.ts: command-type blocks only, case-insensitive builtin collision against runtimeBUILTIN_TTS_PROVIDERS/BUILTIN_STT_PROVIDERS, dual canonical+legacy resolution matching_get_named_provider_configcontributors/emails/mapping for lost9999Validation
test_web_server.py442 passed / 2 pre-existing failures (TestPtyWebSocket, confirmed failing with changes stashed); ruff cleanCloses #40338 (salvaged with authorship preserved).
Infographic