fix(proxy): avoid settings override and nested reasoning for openai-compat

This commit is contained in:
Chris Weller
2026-04-26 14:53:25 -06:00
parent 8ccf193fd4
commit 1c91c46326
4 changed files with 5 additions and 17 deletions
+1 -5
View File
@@ -1460,11 +1460,7 @@ async function main(): Promise<void> {
};
delete proxyEnv.ANTHROPIC_API_KEY;
const launchArgs = [
'--settings',
expandedSettingsPath,
...appendThirdPartyWebSearchToolArgs(browserArgs),
];
const launchArgs = [...appendThirdPartyWebSearchToolArgs(browserArgs)];
const traceEnv = createWebSearchTraceContext({
launcher: 'ccs.settings-profile.proxy',
args: launchArgs,
@@ -362,7 +362,7 @@ function transformToolChoice(
function mapThinkingToReasoning(
thinking: AnthropicThinking | undefined,
outputConfig: AnthropicOutputConfig | undefined
): Pick<ProxyOpenAIRequest, 'reasoning' | 'reasoning_effort'> {
): Pick<ProxyOpenAIRequest, 'reasoning_effort'> {
if (!thinking || thinking.type === 'disabled') {
return {};
}
@@ -371,10 +371,6 @@ function mapThinkingToReasoning(
const effort = toOpenAIEffort(resolveOutputConfigEffort(outputConfig) ?? 'high');
return {
reasoning_effort: effort,
reasoning: {
enabled: true,
effort,
},
};
}
@@ -389,10 +385,6 @@ function mapThinkingToReasoning(
return {
reasoning_effort: effort,
reasoning: {
enabled: true,
effort,
},
};
}
@@ -27,7 +27,7 @@ describe('ProxyRequestTransformer regressions', () => {
});
expect(result.reasoning_effort).toBe('high');
expect(result.reasoning).toEqual({ enabled: true, effort: 'high' });
expect(result.reasoning).toBeUndefined();
});
it('explicitly normalizes anthropic xhigh adaptive effort for OpenAI-compatible upstreams', () => {
@@ -38,7 +38,7 @@ describe('ProxyRequestTransformer regressions', () => {
});
expect(result.reasoning_effort).toBe('high');
expect(result.reasoning).toEqual({ enabled: true, effort: 'high' });
expect(result.reasoning).toBeUndefined();
});
it('rejects unsupported thinking types instead of silently dropping them', () => {
@@ -28,7 +28,7 @@ describe('ProxyRequestTransformer', () => {
expect(result.stream).toBe(true);
expect(result.reasoning_effort).toBe('high');
expect(result.reasoning).toEqual({ enabled: true, effort: 'high' });
expect(result.reasoning).toBeUndefined();
expect(result.max_tokens).toBe(1024);
expect(result.temperature).toBe(0.2);
expect(result.top_p).toBe(0.9);