Feature: user-config per-model overrides (apiModel + reasoning effort) for custom OpenAI-compatible --base-url endpoints
Summary
When running against a custom OpenAI-compatible gateway via --base-url / apiBaseUrl (e.g. a LiteLLM proxy or a self-hosted gateway), there is currently no supported way to override a model's apiModel (the on-wire model id) and reasoning effort from user config. The only way to make such an endpoint work correctly is to hand-edit the bundled MODEL_CONFIGS in the published package — which is wiped on every reinstall/upgrade.
This is a gap specifically for the --base-url path that the CLI already advertises ("Override the OpenAI-compatible base URL for API runs (e.g. LiteLLM proxy endpoint)").
Motivation / real-world setup
Many OpenAI-compatible gateways rename model ids in their catalog. For example, a gateway may expose gpt-5.5 as gpt-5.5-mygateway (vendor suffix), and the model may require a non-default reasoning.effort (e.g. high/xhigh) to think hard.
Two things break today:
- Passing the gateway's renamed id directly (
-m gpt-5.5-mygateway) hits the generic synthesized config inresolveModelConfig(src/oracle/modelResolver.ts), which setsreasoning: null,inputLimit: 200_000, and a GPT-5-pro tokenizer. So reasoning effort is silently dropped, the context limit is wrong, and token estimates are off. - Passing the canonical id (
-m gpt-5.5) preservesreasoning/tokenizer/inputLimitfromMODEL_CONFIGS, but then the request is sent with the bundledapiModel(model: modelConfig.apiModel ?? modelConfig.modelinsrc/oracle/request.ts), which the gateway doesn't recognize.
There is no way to get both the renamed apiModel and the correct reasoning/metadata without editing bundled code.
Why user config can't do it today
- User config (
~/.oracle/config.json,src/config.ts) acceptsengine,model,apiBaseUrl,search,maxFileSizeBytes,notify,heartbeatSeconds,filesReport,background,promptSuffix, and abrowser{}block. There is no per-model override field. - Project config is sanitized to a fixed allowlist (
sanitizeProjectConfiginsrc/config.ts) that intentionally excludes model routing — good, that should stay. resolveModelConfigalready composes config from multiple sources: knownMODEL_CONFIGS, OpenRouter catalog enrichment (isOpenRouterBaseUrlpath), and a generic fallback. A user-config override layer would be a natural additional source, mirroring how OpenRouter enrichment already augments/overrides fields likeapiModel,inputLimit, andpricing.
Proposed solution
Allow a modelOverrides map in user config only (not project config, for safety) that merges over known MODEL_CONFIGS entries inside resolveModelConfig:
{
"apiBaseUrl": "https://my-gateway.example/v1",
"model": "gpt-5.5",
"modelOverrides": {
"gpt-5.5": {
"apiModel": "gpt-5.5-mygateway",
"reasoning": { "effort": "xhigh" },
"inputLimit": 1050000,
"pricing": { "inputPerToken": 0.000005, "outputPerToken": 0.00003 }
}
}
}
Then oracle -m gpt-5.5 (or model in config) routes to the gateway's id while keeping correct reasoning/tokenizer/limits.
Suggested scope for a first PR (intentionally tight)
- User config only (skip project config — keeps the existing sanitize allowlist boundary intact).
- Override existing known model keys only (inherit tokenizer from
MODEL_CONFIGS— avoids the "JSON can't express a tokenizer function" problem). New custom aliases / tokenizer selection /extendsinheritance can be a follow-up. - Whitelist a small set of overridable fields:
apiModel,reasoning,inputLimit,pricing. - Apply the override as the last layer in
resolveModelConfig. - Support
reasoning: nullto explicitly clear a known model's effort (don't blind deep-merge in a way that prevents clearing). - No new CLI flags in the first cut (a per-model map avoids the multi-model ambiguity that
--api-modelwould have with--models a,b).
Risks / open questions
- Provider-specific reasoning shape:
reasoningis forwarded as-is to the request body (src/oracle/request.ts); a malformed override could be rejected by some providers. Could validate the minimal{ effort: low|medium|high|xhigh }shape and document arbitrary objects as advanced/OpenAI-compatible-only. - Field validation:
inputLimit/pricingshould be finite, non-negative numbers. - OpenRouter interaction: decide ordering — explicit user overrides probably apply last, after catalog enrichment.
Happy to send a PR along these lines if the design/naming (modelOverrides, user-config-only, known-key overrides) sounds right. Wanted to confirm the shape before implementing.
Environment: oracle 0.15.0 (npm @steipete/oracle), API engine, custom OpenAI-compatible --base-url.
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 30, 2026, 9:25 AM ET / 13:25 UTC.
Summary Keep open: current main and v0.15.0 still lack the requested user-config per-model override layer, and https://github.com/steipete/oracle/pull/274 is the open implementation candidate that should be reviewed before this issue closes.
Reproducibility: yes. from source inspection: current main has no modelOverrides field, no user override input in resolveModelConfig, and the custom-base-url chat/completions adapter does not forward reasoning_effort. I did not run a live gateway reproduction because this is a read-only issue review and the linked PR already provides redacted real-gateway proof for the proposed fix.
Root-cause cluster
Relationship: canonical
Canonical: https://github.com/steipete/oracle/issues/273
Summary: This issue is the canonical request for user-config per-model overrides, and the linked open PR is its implementation candidate.
Members:
fixed_by_candidate: https://github.com/steipete/oracle/pull/274 - The PR uses closing syntax for this issue and implements the requestedmodelOverridescapability for the custom gateway path.
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step Do not queue a second fix PR because https://github.com/steipete/oracle/pull/274 is already open and the remaining blocker is maintainer approval of the provider-routing config API.
Review details
Best possible solution:
Review and either land or deliberately revise https://github.com/steipete/oracle/pull/274 so user config can remap known models for custom gateways without allowing project configs to reroute traffic.
Do we have a high-confidence way to reproduce the issue?
Yes, from source inspection: current main has no modelOverrides field, no user override input in resolveModelConfig, and the custom-base-url chat/completions adapter does not forward reasoning_effort. I did not run a live gateway reproduction because this is a read-only issue review and the linked PR already provides redacted real-gateway proof for the proposed fix.
Is this the best way to solve the issue?
Unclear pending maintainer product review: the linked PR's user-config-only, known-model-only map is a narrow technical solution, but it still adds a provider-routing configuration API that maintainers need to accept.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
- The public API shape still needs maintainer approval because it adds a persistent user config field that can affect provider routing and model metadata.
- The linked implementation PR is still open, so closing this issue before merge would break the normal issue-to-PR tracking path.
Codex review notes: model internal, reasoning high; reviewed against 2fa6b5a6ed92.
Label changes
Label changes:
- remove
clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.
Label justifications:
P2: The request affects custom OpenAI-compatible provider routing but is a bounded feature/config improvement rather than an urgent regression.impact:auth-provider: The issue is about provider/model routing for custom OpenAI-compatible base URLs and on-wire model selection.
Evidence reviewed
What I checked:
- AGENTS.md read: Read the full 30-line repository AGENTS.md and applied its Oracle-specific release, proof, and live-smoke guidance to this read-only review. (
AGENTS.md:1, 2fa6b5a6ed92) - No vision or maturity files in checkout: The checkout contains AGENTS.md but no VISION.md, taxonomy.yaml, qa/maturity-scores.yaml, or docs/maturity files; the maturity helper also failed because its local yaml dependency was unavailable, so no stable maturity label was selected.
- Current user config lacks override field:
UserConfigcurrently exposesmodelandapiBaseUrlbut nomodelOverridesor equivalent per-model routing override. (src/config.ts:86, 2fa6b5a6ed92) - Project config boundary excludes provider routing:
sanitizeProjectConfigallowlists safe project defaults and still excludesapiBaseUrland any per-model model-routing override, matching the issue's user-config-only safety boundary. (src/config.ts:253, 2fa6b5a6ed92) - Resolver has no user override layer:
resolveModelConfigaccepts only base URL, OpenRouter API key, and fetcher options, then returns known, OpenRouter-enriched, or synthesized configs without user override input. (src/oracle/modelResolver.ts:153, 2fa6b5a6ed92) - Custom chat adapter drops reasoning effort today: The OpenAI-compatible chat/completions adapter builds requests with
model,messages, andmax_tokens, but noreasoning_effort, so custom-base-url runs cannot carry the known model's effort through this path. (src/oracle/client.ts:180, 2fa6b5a6ed92)
Likely related people:
- steipete: Current-main blame attributes the relevant config, resolver, and adapter lines to the v0.15.0 release commit, and GitHub path history shows repeated OpenRouter/model-routing work by steipete. (role: recent resolver/provider-routing contributor; confidence: high; commits: 14c146a453b5, 044b8437a913, 81c38b696dc9; files:
src/config.ts,src/oracle/modelResolver.ts,src/oracle/client.ts) - thesobercoder: GitHub path history shows custom base-url and OpenRouter chat/completions routing work in the adapter path affected by this issue. (role: adjacent custom-base-url contributor; confidence: medium; commits: 188ac5729710, b51a347ad264; files:
src/oracle/client.ts) - marmotize: GitHub history shows the project config layering and restriction work that is directly relevant to keeping provider/model routing overrides user-config-only. (role: config boundary contributor; confidence: medium; commits: 3ae0df0db0fa; files:
src/config.ts,docs/configuration.md,src/cli/runOptions.ts) - devYRPauli: GitHub history shows a recent
resolveModelConfigpricing and catalog-enrichment fix adjacent to the requested override ordering and model metadata behavior. (role: recent resolver contributor; confidence: medium; commits: 4367396a0d31; files:src/oracle/modelResolver.ts,tests/openrouter.test.ts) - wangwllu: The issue author also opened the linked implementation PR that threads
modelOverridesthrough the affected config, resolver, client, and run-option paths. (role: linked implementation contributor; confidence: high; commits: c8159253e8bc, c6e8d4b4730a; files:src/config.ts,src/oracle/modelResolver.ts,src/oracle/client.ts)
How this review workflow works
- ClawSweeper keeps one durable marker-backed review comment per issue or PR.
- Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
- A fresh review can be triggered by eligible
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch. - PR/issue authors and users with repository write access can comment
@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto request a fresh review only. - Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
- Maintainer-only repair and merge flows require explicit commands such as
@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review. - Maintainers can comment
@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.