picoclaw/web/backend/api
肆月 d2c0b69243
feat(web,api): provider selection and model form foundation (#2831)
* feat: improve model configuration workflows

Add model catalog browsing, provider registry with form validation,
model fetch/test dialogs, and enhanced model management UI.

- Add model catalog API and catalog-dialog component for browsing saved models
- Add provider-registry with auto-populated form fields per provider
- Add provider-combobox, fetch-models-dialog, test-model-dialog components
- Add model-validation for provider-aware model ID validation
- Add command and popover UI components
- Enhance edit-model-sheet with tool schema transform support
- Add anthropic to protocolMetaByName for correct default API base
- Apply NormalizeBaseURL to anthropic provider for consistent URL handling
- Add i18n keys for new model management features (en/zh)

* fix(web): prevent auto-fetch when API key is missing in fetch models dialog

When a provider requires an API key but none is set, the dialog now shows
the warning without triggering a doomed fetch attempt. Fetch is deferred
until the user provides a key.

* fix(web): add credential warning for catalog imports from remote providers

When importing models from a catalog entry whose provider requires an API
key, a yellow warning banner now informs users that credentials will need
to be configured after import.

* feat(web,api): test connection with real connectivity verification and unsaved form values

Add POST /api/models/test-inline endpoint that performs actual network
probes (GET /models) instead of just checking config. Frontend Test
Connection now uses current form values (not saved state) and is
available in both Add and Edit model flows.

* style(web): apply linter formatting across model config components

Normalize quote style, import ordering, and class name ordering as
reported by the project linter.

* fix(web,api): fix edit test connection false negative and gate fetch for unsupported providers

- handleTestInlineModel now accepts optional model_index to fall back to stored credentials when api_key is empty, fixing false negatives when testing edited models
- Add supportsFetch to provider registry and FETCHABLE_PROVIDER_KEYS derived set
- Gate Fetch Models button to only show for OpenAI-compatible and Ollama providers
- Add backend guard in handleFetchModels to reject unsupported providers with clear error

* fix: address review feedback on model config workflow

- Send explicit {} for empty extra_body/custom_headers fields so the
  backend clears stored values instead of preserving them
- Merge backend provider_options with frontend PROVIDERS registry so
  the provider picker reflects backend-supported providers and policy
  fields (create_allowed, default_auth_method, auth_method_locked)
- Render provider combobox popover inside the sheet scroll container
  to fix wheel events scrolling the sheet instead of the provider list

* feat(web,api): add provider selection, model form foundation, and validation

Split from PR #2752 (part 1 of 3).

Backend:
- CRUD model endpoints (list/add/update/delete/set-default)
- Provider metadata with default API bases and model provider options
- Model ID validation and normalization
- Anthropic default API base normalization

Frontend:
- Provider registry with metadata, labels, icons, and aliases
- Provider combobox with backend option merging
- Model field validation with provider-aware checks
- Redesigned add/edit model sheets with provider selection
- Dynamic imports for fetch/catalog/test dialogs (coming in PR2/PR3)
- i18n support for model configuration UI
2026-05-11 16:57:37 +08:00
..
auth.go refactor(web): switch dashboard auth from tokens to passwords (#2608) 2026-04-21 18:04:15 +08:00
auth_login_limiter.go feat(web): protect launcher dashboard with token and SPA login (#1953) 2026-03-29 13:11:43 +08:00
auth_test.go refactor(web): switch dashboard auth from tokens to passwords (#2608) 2026-04-21 18:04:15 +08:00
channels.go add MQTT channel support 2026-04-29 18:27:33 +08:00
channels_test.go fix(web): save channel configs with nested channel_list patches (#2530) 2026-04-16 10:30:16 +08:00
config.go feat(web): support list editing for channel array fields (#2595) 2026-04-21 16:04:28 +08:00
config_test.go feat(web): support list editing for channel array fields (#2595) 2026-04-21 16:04:28 +08:00
exec_nonwindows.go refactor(onboard,api): harden copydir repo-root detection and use platform-neutral proc attrs naming 2026-04-25 00:31:36 +08:00
exec_windows.go refactor(onboard,api): harden copydir repo-root detection and use platform-neutral proc attrs naming 2026-04-25 00:31:36 +08:00
gateway.go feat(provider,web,asr): enhance model management with explicit provider metadata (#2701) 2026-05-06 16:06:49 +08:00
gateway_host.go fix(web): improve Pico URL and origin handling behind proxies 2026-04-20 10:11:03 +08:00
gateway_host_test.go fix(web): improve Pico URL and origin handling behind proxies 2026-04-20 10:11:03 +08:00
gateway_test.go feat(provider,web,asr): enhance model management with explicit provider metadata (#2701) 2026-05-06 16:06:49 +08:00
launcher_config.go refactor(web): switch dashboard auth from tokens to passwords (#2608) 2026-04-21 18:04:15 +08:00
launcher_config_test.go refactor(web): switch dashboard auth from tokens to passwords (#2608) 2026-04-21 18:04:15 +08:00
log.go refactor Config to add Version and migratable 2026-03-12 13:52:55 +08:00
model_status.go feat(web,api): provider selection and model form foundation (#2831) 2026-05-11 16:57:37 +08:00
model_status_test.go fix(api): enhance model availability probing with backoff and caching mechanisms (#2231) 2026-04-01 14:15:28 +08:00
models.go feat(provider,web,asr): enhance model management with explicit provider metadata (#2701) 2026-05-06 16:06:49 +08:00
models_test.go feat(provider,web,asr): enhance model management with explicit provider metadata (#2701) 2026-05-06 16:06:49 +08:00
oauth.go refactor: support explicit provider field in model list entries (#2609) 2026-04-22 11:28:47 +08:00
oauth_test.go refactor: support explicit provider field in model list entries (#2609) 2026-04-22 11:28:47 +08:00
pico.go Feat(channels): unify animated tool feedback across chat channels and Pico (#2622) 2026-04-23 10:35:50 +08:00
pico_test.go Feat(channels): unify animated tool feedback across chat channels and Pico (#2622) 2026-04-23 10:35:50 +08:00
router.go Keep launcher locale changes from mutating shared web-search routing (#2573) 2026-04-24 13:45:25 +08:00
session.go fix(tool-feedback): dedupe duplicate content and keep full explanations 2026-04-26 00:40:55 +08:00
session_test.go fix(tool-feedback): dedupe duplicate content and keep full explanations 2026-04-26 00:40:55 +08:00
skills.go refactor skills registries and add GitHub-backed skill discovery (#2442) 2026-04-14 15:14:16 +08:00
skills_test.go refactor skills registries and add GitHub-backed skill discovery (#2442) 2026-04-14 15:14:16 +08:00
startup.go feat(web): add service log level controls (#2227) 2026-03-31 20:32:42 +08:00
startup_test.go feat(web): add service log level controls (#2227) 2026-03-31 20:32:42 +08:00
tools.go feat(config): wire serial tool into runtime and dashboard 2026-04-28 12:56:27 +08:00
tools_test.go feat(config): wire serial tool into runtime and dashboard 2026-04-28 12:56:27 +08:00
update.go feat(updater): robust self-update selection & extraction (nightly default) (#2201) 2026-04-01 23:41:32 +08:00
version.go feat(web): display backend version info in sidebar (#2087) 2026-03-30 16:44:50 +08:00
version_test.go feat(web): display backend version info in sidebar (#2087) 2026-03-30 16:44:50 +08:00
wecom.go refactor(config): make config.Channel to multiple instance support 2026-04-13 22:21:21 +08:00
weixin.go fix some bugs: 2026-04-14 00:15:35 +08:00
weixin_test.go refactor(config): make config.Channel to multiple instance support 2026-04-13 22:21:21 +08:00