Repository navigation
Commit 57f0ec5
committed
fix(config): trust the registry adapter only when the transport still matches
Automated review on #924 found the mirror of the defect the previous commit
fixed. That one made validation too strict; this one made it too loose.
A `preserveCustomDestination` registry row reused under a different endpoint
keeps its own adapter at runtime — `routedProviderConfig()` honors
`providerMatchesRegistryTransport()`, which returns false once the endpoint
diverges. `volcengine-agent-plan` is such a row with an `openai-responses`
registry adapter, so a config naming that id while pointing elsewhere with
`adapter: "openai-chat"` passed validation on the registry's adapter while
the Responses adapter never ran. The preference was accepted and then
silently ignored.
Validation now starts from `provider.adapter` unless the configured
transport still matches the registry's documented one.
Driven red first: the volcengine-agent-plan config loaded with source
"file" before the fix and now returns "requires the openai-responses wire".
279 tests pass across the five affected files, typecheck clean.1 parent bc628a9 commit 57f0ec5
1 file changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
769 | 773 | | |
770 | 774 | | |
771 | 775 | | |
772 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
773 | 790 | | |
774 | 791 | | |
775 | 792 | | |
| |||
0 commit comments