Skip to content

feat(provider): allow manual model entry when auto-discovery fails - #1

Closed
ikarys wants to merge 2 commits into
developfrom
feat/manual-model-entry
Closed

feat(provider): allow manual model entry when auto-discovery fails#1
ikarys wants to merge 2 commits into
developfrom
feat/manual-model-entry

Conversation

@ikarys

@ikarys ikarys commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Problem

Some providers (e.g. Cline) do not expose a /models endpoint. When adding such a provider, the auto-discovery returns 404 No models found and the user is blocked — the error block only offers Retry and Edit URL, with no way to specify the model name manually.

Solution

Add a manual model entry field to the provider modal (step 2), always visible so a model name can be typed in regardless of discovery outcome. The server already handles user-supplied models (buildModelConfigs assigns source: user), so the feature change is frontend-only.

Also fixes a pre-existing CI issue: the pr.yml workflow never installed web dependencies (cd web && npm ci), causing all web typecheck and test jobs to fail with Cannot find module 'overlayscrollbars-react'.

Changes

web/src/components/shared/ProviderModal.tsx

  • New addManualModel() function with:
    • Empty-input validation
    • Duplicate detection using the same normalization as the server (lowercase, ignore -_:. and whitespace)
    • Auto-selects the model and expands its config panel
    • Clears fetchError once a model is added
  • New UI section "Add model manually" in step 2 (field + Add button, Enter to submit)
  • "Add model manually" link added to the error block (focuses the input)
  • State reset on modal open and resetStep2()

web/src/components/shared/ProviderModal.test.tsx

  • New test: adds a manually-entered model to the save payload when discovery returns 404
  • New test: rejects a duplicate manual model id and selects the existing one
  • Fix: pre-existing test used a fragile input[type=text] selector that now matches the new input — switched to input[aria-label="Reasoning effort"]

.github/workflows/pr.yml

  • Add cd web && npm ci to typecheck and test jobs so web dependencies are installed (fixes pre-existing CI failure)

Validation

  • All precommit hooks passed (duplicate, lint, typecheck, full test suite)
  • ProviderModal.test.tsx: 12/12
  • Full web test suite: 85 files, 832 tests passed
  • Typecheck + ESLint clean

No server changes required

The POST/PUT /api/providers endpoints already accept user-supplied models via buildModelConfigs() (sets source: user), and the singular model field already creates a user model. This change simply exposes that capability in the UI.


AI-Enhanced Development

  • AI Models: GLM-5.2

Cache Impact

  • No

Some providers (e.g. Cline) do not expose a /models endpoint, leaving
the user blocked on a No models found error with only Retry/Edit URL
options.

Add a manual model entry field to the provider modal step 2, always
visible so a model name can be typed in regardless of discovery
outcome. The entered model is added with source: user (already
handled by the server buildModelConfigs) and auto-selected.

- New addManualModel() with duplicate detection (same normalization as
  server) and inline validation
- Add model manually link in the error block focuses the input
- Clears fetchError once a model is added
- Fix pre-existing test using a fragile input selector that matched the
  new input; switched to aria-label selector
@ikarys
ikarys changed the base branch from main to develop August 2, 2026 12:41
The pr.yml workflow ran npm ci at the root but never installed web
dependencies (cd web && npm ci), so all web typecheck and test jobs
failed with: Cannot find module 'overlayscrollbars-react'.

Add the missing install step to both jobs.
@ikarys

ikarys commented Aug 2, 2026

Copy link
Copy Markdown
Owner Author

Closing in favor of upstream PR co-l#201 targeting co-l/openfox:develop.

@ikarys ikarys closed this Aug 2, 2026
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