{"record":{"id":"45385b44619293af","repo":"deepseek-ai/deepseek-harness","slug":"permission-settings-schema-has-no-defaultpreset-fi","errorCode":null,"errorMessage":"permission settings schema has no defaultPreset field","messagePattern":"permission settings schema has no defaultPreset field","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/client/ui-permission-presets/src/client/settings-store.ts","lineNumber":60,"sourceCode":"  type: string\n  value?: unknown\n  meta?: { description?: unknown }\n}\n\n/**\n * Read the dynamic preset enum encoded by the host's `defaultPreset` schema.\n * @param view - permission namespace descriptor.\n * @param schema - settings schema operations.\n * @returns current value and selectable options.\n */\nexport function permissionDefaultOf(view: SettingsNamespaceView, schema: SettingsSchemaService): {\n  currentValue: string\n  options: PermissionDefaultOption[]\n} {\n  const value = (view.value as { defaultPreset?: unknown } | null)?.defaultPreset\n  if (typeof value !== 'string') throw new Error('permission settings has no defaultPreset value')\n  const node = schema.nodeAtPath(schema.rehydrate(view.schema), ['defaultPreset'])\n  if (node === undefined) throw new Error('permission settings schema has no defaultPreset field')\n  const rawChoices = node.type === 'union'\n    ? (node.list as SchemaNode[] | undefined) ?? []\n    : [node]\n  const options = rawChoices.flatMap((candidate) => {\n    const choice = candidate as unknown as ConstChoice\n    if (choice.type !== 'const' || typeof choice.value !== 'string') return []\n    const described = choice.meta?.description\n    return [{\n      id: choice.value,\n      label: typeof described === 'string' && described.length > 0\n        ? displayPermissionPreset(choice.value, described)\n        : displayPermissionPreset(choice.value, choice.value),\n    }]\n  })\n  if (options.length === 0 || !options.some(option => option.id === value)) {\n    throw new Error('permission settings schema does not advertise its current preset')\n  }\n  return { currentValue: value, options }","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/ui-permission-presets/src/client/settings-store.ts#L42-L78","documentation":"After the value check passes, permissionDefaultOf() looks up the path ['defaultPreset'] in the rehydrated settings schema to enumerate the preset choices. schema.nodeAtPath returning undefined — the host's schema for the permission namespace has no defaultPreset field — throws 'permission settings schema has no defaultPreset field'. This is value/schema drift between what the client expects and what the host schema declares.","triggerScenarios":"A host whose permission settings schema omits defaultPreset (older host, trimmed plugin, renamed field) while the value side still carries a string defaultPreset; any client update that assumes the field without a matching host update.","commonSituations":"Upgrading the client ahead of the host; custom host profiles dropping the schema field; settings schema format changes across versions.","solutions":["Align host and client versions so the permission settings schema includes defaultPreset","Probe schema.nodeAtPath at the call site and degrade gracefully (hide the preset picker) when the field is absent","If you own the host plugin, add the defaultPreset field to the permission settings schema"],"exampleFix":"// before\nconst { currentValue, options } = permissionDefaultOf(view, schema)\n// after\nconst node = schema.nodeAtPath(schema.rehydrate(view.schema), ['defaultPreset'])\nif (node === undefined) {\n  renderDegradedPicker() // plain input, no enumerated choices\n  return\n}\nconst { currentValue, options } = permissionDefaultOf(view, schema)","handlingStrategy":"validation","validationCode":"const node = schema.nodeAtPath(schema.rehydrate(view.schema), ['defaultPreset'])\nif (node === undefined) return degradedPicker(currentValueOnly)\nreturn permissionDefaultOf(view, schema)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat schema absence as a capability gap: degrade to a plain input instead of crashing","Pin host and client versions so the settings schema keeps the field"],"tags":["settings","schema","version-skew","permissions"],"backgroundTag":"schema-field-missing","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}