Skip to content

factory-server: search OpenRouter models in the stage panel - #295

Merged
moonthebot merged 2 commits into
mainfrom
factory/job-138-pr-10
Nov 27, 2026
Merged

moonthebot merged 2 commits into
mainfrom
factory/job-138-pr-10

Conversation

@moonthebot

@moonthebot moonthebot commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Why

OpenRouter lists hundreds of models, so a chip per model does not work. With OpenRouter selected, the stage panel's model field is now a search over the stored model list. Typing filters by a case-insensitive substring of the id or the name and lists the first 20 matches. Clicking a match, or ArrowDown and Enter, fills the field. Arrowing scrolls the active match into view.

The panel draws no chip, no "CLI default" chip and no datalist, and the node reads "Model required" while the field is blank. Any typed id still saves, for example one with a :free suffix. The hint reads "Search OpenRouter models." or "No OpenRouter model list is stored. Type a model id.".

While OpenRouter is selected the input is a combobox of the results list, with aria-expanded kept in sync and aria-activedescendant cleared when the list closes. Other agents keep the native datalist. The list goes into the form's data-agent-models JSON as search, once per form, so the browser makes no request to openrouter.ai. Switching agents redraws the field without a reload, on the Renovate agent card too. Without JavaScript the page is a plain text field with the hint.

Docs

docs/design.md gets a "The stage panel" subsection in the OpenRouter section. The Agent registry and Settings layout rows are updated.

Verification

  • cargo test -p factory-server --test dashboard --test pipeline_models_script: passed (641 and 7 tests).
  • cargo clippy -p factory-server --all-targets and cargo fmt --check: clean.
  • npx playwright test on openrouter-models, project-settings and local-models: 37 passed. This includes a new case that arrows past the visible rows and checks the scroll, the combobox attributes and Escape.
  • Earlier full nix develop -c just e2e run: only project-settings.spec.ts "a tabbed link in the settings sidebar scrolls into view with its whole outline" failed, and it also fails without this change.

With OpenRouter selected, the stage panel's model field is a search over
the stored model list. Typing filters by a case-insensitive substring of
the id or the name and offers the first 20 matches. The panel draws no
chip per model and no CLI default chip, and the node reads Model required
while the field is blank. Any typed id still saves.

The list travels once per form in data-agent-models, so the browser makes
no request to openrouter.ai. Switching agents redraws the field without a
reload, on the Renovate agent card too. The field is a combobox of the
results list while OpenRouter is selected and uses the native datalist
for the other agents.
@moonthebot
moonthebot force-pushed the factory/job-138-pr-10 branch from 90251e3 to ecdadbe Compare November 27, 2026 22:01
Switching a stage from OpenRouter back to another agent restored the
input's list attribute, but redrawModels had already looked the datalist
up through that attribute and found none. It now finds the datalist by
its stage id, so the other agent's options come back.
@moonthebot
moonthebot merged commit b0256dc into main Nov 27, 2026
3 checks passed
@moonthebot
moonthebot deleted the factory/job-138-pr-10 branch November 27, 2026 22:14
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