Skip to content

Commit 7ff1702

Browse files
committed
feat(shared): ProviderEntry.reasoningLevel + ReasoningLevel type
Adds the schema primitive for the upcoming Settings UI dropdown ("Reasoning depth" per provider). Shape: ReasoningLevel = 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' ProviderEntry.reasoningLevel?: ReasoningLevel Backwards-compat: the field is optional, so existing configs read without migration. When absent, core's reasoningForModel() continues to compute the default from the provider id + model family. When present, core honors the explicit override. Schema version is not bumped because the field is optional and purely additive.
1 parent 4e0de27 commit 7ff1702

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

packages/shared/src/config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ export type StoredDesignSystem = z.infer<typeof StoredDesignSystem>;
6969

7070
// ── ProviderEntry (v3) ───────────────────────────────────────────────────────
7171

72+
export const ReasoningLevelSchema = z.enum(['minimal', 'low', 'medium', 'high', 'xhigh']);
73+
export type ReasoningLevel = z.infer<typeof ReasoningLevelSchema>;
74+
7275
export const ProviderEntrySchema = z.object({
7376
id: z.string().min(1),
7477
name: z.string().min(1),
@@ -80,6 +83,14 @@ export const ProviderEntrySchema = z.object({
8083
modelsHint: z.array(z.string()).optional(),
8184
httpHeaders: z.record(z.string(), z.string()).optional(),
8285
queryParams: z.record(z.string(), z.string()).optional(),
86+
/**
87+
* Per-provider reasoning effort override. When set, overrides the
88+
* model-family default from `reasoningForModel` in core. Useful for
89+
* proxies that gate reasoning tiers by plan (Claude Code consumer-tier
90+
* accepts only 'medium') or for users who want to dial depth up/down
91+
* per endpoint. The UI surfaces this as a "Reasoning depth" dropdown.
92+
*/
93+
reasoningLevel: ReasoningLevelSchema.optional(),
8394
});
8495
export type ProviderEntry = z.infer<typeof ProviderEntrySchema>;
8596

packages/shared/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ export {
225225
ConfigV3Schema,
226226
PROVIDER_SHORTLIST,
227227
ProviderEntrySchema,
228+
ReasoningLevelSchema,
228229
SUPPORTED_ONBOARDING_PROVIDERS,
229230
SecretRef,
230231
STORED_DESIGN_SYSTEM_SCHEMA_VERSION,
@@ -243,6 +244,7 @@ export type {
243244
OnboardingState,
244245
ProviderEntry,
245246
ProviderShortlist,
247+
ReasoningLevel,
246248
SupportedOnboardingProvider,
247249
WireApi,
248250
} from './config';

0 commit comments

Comments
 (0)