@@ -21,6 +21,7 @@ describe("Volcengine Ark providers", () => {
2121 baseUrl : "https://ark.cn-beijing.volces.com/api/v3" ,
2222 adapter : "openai-chat" ,
2323 authKind : "key" ,
24+ preserveCustomDestination : true ,
2425 defaultModel : "doubao-seed-2-1-pro-260628" ,
2526 models : [
2627 "doubao-seed-2-1-pro-260628" ,
@@ -44,6 +45,7 @@ describe("Volcengine Ark providers", () => {
4445 baseUrl : "https://ark.cn-beijing.volces.com/api/coding/v3" ,
4546 adapter : "openai-chat" ,
4647 authKind : "key" ,
48+ preserveCustomDestination : true ,
4749 defaultModel : "ark-code-latest" ,
4850 models : [
4951 "ark-code-latest" ,
@@ -75,6 +77,7 @@ describe("Volcengine Ark providers", () => {
7577 responsesPath : "/responses" ,
7678 adapter : "openai-responses" ,
7779 authKind : "key" ,
80+ preserveCustomDestination : true ,
7881 defaultModel : "deepseek-v4-pro" ,
7982 models : [
8083 "deepseek-v4-pro" ,
@@ -144,6 +147,32 @@ describe("Volcengine Ark providers", () => {
144147 expect ( request . url ) . toBe ( "https://ark.cn-beijing.volces.com/api/plan/v3/responses" ) ;
145148 } ) ;
146149
150+ test . each ( [
151+ [ "volcengine" , "openai-chat" , "https://custom.example.com/api/v3" ] ,
152+ [ "volcengine-coding-plan" , "openai-chat" , "https://custom.example.com/api/coding/v3" ] ,
153+ [ "volcengine-agent-plan" , "openai-responses" , "https://custom.example.com/api/plan/v3" ] ,
154+ ] as const ) (
155+ "preserves an existing same-name custom %s destination" ,
156+ ( providerId , adapter , baseUrl ) => {
157+ const config : OcxConfig = {
158+ port : 10100 ,
159+ defaultProvider : providerId ,
160+ providers : {
161+ [ providerId ] : {
162+ adapter,
163+ baseUrl,
164+ authMode : "key" ,
165+ apiKey : "test-key" ,
166+ } ,
167+ } ,
168+ } ;
169+
170+ const route = routeModel ( config , `${ providerId } /custom-model` ) ;
171+ expect ( route . provider . baseUrl ) . toBe ( baseUrl ) ;
172+ expect ( route . provider . adapter ) . toBe ( adapter ) ;
173+ } ,
174+ ) ;
175+
147176 test ( "maps the documented Ark thinking toggle on the pay-as-you-go Chat wire" , ( ) => {
148177 const config : OcxConfig = {
149178 port : 10100 ,
0 commit comments