Skip to content

Commit 1309d5e

Browse files
committed
fix(executor): propagate requestPath to ApplyPayloadConfigWithRoot
Upstream merge added a requestPath parameter to helps.ApplyPayloadConfigWithRoot, but the Plus-fork third-party executors and the local applyPayloadConfigWithRoot wrapper were not updated, breaking the Docker build. Extend the wrapper signature, add a payloadRequestPath helper, and forward helps.PayloadRequestPath(opts) at all 8 missed call sites in iflow / codebuddy / github_copilot / kilo executors.
1 parent 87b374c commit 1309d5e

5 files changed

Lines changed: 22 additions & 10 deletions

File tree

internal/runtime/executor/codebuddy_executor.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ func (e *CodeBuddyExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth
106106
originalTranslated := sdktranslator.TranslateRequest(from, to, baseModel, originalPayloadSource, true)
107107
translated := sdktranslator.TranslateRequest(from, to, baseModel, req.Payload, true)
108108
requestedModel := payloadRequestedModel(opts, req.Model)
109-
translated = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", translated, originalTranslated, requestedModel)
109+
requestPath := payloadRequestPath(opts)
110+
translated = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", translated, originalTranslated, requestedModel, requestPath)
110111
translated, _ = sjson.SetBytes(translated, "stream", true)
111112
translated, _ = sjson.SetBytes(translated, "stream_options.include_usage", true)
112113

@@ -205,7 +206,8 @@ func (e *CodeBuddyExecutor) ExecuteStream(ctx context.Context, auth *cliproxyaut
205206
originalTranslated := sdktranslator.TranslateRequest(from, to, baseModel, originalPayloadSource, true)
206207
translated := sdktranslator.TranslateRequest(from, to, baseModel, req.Payload, true)
207208
requestedModel := payloadRequestedModel(opts, req.Model)
208-
translated = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", translated, originalTranslated, requestedModel)
209+
requestPath := payloadRequestPath(opts)
210+
translated = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", translated, originalTranslated, requestedModel, requestPath)
209211

210212
translated, err = thinking.ApplyThinking(translated, req.Model, from.String(), to.String(), e.Identifier())
211213
if err != nil {

internal/runtime/executor/compat_helpers.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,12 @@ func payloadRequestedModel(opts cliproxyexecutor.Options, fallback string) strin
7272
return helps.PayloadRequestedModel(opts, fallback)
7373
}
7474

75-
func applyPayloadConfigWithRoot(cfg *config.Config, model, protocol, root string, payload, original []byte, requestedModel string) []byte {
76-
return helps.ApplyPayloadConfigWithRoot(cfg, model, protocol, root, payload, original, requestedModel)
75+
func applyPayloadConfigWithRoot(cfg *config.Config, model, protocol, root string, payload, original []byte, requestedModel string, requestPath string) []byte {
76+
return helps.ApplyPayloadConfigWithRoot(cfg, model, protocol, root, payload, original, requestedModel, requestPath)
77+
}
78+
79+
func payloadRequestPath(opts cliproxyexecutor.Options) string {
80+
return helps.PayloadRequestPath(opts)
7781
}
7882

7983
func summarizeErrorBody(contentType string, body []byte) string {

internal/runtime/executor/github_copilot_executor.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ func (e *GitHubCopilotExecutor) Execute(ctx context.Context, auth *cliproxyauth.
156156
body = normalizeGitHubCopilotChatTools(body)
157157
}
158158
requestedModel := payloadRequestedModel(opts, req.Model)
159-
body = applyPayloadConfigWithRoot(e.cfg, req.Model, to.String(), "", body, originalTranslated, requestedModel)
159+
requestPath := payloadRequestPath(opts)
160+
body = applyPayloadConfigWithRoot(e.cfg, req.Model, to.String(), "", body, originalTranslated, requestedModel, requestPath)
160161
body, _ = sjson.SetBytes(body, "stream", false)
161162

162163
path := githubCopilotChatPath
@@ -298,7 +299,8 @@ func (e *GitHubCopilotExecutor) ExecuteStream(ctx context.Context, auth *cliprox
298299
body = normalizeGitHubCopilotChatTools(body)
299300
}
300301
requestedModel := payloadRequestedModel(opts, req.Model)
301-
body = applyPayloadConfigWithRoot(e.cfg, req.Model, to.String(), "", body, originalTranslated, requestedModel)
302+
requestPath := payloadRequestPath(opts)
303+
body = applyPayloadConfigWithRoot(e.cfg, req.Model, to.String(), "", body, originalTranslated, requestedModel, requestPath)
302304
body, _ = sjson.SetBytes(body, "stream", true)
303305
// Enable stream options for usage stats in stream
304306
if !useResponses {

internal/runtime/executor/iflow_executor.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ func (e *IFlowExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, re
108108

109109
body = preserveReasoningContentInMessages(body)
110110
requestedModel := helps.PayloadRequestedModel(opts, req.Model)
111-
body = helps.ApplyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", body, originalTranslated, requestedModel)
111+
requestPath := helps.PayloadRequestPath(opts)
112+
body = helps.ApplyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", body, originalTranslated, requestedModel, requestPath)
112113

113114
endpoint := strings.TrimSuffix(baseURL, "/") + iflowDefaultEndpoint
114115

@@ -221,7 +222,8 @@ func (e *IFlowExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.Au
221222
body = ensureToolsArray(body)
222223
}
223224
requestedModel := helps.PayloadRequestedModel(opts, req.Model)
224-
body = helps.ApplyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", body, originalTranslated, requestedModel)
225+
requestPath := helps.PayloadRequestPath(opts)
226+
body = helps.ApplyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", body, originalTranslated, requestedModel, requestPath)
225227

226228
endpoint := strings.TrimSuffix(baseURL, "/") + iflowDefaultEndpoint
227229

internal/runtime/executor/kilo_executor.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ func (e *KiloExecutor) Execute(ctx context.Context, auth *cliproxyauth.Auth, req
9494
originalTranslated := sdktranslator.TranslateRequest(from, to, baseModel, originalPayload, opts.Stream)
9595
translated := sdktranslator.TranslateRequest(from, to, baseModel, req.Payload, opts.Stream)
9696
requestedModel := payloadRequestedModel(opts, req.Model)
97-
translated = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", translated, originalTranslated, requestedModel)
97+
requestPath := payloadRequestPath(opts)
98+
translated = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", translated, originalTranslated, requestedModel, requestPath)
9899

99100
translated, err = thinking.ApplyThinking(translated, req.Model, from.String(), to.String(), e.Identifier())
100101
if err != nil {
@@ -191,7 +192,8 @@ func (e *KiloExecutor) ExecuteStream(ctx context.Context, auth *cliproxyauth.Aut
191192
originalTranslated := sdktranslator.TranslateRequest(from, to, baseModel, originalPayload, true)
192193
translated := sdktranslator.TranslateRequest(from, to, baseModel, req.Payload, true)
193194
requestedModel := payloadRequestedModel(opts, req.Model)
194-
translated = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", translated, originalTranslated, requestedModel)
195+
requestPath := payloadRequestPath(opts)
196+
translated = applyPayloadConfigWithRoot(e.cfg, baseModel, to.String(), "", translated, originalTranslated, requestedModel, requestPath)
195197

196198
translated, err = thinking.ApplyThinking(translated, req.Model, from.String(), to.String(), e.Identifier())
197199
if err != nil {

0 commit comments

Comments
 (0)