| ... | @@ -276,18 +276,6 @@ function extractClaudeAuthMethodFromOutput(result: CommandResult): string | unde | ... | @@ -276,18 +276,6 @@ function extractClaudeAuthMethodFromOutput(result: CommandResult): string | unde |
| 276 | return Option.getOrUndefined(findAuthMethod(parsed.success)); | 276 | return Option.getOrUndefined(findAuthMethod(parsed.success)); |
| 277 | } | 277 | } |
| 278 | | 278 | |
| 279 | // ── Dynamic model capability adjustment ───────────────────────────── | | |
| 280 | | | |
| 281 | /** Subscription types where the 1M context window is included in the plan. */ | | |
| 282 | const PREMIUM_SUBSCRIPTION_TYPES = new Set([ | | |
| 283 | "max", | | |
| 284 | "maxplan", | | |
| 285 | "max5", | | |
| 286 | "max20", | | |
| 287 | "enterprise", | | |
| 288 | "team", | | |
| 289 | ]); | | |
| 290 | | | |
| 291 | function toTitleCaseWords(value: string): string { | 279 | function toTitleCaseWords(value: string): string { |
| 292 | return value | 280 | return value |
| 293 | .split(/[\s_-]+/g) | 281 | .split(/[\s_-]+/g) |
| ... | @@ -348,41 +336,6 @@ function claudeAuthMetadata(input: { | ... | @@ -348,41 +336,6 @@ function claudeAuthMetadata(input: { |
| 348 | return undefined; | 336 | return undefined; |
| 349 | } | 337 | } |
| 350 | | 338 | |
| 351 | /** | | |
| 352 | * Adjust the built-in model list based on the user's detected subscription. | | |
| 353 | * | | |
| 354 | * - Premium tiers (Max, Enterprise, Team): 1M context becomes the default. | | |
| 355 | * - Other tiers (Pro, free, unknown): 200k context stays the default; | | |
| 356 | * 1M remains available as a manual option so users can still enable it. | | |
| 357 | */ | | |
| 358 | export function adjustModelsForSubscription( | | |
| 359 | baseModels: ReadonlyArray<ServerProviderModel>, | | |
| 360 | subscriptionType: string | undefined, | | |
| 361 | ): ReadonlyArray<ServerProviderModel> { | | |
| 362 | const normalized = subscriptionType?.toLowerCase().replace(/[\s_-]+/g, ""); | | |
| 363 | if (!normalized || !PREMIUM_SUBSCRIPTION_TYPES.has(normalized)) { | | |
| 364 | return baseModels; | | |
| 365 | } | | |
| 366 | | | |
| 367 | // Flip 1M to be the default for premium users | | |
| 368 | return baseModels.map((model) => { | | |
| 369 | const caps = model.capabilities; | | |
| 370 | if (!caps || caps.contextWindowOptions.length === 0) return model; | | |
| 371 | | | |
| 372 | return { | | |
| 373 | ...model, | | |
| 374 | capabilities: { | | |
| 375 | ...caps, | | |
| 376 | contextWindowOptions: caps.contextWindowOptions.map((opt) => | | |
| 377 | opt.value === "1m" | | |
| 378 | ? { value: opt.value, label: opt.label, isDefault: true as const } | | |
| 379 | : { value: opt.value, label: opt.label }, | | |
| 380 | ), | | |
| 381 | }, | | |
| 382 | }; | | |
| 383 | }); | | |
| 384 | } | | |
| 385 | | | |
| 386 | // ── SDK capability probe ──────────────────────────────────────────── | 339 | // ── SDK capability probe ──────────────────────────────────────────── |
| 387 | | 340 | |
| 388 | const CAPABILITIES_PROBE_TIMEOUT_MS = 8_000; | 341 | const CAPABILITIES_PROBE_TIMEOUT_MS = 8_000; |
| ... | @@ -563,8 +516,6 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( | ... | @@ -563,8 +516,6 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( |
| 563 | subscriptionType = yield* resolveSubscriptionType(claudeSettings.binaryPath); | 516 | subscriptionType = yield* resolveSubscriptionType(claudeSettings.binaryPath); |
| 564 | } | 517 | } |
| 565 | | 518 | |
| 566 | const resolvedModels = adjustModelsForSubscription(models, subscriptionType); | | |
| 567 | | | |
| 568 | // ── Handle auth results (same logic as before, adjusted models) ── | 519 | // ── Handle auth results (same logic as before, adjusted models) ── |
| 569 | | 520 | |
| 570 | if (Result.isFailure(authProbe)) { | 521 | if (Result.isFailure(authProbe)) { |
| ... | @@ -573,7 +524,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( | ... | @@ -573,7 +524,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( |
| 573 | provider: PROVIDER, | 524 | provider: PROVIDER, |
| 574 | enabled: claudeSettings.enabled, | 525 | enabled: claudeSettings.enabled, |
| 575 | checkedAt, | 526 | checkedAt, |
| 576 | models: resolvedModels, | 527 | models, |
| 577 | probe: { | 528 | probe: { |
| 578 | installed: true, | 529 | installed: true, |
| 579 | version: parsedVersion, | 530 | version: parsedVersion, |
| ... | @@ -592,7 +543,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( | ... | @@ -592,7 +543,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( |
| 592 | provider: PROVIDER, | 543 | provider: PROVIDER, |
| 593 | enabled: claudeSettings.enabled, | 544 | enabled: claudeSettings.enabled, |
| 594 | checkedAt, | 545 | checkedAt, |
| 595 | models: resolvedModels, | 546 | models, |
| 596 | probe: { | 547 | probe: { |
| 597 | installed: true, | 548 | installed: true, |
| 598 | version: parsedVersion, | 549 | version: parsedVersion, |
| ... | @@ -609,7 +560,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( | ... | @@ -609,7 +560,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")( |
| 609 | provider: PROVIDER, | 560 | provider: PROVIDER, |
| 610 | enabled: claudeSettings.enabled, | 561 | enabled: claudeSettings.enabled, |
| 611 | checkedAt, | 562 | checkedAt, |
| 612 | models: resolvedModels, | 563 | models, |
| 613 | probe: { | 564 | probe: { |
| 614 | installed: true, | 565 | installed: true, |
| 615 | version: parsedVersion, | 566 | version: parsedVersion, |