mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 12:15:57 +00:00
fix(proxy): avoid settings override and nested reasoning for openai-compat
This commit is contained in:
+1
-5
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user