Skip to content

fix(canvas): forward-port dynamic runtime dropdown (#1526) to main - #1666

Merged
HongmingWang-Rabbit merged 1 commit into
mainfrom
fix/canvas-dynamic-runtime-forward-port
Apr 22, 2026
Merged

fix(canvas): forward-port dynamic runtime dropdown (#1526) to main#1666
HongmingWang-Rabbit merged 1 commit into
mainfrom
fix/canvas-dynamic-runtime-forward-port

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Bug

Hermes Agent workspace loads Config tab → Runtime dropdown shows "LangGraph (default)" (silent fallback from empty value because there's no `<option value="hermes">` in the hardcoded list). Model + Required Env Vars are empty placeholder text. Clicking "Save & Deploy" provisions with empty values → instant-fail.

Root cause

PR #1526 shipped the dynamic `/templates`-driven Runtime + Model + Env UI on 2026-04-22 at 15:07 UTC, but merged into `staging` not `main`. The staging→main promotion (#1496) has been open-unmerged with 1172 commits divergence. Prod canvas builds from `main`.

Fix

Forward-ports the three files from #1526 (commit `359dc61` on staging) directly to `main`, without pulling the 1171 unrelated staging commits:

File Change
`canvas/src/components/tabs/ConfigTab.tsx` `RuntimeOption` + `FALLBACK_RUNTIME_OPTIONS` (includes `hermes`, `gemini-cli`) + useEffect that fetches `/templates` + dynamic `` rendering + Model combobox w/ datalist + Env auto-populate from selected model's `required_env`
`workspace-server/internal/handlers/templates.go` `/templates` returns `[{id, name, runtime, models}]` with per-model `required_env`
`workspace-server/internal/handlers/templates_test.go` Tests for runtime+models parsing + legacy top-level model fallback

Verified

  • `go build ./...` clean
  • `go test ./internal/handlers/ -run 'TestTemplates'` → all pass
    • `TestTemplatesList_RuntimeAndModelsRegistry`
    • `TestTemplatesList_LegacyTopLevelModel`
    • `TestTemplatesList_NonexistentDir`

Follow-up

The underlying process issue is the staging→main promotion gap (#1496 open 1172 commits behind). Either that PR should merge, or we should adopt landing fixes on `main` directly (which several PRs have done today). Files in this PR were chosen minimally to avoid pulling unrelated staging changes.

Test plan

  • Build + tests pass
  • Deploy to canvas, reload hongmingwang.moleculesai.app Config tab on a Hermes workspace, confirm:
    • Runtime dropdown shows "Hermes" (not "LangGraph (default)")
    • Model field is a combobox with hermes model options (nousresearch/hermes-4-70b etc.)
    • Selecting a model auto-fills Required Env Vars (e.g. HERMES_API_KEY)

🤖 Generated with Claude Code

…1526)

PR #1526 shipped the /templates registry + canvas dynamic Runtime /
Model / Required-Env fields on 2026-04-22 — but merged into the
staging branch, not main. The staging→main promotion PR #1496 has
been open unmerged for a while with 1172 commits divergence, so
prod (which builds from main) still carries the old hardcoded
dropdown.

Symptom seen on hongmingwang.moleculesai.app today:

- New Hermes Agent workspace (template declares runtime: hermes) loads
  Config tab → Runtime dropdown shows "LangGraph (default)" because
  there's no <option value="hermes"> in the hardcoded list; it falls
  back to empty-value silently.
- Model field is a plain TextInput with static placeholder
  "e.g. anthropic:claude-sonnet-4-6" — should be a combobox populated
  from the selected runtime's models[].
- Required Env Vars is a TagList with static placeholder
  "e.g. CLAUDE_CODE_OAUTH_TOKEN" — should auto-populate from the
  selected model's required_env.
- Net effect: "Save & Deploy" sends empty model + empty env to the
  provisioner → workspace instant-fails.

This PR cherry-picks the exact three files from PR #1526 (#359dc61
on staging) forward to main, without pulling the other 1171
commits:

- canvas/src/components/tabs/ConfigTab.tsx
  - RuntimeOption interface + FALLBACK_RUNTIME_OPTIONS (hermes,
    gemini-cli included)
  - useEffect fetches /templates and populates runtimeOptions
    dynamically
  - dropdown renders from runtimeOptions (no hardcoded list)
  - Model becomes a combobox with datalist of available models
    per selected runtime
  - Required Env Vars auto-populates from the selected model's
    required_env on model change

- workspace-server/internal/handlers/templates.go
  - /templates endpoint returns [{id, name, runtime, models}] with
    per-template models registry (id, name, required_env)

- workspace-server/internal/handlers/templates_test.go
  - Tests for runtime+models parsing and legacy top-level model
    fallback

The canvas Runtime dropdown now resolves "hermes" correctly;
Model dropdown shows the models[] from the hermes template; Env
auto-populates with HERMES_API_KEY (or whichever model selected).

Verified locally:
  - workspace-server builds clean
  - Template handler tests pass: TestTemplatesList_RuntimeAndModelsRegistry,
    TestTemplatesList_LegacyTopLevelModel, TestTemplatesList_NonexistentDir

Follow-up: the staging→main promotion gap (#1496) is the
underlying process issue. Either merge that PR or adopt a policy
of landing fixes directly on main (as several PRs have today).
Files here were chosen minimally to avoid pulling unrelated staging
changes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit ed6f4c6 into main Apr 22, 2026
5 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the fix/canvas-dynamic-runtime-forward-port branch April 24, 2026 00:10
HongmingWang-Rabbit pushed a commit that referenced this pull request Jun 12, 2026
fix(e2e): wait for routable workspace before A2A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant