Commit 4276c7c
committed
fix: relax canonical model listing for custom providers
My company has a custom proxy that exposes an Anthropic-compatible API. When connecting Goose, it correctly calls the /v1/models endpoint to enumerate available models—but several models like glm-5 and kimi-k2 were mysteriously missing from the dropdown. The models worked fine when manually specified in config.yaml, yet the UI refused to show them.
After debugging, it turns out fetch_recommended_models was filtering out any model that couldn't be mapped to a canonical model ID in Goose's bundled registry. The code tried to look up each model name in the registry to get metadata like release dates and tool support—but if the lookup failed, the model was discarded entirely.
This is inconsistent with how the runtime actually works. When you configure glm-5 in config.yaml, the ModelConfig::with_canonical_limits function gracefully handles missing canonical metadata—it just skips filling in defaults. The model runs perfectly fine without it.
So the listing code was treating the registry as required while the execution code treated it as optional. If you think about it, why should a model be blocked from appearing in a dropdown just because Goose doesn't know its release date? The metadata is nice to have, not a prerequisite for using the model.
Fix:
- Changed fetch_recommended_models to branch on provider_type()
- Built-in OpenAI/Anthropic (with default host): strict filtering (require canonical metadata, text modality, tool support)
- Custom/declarative providers: relaxed filtering (allow unknown models, use canonical metadata when available for sorting)
- Alternate-host OpenAI/Anthropic (OPENAI_HOST/ANTHROPIC_HOST set): treated as custom
- Default provider_type is Custom, only OpenAI/Anthropic override to Builtin when using canonical names and default host
- Registry load errors are propagated instead of silently returning empty list
- Added regression tests for custom-include vs builtin-exclude behavior
Signed-off-by: Pete Gonzalez <4673363+octogonz@users.noreply.github.com>1 parent e2fc8dd commit 4276c7c
3 files changed
Lines changed: 151 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | 132 | | |
| |||
189 | 192 | | |
190 | 193 | | |
191 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
459 | 464 | | |
460 | 465 | | |
461 | 466 | | |
| |||
534 | 539 | | |
535 | 540 | | |
536 | 541 | | |
537 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
538 | 546 | | |
539 | 547 | | |
540 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
541 | 552 | | |
542 | 553 | | |
543 | 554 | | |
544 | 555 | | |
545 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
546 | 567 | | |
547 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
548 | 571 | | |
549 | 572 | | |
550 | 573 | | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
555 | 592 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
563 | 597 | | |
564 | | - | |
565 | | - | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
566 | 612 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | 613 | | |
572 | 614 | | |
573 | 615 | | |
| |||
579 | 621 | | |
580 | 622 | | |
581 | 623 | | |
582 | | - | |
| 624 | + | |
583 | 625 | | |
584 | 626 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
| 627 | + | |
592 | 628 | | |
593 | 629 | | |
594 | 630 | | |
| |||
895 | 931 | | |
896 | 932 | | |
897 | 933 | | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
898 | 973 | | |
899 | 974 | | |
900 | 975 | | |
| |||
1078 | 1153 | | |
1079 | 1154 | | |
1080 | 1155 | | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1081 | 1182 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
140 | 142 | | |
141 | 143 | | |
142 | 144 | | |
| 145 | + | |
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
| |||
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
| 214 | + | |
211 | 215 | | |
212 | 216 | | |
213 | 217 | | |
| |||
361 | 365 | | |
362 | 366 | | |
363 | 367 | | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
364 | 376 | | |
365 | 377 | | |
366 | 378 | | |
| |||
0 commit comments