mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 04:47:03 -06:00
fix: classify effective provider parameters
This commit is contained in:
@@ -101,7 +101,7 @@ export function hasAuthoredProviderRequestParams(
|
||||
params: Parameters<typeof resolveModelExtraParamSources>[0],
|
||||
): boolean {
|
||||
const sources = resolveModelExtraParamSources(params);
|
||||
return [sources.defaultParams, sources.modelParams, sources.agentParams].some((source) =>
|
||||
Object.entries(source ?? {}).some(([key, value]) => !isAgentRuntimeModelParam(key, value)),
|
||||
);
|
||||
return Object.entries(
|
||||
Object.assign({}, sources.defaultParams, sources.modelParams, sources.agentParams),
|
||||
).some(([key, value]) => !isAgentRuntimeModelParam(key, value));
|
||||
}
|
||||
|
||||
@@ -148,6 +148,37 @@ describe("OpenAI runtime routing policy", () => {
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("classifies only the effective value after agent-model parameter precedence", () => {
|
||||
const modelKey = "openai/gpt-5.6-sol";
|
||||
const config = {
|
||||
agents: {
|
||||
defaults: {
|
||||
params: { thinking: { type: "enabled", budget_tokens: 2_048 } },
|
||||
},
|
||||
entries: {
|
||||
audit: {
|
||||
models: {
|
||||
[modelKey]: { params: { thinking: "high" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} satisfies OpenClawConfig;
|
||||
|
||||
expect(
|
||||
resolveOpenAIImplicitAgentRuntime({
|
||||
provider: "openai",
|
||||
modelId: "gpt-5.6-sol",
|
||||
config,
|
||||
agentId: "audit",
|
||||
env: {},
|
||||
}),
|
||||
).toBe("codex");
|
||||
expect(
|
||||
modelSelectionShouldEnsureCodexPlugin({ model: modelKey, config, agentId: "audit" }),
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
it("maps provider route facts onto a closed implicit runtime", () => {
|
||||
expect(
|
||||
resolveOpenAIImplicitAgentRuntime({ provider: "openai", modelId: "gpt-5.6", env: {} }),
|
||||
|
||||
Reference in New Issue
Block a user