janhq/jan · error

No supported context increase is available. Check the model…

Error message

No supported context increase is available. Check the model context limit in provider settings.

What it means

Thrown by increaseCoworkContext when it cannot compute a `next` context size — either the current context value is unknown or getModelContextLimit returned no usable max, leaving context?.next undefined. The user is told to check the model's context limit in provider settings.

Solutions

  1. Set the model's context limit explicitly in provider settings (e.g. ctx_len for llama.cpp)
  2. Verify modelId and providerName are correct so the limit lookup resolves
  3. Restart the model session to reset the current context value, then retry the increase
  4. If the model genuinely has no larger limit, stop increasing context

Example fix

// before
await increaseCoworkContext(modelId, providerName)
// after
const max = await models.getModelContextLimit(modelId, providerName)
if (max === undefined || max <= 0) {
  window.toast?.warning('This model has no configured context limit; set it in provider settings first.')
  return
}
await increaseCoworkContext(modelId, providerName)
Defensive patterns

Strategy: validation

Validate before calling

const max = await models.getModelContextLimit(modelId, providerName)
if (max === undefined || !Number.isInteger(max) || max <= 0) {
  showToast('No context limit configured for this model. Set it in provider settings.')
  return
}

Type guard

const hasUsableContextLimit = (max: number | undefined): max is number =>
  typeof max === 'number' && Number.isInteger(max) && max > 0

Try / catch

try {
  await increaseCoworkContext(modelId, providerName)
} catch (e) {
  if (e.message.includes('No supported context increase')) {
    openModelContextSettings(modelId)
  }
}

Prevention

When it happens

Trigger: Clicking the context-increase control when the current context value is unavailable, or getModelContextLimit(modelId, providerName) returns undefined / non-positive / non-integer, so nextCoworkContextSize cannot produce a next value.

Common situations: Model settings lack a context limit (ctx_len not configured for llamacpp); a remote provider reports no context window; modelId/providerName mismatch causing the limit lookup to miss.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of janhq/jan@7205d770c1 (2026-09-17). Data as JSON: /api/errors/f4aa721f90875aae. Report an issue: GitHub.

Appendix: source

Thrown at web-app/src/lib/coworkModelControls.ts:71

export async function increaseCoworkContext(
  models: ModelsService,
  providerName: string,
  modelId: string
): Promise<void> {
  const provider = useModelProvider.getState().getProviderByName(providerName)
  let context = coworkModelContext(provider, modelId)
  if (!context) {
    const setting = coworkLocalModel(provider, modelId)?.settings?.ctx_len
    const value = Number(setting?.controller_props?.value)
    if (setting && Number.isInteger(value) && value > 0) {
      const max = await models.getModelContextLimit(modelId, providerName)
      if (max !== undefined && Number.isInteger(max) && max > 0)
        context = { value, max, next: nextCoworkContextSize(value, max) }
    }
  }
  if (context?.next === undefined)
    throw new Error(
      'No supported context increase is available. Check the model context limit in provider settings.'
    )

  if (providerName === 'llamacpp') {
    await models.updateModelSettings(modelId, { ctx_len: context.next })
  } else if ((await models.getActiveModels(providerName)).includes(modelId)) {
    const result = await models.stopModel(modelId, providerName)
    if (!result?.success)
      throw new Error(
        result?.error ??
          'Could not unload the model. Stop its active requests and try again.'
      )
  }

  // Publish only after application succeeds. Merge into live state without
  // restoring an old provider snapshot or changing the user's selection.
  const state = useModelProvider.getState()
  const latest = state.getProviderByName(providerName)

View on GitHub (pinned to 7205d770c1)