Skip to content

feat(model): unify harness model compatibility and custom provider options across Core and Web UI - #230

Open
elf-mouse wants to merge 1 commit into
yc-software:mainfrom
elf-mouse:feat/unified-harness-model-options
Open

feat(model): unify harness model compatibility and custom provider options across Core and Web UI#230
elf-mouse wants to merge 1 commit into
yc-software:mainfrom
elf-mouse:feat/unified-harness-model-options

Conversation

@elf-mouse

@elf-mouse elf-mouse commented Aug 5, 2026

Copy link
Copy Markdown

This commit comprehensively unifies harness and model selection logic across Core and Web UI for both custom providers and proxy base URLs:

  1. src/model/custom-providers.ts & src/model/pi-models.ts:

    • Route custom provider models to harnesses according to their protocol (openai or anthropic).
    • Symmetrically update modelProviderAvailabilityFor() for claude and codex harnesses based on proxy base URLs and custom providers.
  2. src/api/routes/surface.ts:

    • Include active custom providers in modelProviderConfigured checks to prevent false 302 redirects to /admin/onboarding.
  3. plugins/web-ui/src/pi-models.ts & plugins/web-ui/src/model-options.ts:

    • Enable generic template cloning in getBaseModel() and dynamic label resolution in buildOption() for custom models.
    • Update runtimeModelOptions() to strictly honor Core's modelsByHarness output without forcibly inserting fallback built-in models.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@elf-mouse
elf-mouse force-pushed the feat/unified-harness-model-options branch 2 times, most recently from b929c58 to cdec772 Compare August 5, 2026 06:41
…tions across Core and Web UI

This commit comprehensively unifies harness and model selection logic across Core and Web UI for both custom providers and proxy base URLs:

1. `src/model/custom-providers.ts` & `src/model/pi-models.ts`:
   - Route custom provider models to harnesses according to their protocol (`openai` or `anthropic`).
   - Symmetrically update `modelProviderAvailabilityFor()` for `claude` and `codex` harnesses based on proxy base URLs and custom providers.

2. `src/api/routes/surface.ts`:
   - Include active custom providers in `modelProviderConfigured` checks to prevent false 302 redirects to `/admin/onboarding`.

3. `src/api/app-turn.ts` & `src/core/turn-options.ts`:
   - Restore `else if (providers?.openrouter)` in `app-turn.ts` and merge `customModelCatalog()` into `validateWebTurnModelOptions` fallback in `turn-options.ts`, seamlessly validating custom provider models without altering OpenRouter dynamic resolution.

4. `plugins/web-ui/src/pi-models.ts` & `plugins/web-ui/src/model-options.ts`:
   - Enable generic template cloning in `getBaseModel()` and dynamic label resolution in `buildOption()` for custom models.
   - Update `runtimeModelOptions()` to strictly honor Core's `modelsByHarness` output without forcibly inserting fallback built-in models.
@elf-mouse
elf-mouse force-pushed the feat/unified-harness-model-options branch from cdec772 to 3df8337 Compare August 5, 2026 06:49
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