Skip to content

🙌 OpenHands: AI-Driven Development

33.0 KB
Raw Blame

F12 — Model router (meta-LLM profiles)

A model router (the UI also calls it a "meta-profile") names a classifier LLM profile, a prompt template and a model table. On a local backend each OpenHands agent profile picks its router in Settings → Agent (F13.profile-router); a conversation launched from a profile with a router gets a route_task_to_model tool: the classifier picks one saved LLM profile from the table and the agent switches to it (the chat shows Switched to profile <name>). With Run on first message on, the agent is told to route the first user message before doing anything else. Users create routers from the Router Pro / Router Flash templates or from scratch, can have the missing router LLM profiles created from a provider connection, and edit and delete routers under Settings → Model Router. Only an organization-bound Cloud backend still activates one router on this page.

Source: src/routes/meta-llm-settings.tsx, src/components/features/settings/meta-llm-profiles/, src/api/meta-profiles-service/meta-profiles-service.api.ts, src/api/agent-server-adapter.ts (buildRouterAtStartSystemSuffix), src/constants/settings-nav.tsx, src/hooks/mutation/use-delete-meta-profile.ts.

Sub-features

  • F12.page: Settings → Model Router opens /settings/meta-llm with the subtitle Meta-profiles that route each task to the right LLM profile.; the command menu offers a Model Router command that opens it, like the other settings pages.
  • F12.empty-states: with no LLM profiles the page says Create LLM profiles first — meta-profiles route between your saved LLM profiles.; with no routers it says No meta-profiles yet. Add one to route tasks across your LLM profiles. and Run on first message is off and disabled.
  • F12.load-error: when only the meta-profile request fails, a red generic error shows under the header.
  • F12.unsupported: an agent server without /api/meta-profiles (404) shows This backend doesn't support model routing yet. Update the agent server to manage meta-profiles.
  • F12.cloud: a Cloud backend without an organization shows Meta-profiles are only available for local backends.; an organization-bound Cloud backend shows the full page.
  • F12.template-chooser: Add Model Router opens Choose Model Router template (Add OpenHands Router Pro, Add OpenHands Router Flash, Custom, Cancel); Cancel, Escape and a backdrop click close it; Pro and Flash prefill the name, classifier minimax-m3, their own long routing prompt and the same 11-model table.
  • F12.template-custom: Custom opens a blank editor; the placeholders show an example prompt and a two-line example model table.
  • F12.editor-validation: Save stays disabled until the name is valid, a classifier is set and the prompt contains {{ instance_text }} (spaces inside the braces optional).
  • F12.duplicate-name: a new router cannot take an existing router's name (A meta-profile with this name already exists..., Save disabled).
  • F12.add-connection: Add connection in the create editor opens Add provider connection; saving it selects the new connection in the picker.
  • F12.add-connection-cancel: Cancel in Add provider connection closes it without creating a connection and keeps the editor's values and picker choice.
  • F12.editor-cancel: while the create or edit editor is open it replaces the list, Add Model Router and the switch; Cancel returns to the list without saving anything.
  • F12.router-profiles: with a connection picked under Create missing router LLM profiles using, Save creates an LLM profile <provider>/<name> linked to that connection for every model-table name (and the classifier) that does not exist yet; Don't create profiles creates none.
  • F12.create-first: saving the first router lists it and turns Run on first message on; locally no router becomes active (active_meta_profile stays null).
  • F12.create-more: saving another router lists it and leaves Run on first message as it was.
  • F12.list: each row shows the name, <classifier> · Direct prompt and a ... menu (no Active badge locally; Cloud shows it on the active router); routers survive a stack restart.
  • F12.row-menu: the row menu offers Edit and Delete (Cloud adds Set active, disabled on the active row), and closes on Escape.
  • F12.activate: on an organization-bound Cloud backend, Set active toasts Meta-profile "<name>" activated and moves the badge. Local backends have no Set active (blocked here: needs a Cloud organization).
  • F12.edit: Edit opens Edit meta-profile with the name locked and no connection picker; changes persist.
  • F12.delete: Delete asks Are you sure you want to delete "<name>"? This cannot be undone.; Cancel keeps the row, Delete removes it and detaches it from every agent profile that used it (meta_profile_ref null, routing off).
  • F12.delete-active: deleting the last router shows the empty state and the switch off and disabled (the stored preference keeps its value); profiles that used it launch without the tool or the first-message instruction.
  • F12.run-first-message-toggle: the switch is enabled while any router exists, saves immediately (no Save button, no toast) and survives a reload; its help reads Route the first message of every new conversation through its agent profile's Model Router before the agent proceeds. Each agent profile picks its router in Settings → Agent.
  • F12.route-first-message: with the launched agent profile's router set and the switch on, a new conversation routes its first message (route_task_to_model action, Switched to profile <name> in the chat); with the switch off the tool is still attached but the instruction is absent.
  • F12.light-theme: in a light colour theme the list heading and router names are readable.
  • F12.phone: the list, template modal, editor and row menu fit a 390 px viewport without horizontal overflow.

