molecule-core/canvas/src/hooks
Hongming Wang 9eb22333a5 fix(deploy-modal): snap provider radio when model resolves to a provider
The TemplatePalette deploy modal (MissingKeysModal → ProviderPickerModal)
let the model field and provider radio drift apart. When a hermes
template defaulted the model to "MiniMax-M2.7-highspeed" but the radio
defaulted to providers[0] (Anthropic), the env-var input below asked
for ANTHROPIC_API_KEY. A user pasting their MINIMAX_API_KEY there (or
just dismissing the dialog) ended up with a workspace whose
runtime_config.model=MiniMax + ANTHROPIC_API_KEY env — the hermes
adapter then crashed during boot before /registry/register, surfacing
as WORKSPACE_PROVISION_FAILED 12 minutes later.

Caught 2026-05-02 on hongming/Hermes Agent (workspace 95ed3ff2-…
ended with: "container started but never called /registry/register").

Sibling of the ConfigTab cascade fix in PR #2516 (task #236) — same
pattern, different surface. Plumbs the template's full ModelSpec[]
(with required_env per model) into the picker. When the typed model
matches a registry entry, snap the radio so the env-var fields
underneath match what the model actually needs.

Free-text models (typed slug not in the registry) and models with no
required_env (local/self-hosted endpoints) leave the radio alone — the
user can still pick a provider manually. Backwards-compat: callers
that don't pass `models` get the pre-cascade behavior, pinned by a
regression test.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 19:01:13 -07:00
..
__tests__ feat(canvas): always prompt provider+model on template deploy 2026-05-01 17:19:14 -07:00
use-keyboard-shortcut.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
useSocketEvent.ts refactor(canvas): route panel WS subscriptions through global socket 2026-04-27 13:12:47 -07:00
useTemplateDeploy.tsx fix(deploy-modal): snap provider radio when model resolves to a provider 2026-05-02 19:01:13 -07:00
useWorkspaceName.ts initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00