feat(dashboard/agents): allow a custom model id when editing an agent (#6318)#6327
Merged
Conversation
…#6318) The agent detail drawer's model editor was a plain `<select>` populated only from the provider's catalog models, so an agent-type provider (codex-cli / claude-code / gemini-cli) — which carries no catalog models — left the field stuck on a disabled "No models" option, and a provider pointed at a third-party base whose model the catalog doesn't list could not be set at all. Driver-level pass-through already accepts any model id (each agent driver's `model_flag` falls through to the raw name), and the create form already drops to a free-text input when the catalog is empty; only the edit path blocked it. Make the edit field an `<input list=…>` + `<datalist>` combobox: it still suggests the catalog models for the chosen provider, but now accepts a typed-in id, so a third-party base model is settable from the UI when editing an existing agent — matching the create form. Drops the now-unused `agents.no_models` key from en/zh/uk (the disabled placeholder option it backed is gone).
This was referenced Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses #6318 (the "manually manage the base model" half). Lets you set a model id that isn't in the catalog when editing an existing agent, so an agent-type provider (codex-cli / claude-code / gemini-cli) pointed at a third-party base can be configured from the dashboard.
Background
model_flag(crates/librefang-llm-drivers/src/drivers/{codex_cli,claude_code,gemini_cli}.rs) falls through_ => Some(stripped.to_string()), so an unknown model id reaches the CLI verbatim. There is no hard rejection — this is not a backend bug.OPENAI_BASE_URL,ANTHROPIC_BASE_URL, …), which LibreFang doesn't manage.AgentManifestForm) already drops to a free-text<input>when the provider has no catalog models, so custom ids were enterable there.<select>populated only from catalog models, showing a disabled "No models" option for agent-type providers (whose catalog is empty) — so you could not change an existing agent to a custom / third-party model from the UI.Change
crates/librefang-api/dashboard/src/pages/AgentsPage.tsx— the detail-drawer model field becomes an<input list=…>+<datalist>combobox. It still suggests the provider's catalog models, but now accepts a typed-in id. Provider-not-selected / loading states move to the input'splaceholder; the disabled "No models" dead-end is gone. The existing auto-select-single-model effect (#5917) and the per-id save flow are unchanged.Removed the now-unused
agents.no_modelsi18n key fromen/zh/uk(locale parity preserved; the dead-key coverage test enforces this).Out of scope
The other half of #6318 — auto-detecting the model an agent CLI actually ran — is a separate enhancement. codex-cli already does this via
parse_model_from_banner; claude-code's JSON output carries amodelfield that isn't parsed yet. Left for a follow-up so this UI fix can land independently.Verification
In
crates/librefang-api/dashboard/:pnpm typecheck— cleanpnpm lint— 0 errors (warnings are pre-existing baseline)pnpm test --run— 838 passed (85 files), including the locale dead-key + parity gatespnpm build— succeedsNo render-test was added for the model editor:
AgentsPage.test.tsxdocuments that the page has no render harness (~20 hooks) and tests the extractedSystemPromptSectiondirectly. The change is a<select>→<input list>swap with identicalvalue/onChange/disabledwiring, covered by typecheck + build.