Skip to content

Commit 709e7de

Browse files
committed
feat(desktop): plumb ProviderEntry.reasoningLevel into generate calls
Closes the backend half of the per-provider reasoning-depth control. The Settings UI dropdown ships as a follow-up. - ActiveModelResolution gains reasoningLevel (undefined | 1 of 5 levels) - resolveActiveModel() reads it from the ProviderEntry on disk - All four generate call sites in main/index.ts forward active.reasoningLevel into core's GenerateInput / ApplyCommentInput - Claude Code import seeds 'medium' on the imported ProviderEntry so consumer-tier proxies stop 400ing on higher levels
1 parent fb9c892 commit 709e7de

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

apps/desktop/src/main/imports/claude-code-config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export function parseClaudeCodeSettings(json: string): ClaudeCodeImport {
5656
wire: 'anthropic',
5757
baseUrl,
5858
defaultModel: model,
59+
// Claude Code proxies commonly gate reasoning effort by plan — the
60+
// consumer-tier endpoint accepts only 'medium'. Seed this default so
61+
// imports just work; higher-tier users can raise it in Settings →
62+
// Providers → Reasoning depth.
63+
reasoningLevel: 'medium',
5964
};
6065

6166
if (apiKey === null) {

apps/desktop/src/main/provider-settings.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type ModelRef,
66
PROVIDER_SHORTLIST,
77
type ProviderEntry,
8+
type ReasoningLevel,
89
type WireApi,
910
isSupportedOnboardingProvider,
1011
} from '@open-codesign/shared';
@@ -182,6 +183,7 @@ export interface ActiveModelResolution {
182183
wire: WireApi;
183184
httpHeaders: Record<string, string> | undefined;
184185
queryParams: Record<string, string> | undefined;
186+
reasoningLevel: ReasoningLevel | undefined;
185187
/** True when the renderer-supplied hint provider didn't match the canonical active. */
186188
overridden: boolean;
187189
}
@@ -212,6 +214,7 @@ export function resolveActiveModel(
212214
wire: entry.wire,
213215
httpHeaders: entry.httpHeaders,
214216
queryParams: entry.queryParams,
217+
reasoningLevel: entry.reasoningLevel,
215218
overridden,
216219
};
217220
}

0 commit comments

Comments
 (0)