How to get to it (user POV)

  • Sidebar settings gear (backend-selector-settings-link), then Model Router in the settings navigation (sidebar-settings-/settings/meta-llm, between LLM and Condenser). Used by F12.page.
  • Direct URL /settings/meta-llm. Used by most recipes (browser goto).
  • Command menu (Control+k or Meta+k, or command-menu-trigger in the sidebar): search "Model Router" (or "router", "meta"), choose Model Router ("Meta-profiles that route each task to the right LLM profile."). Used by F12.page.
  • Per-router actions: the row ... button (meta-profile-menu-trigger-<name>), then Edit / Set active / Delete.
  • The effect of a router is seen in a conversation started from the home composer (F12.route-first-message; see F05/F06 for the composer and activity rendering).

Driving it with control-openhands

Preconditions:

  • F12.empty-states needs a fresh launch --new with onboard --skip done and before llm preset deepseek (no LLM profiles, no routers).

  • Everything after it needs control-openhands llm preset deepseek --api-key-file <key file> (profiles deepseek-flash and deepseek-pro), no meta-profile named QA_* (control-openhands api GET /api/meta-profiles), no provider connection (control-openhands api GET /api/llm/provider-connections is []) and no LLM profile named deepseek-chat (control-openhands api GET /api/profiles).

  • F12.add-connection and F12.route-first-message use the DeepSeek key file; never print it.

  • Blocked here: F12.unsupported (needs an agent server older than software-agent-sdk #3744, for example launch --new --sdk-ref <older release>), F12.cloud and F12.activate (need a Cloud account, with and without an organization) and F12.load-error (needs /api/meta-profiles to fail while the rest of the agent server answers; service stop agent-server swaps the whole app for the Manage backends card instead).

  • Desktop viewport unless a bullet says otherwise.

  • Open from navigation (F12.page). From / run control-openhands browser click 'testid=backend-selector-settings-link' --expect-url '/settings', control-openhands browser click 'testid=sidebar-settings-/settings/meta-llm' --expect-url '/settings/meta-llm(\?|$)', control-openhands browser text 'testid=settings-page-subtitle' and control-openhands browser attr 'testid=sidebar-settings-/settings/meta-llm' aria-current. The subtitle is Meta-profiles that route each task to the right LLM profile. and aria-current is page.

  • Command menu (F12.page). Run control-openhands browser goto / (the previous bullet ends on /settings/meta-llm, where the URL wait would pass at once), control-openhands browser press Control+k, control-openhands browser type 'testid=command-menu >> role=combobox' 'Model Router' and control-openhands browser snapshot 'testid=command-menu': the only option is Model Router Meta-profiles that route each task to the right LLM profile. Go [selected]. control-openhands browser fill 'testid=command-menu >> role=combobox' router (and then meta) keeps that single option (control-openhands browser count 'testid=command-menu >> role=option' is 1). Run control-openhands browser press Enter and control-openhands browser wait-url '/settings/meta-llm(\?|$)'; browser text 'testid=settings-page-subtitle' is the subtitle above.

  • Empty states (F12.empty-states). On the fresh run run control-openhands browser goto /settings/meta-llm, control-openhands browser text 'testid=meta-profile-no-llm-profiles', control-openhands browser text 'testid=meta-profile-empty' and control-openhands browser eval "(()=>{const i=document.querySelector('[data-testid=meta-profile-run-at-conversation-start-switch]');return {checked:i.checked,disabled:i.disabled}})()". The texts are the two messages in Sub-features, the switch is {checked:false, disabled:true} and browser text 'testid=meta-profile-run-at-conversation-start' carries the per-profile help text (F12.run-first-message-toggle). control-openhands browser screenshot --feature F12.empty-states --name no-llm-profiles shows both messages above a greyed switch.

  • Template chooser (F12.template-chooser). Run control-openhands browser click 'testid=add-meta-profile' and control-openhands browser snapshot 'role=dialog': dialog Choose Model Router template with buttons Add OpenHands Router Pro, Add OpenHands Router Flash, Custom, Cancel. control-openhands browser click 'testid=meta-profile-template-cancel' then control-openhands browser count 'testid=meta-profile-template-modal' is 0; reopen and control-openhands browser press Escape gives 0 too. Reopen, control-openhands browser click 'testid=meta-profile-template-router-pro', then control-openhands browser value 'testid=meta-profile-name-input' (openhands-router-pro), control-openhands browser value 'testid=meta-profile-classifier-input' (minimax-m3), control-openhands browser eval "document.querySelector('[data-testid=meta-profile-model-table]').value.split('\n').length" (11), control-openhands browser eval "document.querySelector('[data-testid=meta-profile-prompt-template]').value.includes('{{ instance_text }}')" (true), control-openhands browser value 'testid=meta-profile-router-connection' (Don't create profiles while no connection exists) and control-openhands browser enabled 'testid=meta-profile-save' (true). Leave with control-openhands browser click 'testid=meta-profile-cancel'. The Flash template (testid=meta-profile-template-router-flash) gives openhands-router-flash, the same classifier and identical table, and a different prompt (about 5,900 characters against Pro's 5,000; compare with browser eval "document.querySelector('[data-testid=meta-profile-prompt-template]').value.length"). A backdrop click also closes the chooser: reopen it and control-openhands browser mouse-click 20 980, then count is 0.

  • Custom template (F12.template-custom). Run control-openhands browser click 'testid=add-meta-profile', control-openhands browser click 'testid=meta-profile-template-custom', then control-openhands browser value on testid=meta-profile-name-input, testid=meta-profile-classifier-input, testid=meta-profile-prompt-template and testid=meta-profile-model-table (all ""), control-openhands browser enabled 'testid=meta-profile-save' (false) and control-openhands browser eval "document.querySelector('[data-testid=meta-profile-model-table]').placeholder.split('\n')": two example rows, ["- GPT-5.4: strong for coding and reasoning", "- MiniMax-M3: efficient fallback"], joined by a real line break (#18035), and control-openhands browser screenshot --feature F12.template-custom --name custom-empty shows them on two lines under the prompt placeholder, which breaks lines the same way.

  • Validation (F12.editor-validation). In that Custom editor run control-openhands browser fill 'testid=meta-profile-name-input' 'QA router!', control-openhands browser fill 'testid=meta-profile-classifier-input' qa-classifier, control-openhands browser fill 'testid=meta-profile-prompt-template' 'Pick a model for: {{ instance_text }}' and control-openhands browser enabled 'testid=meta-profile-save' (false: bad name). control-openhands browser fill 'testid=meta-profile-name-input' QA_router turns it true; control-openhands browser fill 'testid=meta-profile-prompt-template' 'Pick a model for: {{ task }}' turns it false; 'Pick a model for: {{instance_text}}' turns it true again; control-openhands browser fill 'testid=meta-profile-classifier-input' '' turns it false. Keep the editor open.

  • Add a connection (F12.add-connection). Run control-openhands browser click 'testid=meta-profile-add-provider-connection', control-openhands browser fill 'testid=provider-connection-name-input' QA_deepseek, control-openhands browser fill 'testid=provider-connection-provider-input' deepseek, control-openhands browser click 'role=option[name="deepseek"]', control-openhands browser fill 'testid=provider-connection-api-key-input' --value-file <key file>, control-openhands browser click 'testid=provider-connection-submit' and control-openhands browser wait 'testid=provider-connection-modal' --state detached. control-openhands browser toasts has Connection "QA_deepseek" created and control-openhands browser value 'testid=meta-profile-router-connection' is QA_deepseek (deepseek).

  • Create the first router (F12.create-first, F12.router-profiles). Write the prompt and table to files: printf 'You route tasks. Reply only with JSON {"model": "<name>", "reason": "<short>"} using one name from this table:\n{{ model_table }}\n\nTask:\n{{ instance_text }}' > <prompt file> and printf -- '- deepseek-flash: cheap, for simple tasks\n- deepseek-pro: stronger, for hard tasks\n- deepseek-chat: general chat' > <table file>. Run control-openhands browser click 'testid=meta-profile-classifier-input', control-openhands browser click 'role=option[name="deepseek-flash"]', control-openhands browser fill 'testid=meta-profile-name-input' QA_router, control-openhands browser fill 'testid=meta-profile-prompt-template' --value-file <prompt file>, control-openhands browser fill 'testid=meta-profile-model-table' --value-file <table file>, control-openhands browser click 'testid=meta-profile-save' and control-openhands browser wait-text 'Meta-profile "QA_router" saved'. After control-openhands browser reload: control-openhands browser text 'testid=meta-profile-row-QA_router' is QA_router\ndeepseek-flash · Direct prompt, control-openhands browser count 'testid=meta-profile-active-badge' is 0, the switch eval above returns {checked:true, disabled:false}, control-openhands api GET /api/meta-profiles has active_meta_profile null, control-openhands api GET /api/settings has "run_router_at_conversation_start": true, and control-openhands api GET /api/profiles has a new deepseek-chat (deepseek/deepseek-chat, provider_connection_id set) while deepseek-flash/deepseek-pro are unchanged. control-openhands browser screenshot --feature F12.create-first --name list-after-create shows the row without a badge and the switch on.

  • Duplicate name (F12.duplicate-name). Run control-openhands browser click 'testid=add-meta-profile', control-openhands browser click 'testid=meta-profile-template-custom', control-openhands browser fill 'testid=meta-profile-name-input' QA_router, control-openhands browser text 'testid=meta-profile-name-taken' (A meta-profile with this name already exists. Choose a different name, or edit the existing one.), pick classifier deepseek-pro as above, fill the prompt with 'Route: {{ instance_text }}', and control-openhands browser enabled 'testid=meta-profile-save' (false). control-openhands browser fill 'testid=meta-profile-name-input' QA_router_2 makes control-openhands browser count 'testid=meta-profile-name-taken' 0 and Save true. Click testid=meta-profile-cancel; control-openhands browser count 'testid=meta-profile-row-QA_router_2' is 0.

  • "Don't create profiles" in a template (F12.router-profiles). Run control-openhands browser click 'testid=add-meta-profile', control-openhands browser click 'testid=meta-profile-template-router-pro', control-openhands browser value 'testid=meta-profile-router-connection' (QA_deepseek (deepseek), preselected), control-openhands browser click 'testid=meta-profile-router-connection' and control-openhands browser click "role=option[name=\"Don't create profiles\"]" --observe 'testid=meta-profile-router-connection' --observe-ms 1500. The picker stays on Don't create profiles: the observed states are QA_deepseek (deepseek) at 0 ms and Don't create profiles about 300 ms later, with nothing after it, and control-openhands browser value 'testid=meta-profile-router-connection' is Don't create profiles. Cancel the editor (control-openhands browser click 'testid=meta-profile-cancel'); F12.create-more saves a template with this choice. The Custom template starts on Don't create profiles even with a connection present; there, pick role=option[name="QA_deepseek (deepseek)"] first and then Don't create profiles: the second pick sticks. Cancel the editor.

  • Create another router without new profiles (F12.create-more, F12.router-profiles). Run control-openhands browser click 'testid=add-meta-profile', control-openhands browser click 'testid=meta-profile-template-router-flash', control-openhands browser value 'testid=meta-profile-router-connection' (QA_deepseek (deepseek), preselected), control-openhands browser fill 'testid=meta-profile-name-input' QA_router_flash, control-openhands browser click 'testid=meta-profile-router-connection', control-openhands browser click "role=option[name=\"Don't create profiles\"]" and control-openhands browser value 'testid=meta-profile-router-connection' (Don't create profiles). Then control-openhands browser click 'testid=meta-profile-save' and control-openhands browser wait-text 'Meta-profile "QA_router_flash" saved'. After control-openhands browser reload, control-openhands browser text 'testid=meta-profile-list' is QA_router\ndeepseek-flash · Direct prompt\nQA_router_flash\nminimax-m3 · Direct prompt and control-openhands browser count 'testid=meta-profile-active-badge' is 0. control-openhands api GET /api/profiles still lists only deepseek-chat, deepseek-flash and deepseek-pro: none of the template's 11 models became a profile, so QA_router_flash names a classifier (minimax-m3) that does not exist, which saving allows (see Gotchas).

  • Row menu (F12.row-menu). Run control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router' and control-openhands browser snapshot 'testid=meta-profile-actions-menu' (menuitem "Edit", menuitem "Delete"; browser count 'testid=meta-profile-set-active' is 0); screenshot --feature F12.row-menu --name menu; control-openhands browser press Escape closes it (count 0).

  • Activate (F12.activate). Blocked locally: the row menu has no Set active. On an organization-bound Cloud backend, row menu → testid=meta-profile-set-active and wait-text 'Meta-profile "<name>" activated' move the Active badge; record blocked naming the Cloud organization login.

  • Edit (F12.edit). Run control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router', control-openhands browser click 'testid=meta-profile-actions-menu >> testid=meta-profile-edit', control-openhands browser text 'testid=meta-profile-editor >> role=heading' (Edit meta-profile), control-openhands browser enabled 'testid=meta-profile-name-input' (false), control-openhands browser count 'testid=meta-profile-router-connection' (0). Pick classifier deepseek-pro, fill testid=meta-profile-model-table with the first two table lines only, click testid=meta-profile-save and control-openhands browser wait-text 'Meta-profile "QA_router" saved'. After a reload the row reads QA_router\ndeepseek-pro · Direct prompt and control-openhands api GET /api/meta-profiles/QA_router shows the new classifier and table.

  • Cancel the connection dialog (F12.add-connection-cancel). Run control-openhands browser click 'testid=add-meta-profile', control-openhands browser click 'testid=meta-profile-template-custom', control-openhands browser fill 'testid=meta-profile-name-input' QA_router_cancel, control-openhands browser click 'testid=meta-profile-add-provider-connection', control-openhands browser fill 'testid=provider-connection-name-input' QA_unused, control-openhands browser click 'role=dialog >> role=button[name="Cancel"]' (the Cancel button has no test id) and control-openhands browser wait 'testid=provider-connection-modal' --state detached. browser value 'testid=meta-profile-name-input' is still QA_router_cancel, the picker still reads Don't create profiles, and control-openhands api GET /api/llm/provider-connections has no QA_unused (display_name is the field).

  • Leave the editor (F12.editor-cancel). In that editor control-openhands browser count on testid=meta-profile-list, testid=add-meta-profile and testid=meta-profile-run-at-conversation-start is 0 each. Pick classifier deepseek-flash, fill the prompt 'Pick: {{ instance_text }}', click testid=meta-profile-cancel: count 'testid=meta-profile-list' is 1, count 'testid=meta-profile-row-QA_router_cancel' is 0 and api GET /api/meta-profiles has no QA_router_cancel. In edit mode (row menu → Edit on QA_router), control-openhands browser fill 'testid=meta-profile-prompt-template' 'Changed: {{ instance_text }}' then Cancel leaves control-openhands api GET /api/meta-profiles/QA_router with its saved prompt_template.

  • Run on first message (F12.run-first-message-toggle). Run control-openhands browser click 'testid=meta-profile-run-at-conversation-start >> text=Run on first message', then control-openhands browser reload and the switch eval: checked flips and stays flipped; api GET /api/settings shows run_router_at_conversation_start with the same value; control-openhands browser toasts is empty. Click again to restore true.

  • Routing in a conversation (F12.route-first-message). Set the active agent profile's router to QA_router (Settings → Agent → Edit → agent-settings-router-select, F13.profile-router; the recipe there uses a named profile QA_oh pinned to deepseek-pro, activated with Set as active) with the switch on. Run control-openhands conversation start --prompt "Run echo routed in the terminal and tell me its output." --wait --timeout 300, then control-openhands conversation events <id> --kinds ActionEvent,ObservationEvent,MessageEvent (<id> from the start output). The first action is route_task_to_model, its observation starts Classified task as 'model: deepseek-flash' and switched to LLM profile 'deepseek-flash', then the terminal runs echo routed. On the conversation page control-openhands browser wait-text 'Switched to profile' succeeds and control-openhands browser screenshot --feature F12.route-first-message --name conversation shows the Switched to profile deepseek-flash line above the answer. control-openhands api GET "/api/conversations/<id>/events/search?limit=1" --max-bytes 200000 (the system prompt) contains ROUTE_AT_CONVERSATION_START and "route_task_to_model". Switch Run on first message off (control-openhands browser goto /settings/meta-llm first: the browser is on the conversation), start --prompt "Reply with only the word pong.", and the same GET contains "route_task_to_model" but no ROUTE_AT_CONVERSATION_START; there is no route action.

  • Delete (F12.delete). Run control-openhands browser goto /settings/meta-llm, control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router_flash', control-openhands browser click 'testid=meta-profile-actions-menu >> testid=meta-profile-delete' and control-openhands browser snapshot 'role=dialog' (Delete meta-profile, Are you sure you want to delete "QA_router_flash"? This cannot be undone., Cancel, Delete). control-openhands browser click 'role=dialog >> role=button[name="Cancel"]' keeps the row (count 1). Repeat the menu click, then control-openhands browser click 'testid=delete-meta-profile-confirm', control-openhands browser wait-text 'Meta-profile "QA_router_flash" deleted', control-openhands browser reload; control-openhands browser count 'testid=meta-profile-row-QA_router_flash' is 0.

  • Delete the last router (F12.delete-active). With QA_router the active agent profile's router, the switch on and no other router left (delete QA_router_2 first if F13 created it), delete it the same way (wait-text 'Meta-profile "QA_router" deleted'). After a reload testid=meta-profile-empty is back and the switch eval is {checked:false, disabled:true}, while api GET /api/settings still has "run_router_at_conversation_start": true; api GET /api/agent-profiles/<profile> has meta_profile_ref null and enable_classify_and_switch_llm_tool false (screenshot --feature F12.delete-active --name last-deleted). A new conversation start --prompt "Reply with only the word pong." --wait has neither "route_task_to_model" nor ROUTE_AT_CONVERSATION_START in its events/search output.

  • Light theme (F12.light-theme). No router is left after F12.delete-active, whose last conversation start left the browser on a conversation: run control-openhands browser goto /settings/meta-llm and create one through Custom as in F12.phone (name QA_router_light, classifier deepseek-flash, prompt 'Pick one model for: {{ instance_text }}', wait-text 'Meta-profile "QA_router_light" saved'), then control-openhands browser goto /settings/app, control-openhands browser click 'testid=color-theme-input', control-openhands browser click 'role=option[name="Light+"]', control-openhands browser goto /settings/meta-llm and control-openhands browser eval "(()=>{const h=[...document.querySelectorAll('h2')].find(e=>e.textContent.includes('Available meta-profiles'));const n=document.querySelector('[data-testid^=meta-profile-row-] span');return {heading:getComputedStyle(h).color,rowName:getComputedStyle(n).color,bg:getComputedStyle(document.body).backgroundColor}})()". It returns {heading: "rgb(31, 31, 31)", rowName: "rgb(31, 31, 31)", bg: "rgb(255, 255, 255)"}: dark text, the same ink as LLM profile names on /settings/llm. control-openhands browser screenshot --feature F12.light-theme --name list shows the heading Available meta-profiles and the name QA_router_light next to its summary. Restore with role=option[name="OpenHands-Neutral"] the same way, then delete QA_router_light through its row menu (wait-text 'Meta-profile "QA_router_light" deleted') so F12.phone starts on a router-less page.

  • Phone (F12.phone, also re-proves F12.create-first on a router-less page). Run control-openhands browser viewport phone, control-openhands browser goto /settings/meta-llm, control-openhands browser click 'testid=add-meta-profile' and control-openhands browser bbox 'testid=meta-profile-template-modal' (insideViewport true, pageHorizontalOverflow false). Choose Custom, fill QA_router_phone, classifier deepseek-flash and prompt 'Pick one model for: {{ instance_text }}'; control-openhands browser bbox 'testid=meta-profile-editor' has no page overflow (taller than the screen, scrolls). Save, reload, then control-openhands browser bbox 'testid=meta-profile-row-QA_router_phone' and, after control-openhands browser click 'testid=meta-profile-menu-trigger-QA_router_phone', control-openhands browser bbox 'testid=meta-profile-actions-menu' are inside the viewport without page overflow. control-openhands browser screenshot --feature F12.phone --name list shows QA_route… truncated, the summary and the switch on. Return with control-openhands browser viewport desktop.

  • Restart persistence (F12.list). Run control-openhands restart, control-openhands doctor, control-openhands browser goto /settings/meta-llm and control-openhands browser count 'testid=meta-profile-row-QA_router_phone'; it is 1.

  • Cleanup. Switch Run on first message off through its label first (it disables once no router is left), then delete each QA_* router through the row menu. Remove the arranged LLM profile and connection with control-openhands api DELETE /api/profiles/deepseek-chat --write and control-openhands api DELETE /api/llm/provider-connections/<connection id> --write (<connection id> from control-openhands api GET /api/llm/provider-connections), or through Settings → LLM (F10).

Gotchas

  • Settings nav test ids embed the route: quote 'testid=sidebar-settings-/settings/meta-llm' as written.
  • The empty-state hint about LLM profiles only exists before any profile is saved: drive F12.empty-states first on a fresh run.
  • The first router you create turns Run on first message on by itself; later routers do not. Locally no router is ever active here: whether a conversation routes depends on its agent profile's router (F13.profile-router).
  • Run on first message is an sr-only checkbox (keyboard reachable): click the label text inside testid=meta-profile-run-at-conversation-start and read .checked/.disabled with browser eval. The stored preference (misc_settings.app_preferences.run_router_at_conversation_start) is independent of what the disabled switch shows; with no active router it may still be true. Turn it off before deleting the last router, or a later "first router" will not re-enable it because it is already on.
  • Router templates name 11 models (gpt-5.4 … claude-sonnet-4-5) that will not exist in a sandbox. With a provider connection present, a template preselects it, and saving creates all 11 as LLM profiles linked to that connection unless you pick Don't create profiles first (F12.create-more does). If a run created them, remove them with for p in gpt-5.4 gpt-5.5 minimax-m3 claude-opus-4-6 claude-opus-4-7 claude-opus-4-8 claude-fable-5 kimi-k2.5 kimi-k2.6 deepseek-v3.2-reasoner claude-sonnet-4-5; do control-openhands api DELETE /api/profiles/$p --write; done (they live in the run's private state and only add rows to Settings → LLM).
  • Profile matching is case-insensitive and exact by name: table rows are - <profile name>: description; existing deepseek-flash/deepseek-pro are not re-created, and the endpoint is derived as <provider lowercased>/<name>.
  • The classifier and the model table refer to LLM profile names, not model ids. A router whose classifier profile does not exist (for example a template's minimax-m3 without a connection) saves fine and only fails when a conversation tries to route.
  • The agent decides whether to call route_task_to_model: a prompt that conflicts with routing (Reply with only the word pong.) made deepseek-flash skip the call even with the instruction present. Use a task-like prompt for the positive check and assert the system prompt via events/search for the instruction itself.
  • conversation events does not print the system prompt; read it with control-openhands api GET "/api/conversations/<id>/events/search?limit=1" --max-bytes 200000 and grep the output.
  • service stop agent-server does not show this page's error state: the whole app switches to the Manage backends card (F02). Run control-openhands restart afterwards.
  • The selection in the classifier and connection pickers is a combobox: open it with a click on the input, then click role=option[name="..."]; browser fill on the classifier sets a free-text value (allowed) instead of picking a profile.
  • At 390 px the row truncates the name (QA_route…) and summary; read names with browser text, not the screenshot.
  • The Model table placeholder displays separate lines (F12.template-custom).
  • Known issue OpenHands/software-agent-sdk#5878: Router files can be written under a literal ~ directory when Agent Server was configured with leading-tilde OH_PERSISTENCE_DIR. Blocked on the normal absolute-path launcher fixture: needs a disposable server with private HOME/cwd and literal ~/... or relative persistence configuration, then a router save and filesystem readback. Never point it at user state. (F12.create-first, F12.list).