mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
This commit is contained in:
@@ -42,6 +42,8 @@ export const updateSettingsSchema = z.object({
|
||||
a2aEnabled: z.boolean().optional(),
|
||||
// CLI Fingerprint compatibility (per-provider)
|
||||
cliCompatProviders: z.array(z.string().max(100)).optional(),
|
||||
// Strip provider/model prefix at proxy layer (e.g. "openai/gpt-4" → "gpt-4")
|
||||
stripModelPrefix: z.boolean().optional(),
|
||||
// Custom CLI agent definitions for ACP
|
||||
customAgents: z
|
||||
.array(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Re-export from open-sse with localDb integration
|
||||
import { getModelAliases, getComboByName, getProviderNodes, getCustomModels } from "@/lib/localDb";
|
||||
import { getSettings } from "@/lib/localDb";
|
||||
import {
|
||||
parseModel,
|
||||
resolveModelAliasFromMap,
|
||||
@@ -77,6 +78,18 @@ export async function getModelInfo(modelStr) {
|
||||
...(apiFormat && { apiFormat }),
|
||||
};
|
||||
}
|
||||
|
||||
// stripModelPrefix: if enabled, strip provider prefix and re-resolve
|
||||
// the bare model name using existing heuristics (claude-* → anthropic, etc.)
|
||||
try {
|
||||
const settings = await getSettings();
|
||||
if (settings.stripModelPrefix === true) {
|
||||
const strippedResult = await getModelInfoCore(parsed.model, getModelAliases);
|
||||
return { ...strippedResult, extendedContext };
|
||||
}
|
||||
} catch {
|
||||
// If settings read fails, fall through to normal resolution
|
||||
}
|
||||
}
|
||||
|
||||
if (!parsed.isAlias) {
|
||||
|
||||
Reference in New Issue
Block a user