mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-30 02:14:43 +08:00
fix(codex): infer image capability for generated catalogs and resync takeover live on save
Mapped GPT models were rejected by Codex clients with "model does not support image inputs". Two root causes: - Catalog entries for native-Responses/Anthropic providers cloned a template whose input_modalities defaulted to ["text"], so every mapped model was advertised text-only. model_catalog_json replaces Codex's built-in model table wholesale, and both the TUI and the IDE extension block images pre-send when the current model is found without "image". - Editing the current Codex provider during proxy takeover only refreshed the DB backup, so removing the mapping left a stale model_catalog_json pointer (and its text-only catalog file) active in live config. Changes: - New shared model_capabilities module: explicit row declaration first, then a confirmed text-only registry (exact tail match only — prefix matching removed, variants enumerated so future -vl/-vision models fail open), everything else unknown. - Catalog generation writes input_modalities from that inference for all tool profiles: unknown models fail open to ["text","image"]; only confirmed text-only models are advertised as ["text"], giving users a clear client-side prompt instead of silent image stripping. - Live catalog reverse-import collapses modalities that match current inference, so registry corrections are not frozen into hidden row overrides and the rectifier's heuristic opt-out keeps working. - Saving the current Codex provider while takeover owns live now re-projects the live config (mirrors the hot-switch path), so mapping edits and removals take effect immediately. - Media rectifier delegates to the shared module; its preflight toggle is documented (4 locales) as proxy-request-only, never affecting catalog capability declarations.
This commit is contained in:
@@ -80,8 +80,9 @@ function modelCatalog(
|
||||
displayName?: string;
|
||||
contextWindow?: number;
|
||||
// Native Responses (direct) overrides for the generated
|
||||
// model-catalogs.json; omit to inherit the native template defaults
|
||||
// (supports_parallel_tool_calls=false, input_modalities=["text"]).
|
||||
// model-catalogs.json. Omitted input modalities are inferred by the
|
||||
// backend: confirmed text-only models stay text-only; everything else
|
||||
// defaults to text+image.
|
||||
supportsParallelToolCalls?: boolean;
|
||||
inputModalities?: string[];
|
||||
// Vendor's OFFICIAL base_instructions; omit to inherit the neutral
|
||||
|
||||
Reference in New Issue
Block a user