Commit d63031f
committed
fix(codex): decouple provider catalog from menu mapping
Root cause: the Codex provider form reused takeoverEnabled for both catalog/context editing and Codex /model menu projection, while backend live projection treated any modelCatalog as a model_catalog_json signal. Native Responses providers therefore could not fetch/save /models context unless the menu-mapping toggle was enabled, and saving a catalog risked unintentionally changing the Codex model menu.
Fix: add meta.codexLocalModelMapping as the independent projection flag, persist modelCatalog for non-official Codex providers regardless of that flag, and strip modelCatalog only when writing live Codex config with explicit mapping disabled. MultiRouter routes still force catalog projection, and old providers without the new flag retain legacy projection behavior.
UI: rename the ambiguous toggle to 'Show in Codex /model menu', rename local model routing to Codex multi-model routing, keep the catalog/context editor visible when menu mapping is off, and highlight fetch/protocol probe actions.
Validation: pnpm vitest run tests/components/CodexFormFields.test.tsx tests/components/ProviderForm.codexPreset.test.tsx tests/config/codexChatProviderPresets.test.ts; pnpm typecheck; cargo test --manifest-path src-tauri\\Cargo.toml codex_model_catalog_projection --lib -- --nocapture; cargo test --manifest-path src-tauri\\Cargo.toml provider_meta_roundtrips_codex_local_model_mapping --lib -- --nocapture; cargo test --manifest-path src-tauri\\Cargo.toml codex_live_projection --lib -- --nocapture; cargo fmt --manifest-path src-tauri\\Cargo.toml --check; git diff --check1 parent 8a63dd1 commit d63031f
17 files changed
Lines changed: 445 additions & 101 deletions
File tree
- src-tauri/src
- services
- provider
- src
- components
- codex
- providers/forms
- hooks
- i18n/locales
- tests
- components
- config
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
539 | 539 | | |
540 | 540 | | |
541 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
542 | 551 | | |
543 | 552 | | |
544 | 553 | | |
| |||
593 | 602 | | |
594 | 603 | | |
595 | 604 | | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
596 | 618 | | |
597 | 619 | | |
598 | 620 | | |
| |||
618 | 640 | | |
619 | 641 | | |
620 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
621 | 663 | | |
622 | 664 | | |
623 | 665 | | |
| |||
1072 | 1114 | | |
1073 | 1115 | | |
1074 | 1116 | | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
1075 | 1171 | | |
1076 | 1172 | | |
1077 | 1173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
563 | 582 | | |
564 | 583 | | |
565 | 584 | | |
| |||
572 | 591 | | |
573 | 592 | | |
574 | 593 | | |
575 | | - | |
576 | | - | |
| 594 | + | |
| 595 | + | |
577 | 596 | | |
578 | 597 | | |
579 | 598 | | |
580 | 599 | | |
581 | 600 | | |
582 | | - | |
| 601 | + | |
583 | 602 | | |
584 | 603 | | |
585 | 604 | | |
| |||
827 | 846 | | |
828 | 847 | | |
829 | 848 | | |
830 | | - | |
831 | | - | |
| 849 | + | |
| 850 | + | |
832 | 851 | | |
833 | 852 | | |
834 | 853 | | |
| |||
837 | 856 | | |
838 | 857 | | |
839 | 858 | | |
840 | | - | |
| 859 | + | |
841 | 860 | | |
842 | 861 | | |
843 | 862 | | |
| |||
1927 | 1946 | | |
1928 | 1947 | | |
1929 | 1948 | | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
| 1999 | + | |
| 2000 | + | |
| 2001 | + | |
| 2002 | + | |
| 2003 | + | |
1930 | 2004 | | |
1931 | 2005 | | |
1932 | 2006 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2751 | 2751 | | |
2752 | 2752 | | |
2753 | 2753 | | |
2754 | | - | |
| 2754 | + | |
2755 | 2755 | | |
2756 | 2756 | | |
2757 | 2757 | | |
| |||
0 commit comments