* refactor: centralize provider registration and configuration * fix: hide text-only providers in settings * test: keep the OpenAI provider fixture visible in navigation coverage The provider list now hides text-only entries. The navigation regression fixture overrode the OpenAI preset with text-only kinds and no media models, so the provider disappeared from the list and the click target no longer existed. Mirror the registry preset (text, image and audio kinds) so the history restoration coverage still exercises a visible provider. Generated-By: looper 0.16.2 (runner=fixer, agent=pi) * fix(providers): expose only public connection fields * test: handle macOS process reaping in cancellation coverage --------- Co-authored-by: 罗高 <luogao@users.noreply.github.com>
15 KiB
Application settings and model connections
The application shell keeps navigation in the top bar, editor/project controls in the left rail and the current product surface in the center. Desktop projects are collapsible; narrow screens use a drawer. Opening settings preserves the editor instance and pauses preview playback. The bottom account menu opens Account, Subscription & usage, Appearance, Help and Settings. General includes language, connection setup and keyboard shortcuts; Privacy & data retains telemetry preference and diagnostic export. About links to documentation, source, issues and acknowledgements.
Providers and models
shared/provider-registry.ts is the registration entry for dedicated media providers, local Codex, the OpenDesign account and the compatible presets imported from shared/provider-presets.json. It owns provider identity, protocol/category, setup links, endpoint editability, environment-key names and reference selection. Dedicated execution adapters remain in gateway/providers.ts; account authorization and local Agent login retain their own implementations. A listed preset does not establish executable model support.
The settings directory combines the dedicated media adapters, local Codex, an account connection and 68 provider presets. It supports provider search, configured/custom/local/multimodal/media/language filters, masked saved keys, editable API base URLs, enablement, custom providers, remote catalogue sync, exact-ID manual models, model search, combined type/capability/input/status/source filters, sorting, collapsible groups and defaults. Provider status and protocol filters combine with category and search. Filter selections have immediate results, removable chips and clear-all. OpenAI-compatible, Anthropic and Google Gemini catalogue protocols retain their respective authentication and pagination. A provider can expose multiple capabilities; classification uses explicit catalogue output metadata, not guesses from model names. A model without output metadata is classified as language until the user adds a documented capability explicitly.
The provider management list hides connections whose declared capabilities and saved models are exclusively text, including search results and direct provider links. Their registry entries, saved keys, models and defaults remain intact and available to existing APIs. New custom connections stay visible before models are configured; a saved non-text model also keeps its provider visible. A link to a hidden provider opens the account detail instead.
| Connection | Configuration and discovery | Executable media |
|---|---|---|
| fal.ai, Atlas Cloud, WaveSpeedAI | Existing keys, model catalogues and references | Their existing image/video/audio adapters |
| OpenDesign Cloud | Separate workspace key and public HTTPS gateway origin | Existing image/video/speech contract |
| OpenAI-compatible API | Versioned base URL, Bearer key, /models or manual entries |
/images/generations and binary /audio/speech; voice required for speech |
| Anthropic / Google Gemini API | Provider-specific catalogue auth and pagination | Catalogue/default configuration only; no generic media adapter |
| OpenDesign account | Browser authorization, subscription/balance, remote language/media catalogues | Connector image/video/speech/music tasks; one-image editing where the account's image model supports edits |
| Local Codex | Existing CLI installation/login/capability detection | Existing native image capability |
| Dedicated OAuth, cloud IAM or local-network services | Presets are visible with a dedicated-integration notice | Not implied by a preset; no unimplemented login or local API is presented as working |
Language, embedding and reranker defaults are saved for Agent integrations; this change does not create a conversational Agent runner. The public media Tool accepts the original dedicated provider IDs, account, and registered compatible IDs. Its inspect action returns reference URIs; references explain exact supported operations. Existing tasks remain project-bound and idempotent. Configured media defaults fail explicitly if unavailable, without silently selecting another paid provider.
Custom base URLs must be public HTTPS and retain path prefixes. DNS is pinned and checked before credentialed requests, and authenticated redirects are rejected. Changing the API origin requires entering a replacement key. Compatible jobs capture a connection revision and fail before submission if the key, endpoint or protocol changes, or the model is disabled/removed. Removing a provider clears its saved key and models without removing existing project media. A stale media default remains visibly unavailable until explicitly reset or replaced.
Model editing includes display name, group, type, reasoning/tool capabilities, vision/audio/video inputs, context window and maximum input/output token counts. Token presets fill exact numeric values; manual values are accepted. Token limits describe provider capabilities and do not change upstream quotas. Changing a compatible model's type makes its local definition manual so future catalogue sync retains the correction. Metadata overrides survive refresh, and clearing a token limit is explicit.
Default request parameters are JSON objects validated before saving; reserved identity, prompt and credential fields are rejected. Dedicated, compatible, account and Codex media paths merge saved defaults with per-request parameters, with request values taking precedence. Existing adapter validation and protocol restrictions still apply. Language metadata is saved for integrations and does not override an external CLI Agent's parameters. Local Agent download, sign-in, model selection and default selection use the separate Local Agents flow.
Account and subscription
Source installations that run npm ci get the versioned @powerformer/vela-cli@0.1.10 connector for the current platform as a locked development dependency, so the first Sign in with OpenDesign does not wait for it. Plugin/npm application artifacts omit development dependencies and do not include the connector. An explicit OPENMOTION_ACCOUNT_CLI executable always takes precedence. Otherwise the service uses the locked package, then the exact installed vela CLI version, and finally prepares the connector in the background after it starts, outside the checkout, under the installation data directory. Automatic preparation uses npm with lifecycle scripts disabled. A failed background preparation is not shown; sign-in prepares the connector again and shares any preparation still running. Its upstream availability and platform support are separate installation requirements.
The connector's browser authorization uses its stdin-v1 completion receipt. OpenMotion accepts credentials only after the CLI persists them, and records a new opaque session identity. Activation URLs must use HTTPS on open-design.ai or a subdomain. Authorization is cancellable and expires after ten minutes. The CLI receives an installation-owned AMR_HOME; credentials are never copied from another application's profile. Keys supplied by unrelated Vela environment variables are removed from the subprocess environment.
Each attempt requests the connector's jsonl-v1 sign-in stages under a new attempt ID. Persisted credentials are accepted only when the control key, its ID, the runtime key and the account ID are all present. A connector that cannot be found, installed or started reports connector_unavailable, which tells the user to run npm install -g @powerformer/vela-cli@0.1.10; the exact vela on PATH is then used by the next sign-in. Otherwise a failed attempt reports setup_failed, authorization_expired or credentials_rejected from the furthest stage it reached. Credentials that reached disk are reported as credentials_rejected, unless the connector kept them unconfirmed because the service could not be reached (5xx, timeout, rate limit or network failure); that attempt reports setup_failed. A failure that stored nothing, such as a network failure while exchanging the approved authorization or a local credentials write failure, also reports setup_failed so the panel offers Retry. The account summary's attempt field carries the stages, receipt reply and exit code, and the service logs the same progress for support. When product telemetry is enabled, each finished attempt also sends one account_sign_in_result event: attempt ID, outcome (success, failure, cancelled, or replaced for an interrupted attempt the service refused), error code, connector version, last stage and error kind, whether the browser opened, receipt, exit code, and milliseconds from the click to connector preparation, activation link, browser approval and the end. These diagnostics contain no activation URLs, user codes, identities or credentials.
While authorizing, the summary reports browserOpened once the connector has tried to open the activation page, and syncing after browser approval while the session and model catalogue are set up. The account panel leaves the activation page to the browser and keeps the link as a fallback, which becomes the primary action only when opening failed; while syncing it offers no action. After a failure, setup_failed offers Retry, the other codes offer Sign in again, and credentials_rejected adds a feedback link. The panel shows the account email once: under the name when the account has a different name, otherwise as the title.
Credentials saved by an interrupted attempt stay unconfirmed. The next sign-in first lets the connector confirm them; this resumed attempt (attempt.resumed) has no activation link. If the service no longer accepts it, the connector rolls it back and the same sign-in continues with a new authorization and link.
Successful login registers the account provider, synchronizes its enabled models and reads subscription/available USD balance. The subscription action opens the account console; checkout is not reimplemented. An empty subscription tier is shown as the Free plan. A failed billing read clears the plan and balance instead of fabricating them, keeps the session, says that account models remain usable and offers a refresh; the HTTP status and service error code are kept when the connector reports them. A 401 from a billing read means the control key is no longer accepted: the account becomes reauth-required and its models are unavailable until a later authenticated response or a new sign-in. This judgement is kept in memory; after a restart it is re-established by the next billing read. Logout asks the connector to revoke this installation's key and removes the local session and cached account models. When the service cannot be reached, the connector clears the key locally and keeps a revocation record, so the credentials file stays until a retry succeeds. Retries run on the first account status read after startup and on each refresh, never alongside a sign-in; the file is removed once nothing is left to revoke. Queue entries capture the account identity; another identity cannot inherit queued work. The connector submits once, saves the remote task ID, polls that task and validates output through the existing import pipeline. Local cancellation does not establish remote cancellation or refund.
Storage and verification
gateway/connections.ts owns configuration writes, credential resolution, endpoint resolution and default-model storage for dedicated and compatible providers. Settings HTTP, the legacy HTTP/MCP configuration entry and generation all use this boundary. Saved keys retain priority over environment keys; clearing a saved key can expose the existing environment fallback. Account sign-in and local Agent login cannot be replaced with a provider API key.
Existing files are read and updated in place, without startup migration: compatible connection metadata, models, overrides and non-media defaults remain in model-gateway/connections.json, with keys in model-gateway/connection-secrets.json; dedicated provider configuration, media defaults and custom media models remain in model-gateway/config.json, with keys in model-gateway/secrets.json. The configuration service exposes the combined defaults and preserves existing provider/model IDs, verification records and queued-job snapshots. Account runtime, CLI profile, session marker and model cache remain under account/. New private files use 0600 and private directories use 0700. This is local file storage, not an OS keychain. API responses, project exports and distribution artifacts contain no credentials.
Deterministic tests cover protocol/authentication mapping, model pagination, failed-sync retention, private credential responses, exact-once generation, connection changes, account receipt/cancellation, sign-in failure classification, interrupted sign-ins, revocation retries, sign-in telemetry records, account panel states, billing tier/refusal/rejected-key handling, model entitlement flags and media import. Real Chrome checks exercise the local HTTP server, shell/settings navigation, custom provider CRUD, synchronization/defaults, account subprocess fixture, themes, narrow layouts, opened menus/dialogs and floating Toasts. Live account login, subscription entitlement, provider-specific execution and human visual acceptance remain separate checks.
Sources and acknowledgements
Preset metadata is adapted from the independently MIT-licensed Cherry Studio provider registry; see the notice and license. The model editor and filtering interaction also follow the model classification and token fields contracts. No upstream application UI code is copied. Account behavior follows OpenDesign source and the pinned connector command contract. Endpoint adaptations were checked against PPIO and Vercel's OpenAI API. The compatible API guide and account guide carry operation-specific references.