deepseek-ai/deepseek-harness · error · Error
permission settings schema has no defaultPreset field
Error message
permission settings schema has no defaultPreset field
What it means
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.
Source
Thrown at packages/client/ui-permission-presets/src/client/settings-store.ts:60
type: string
value?: unknown
meta?: { description?: unknown }
}
/**
* Read the dynamic preset enum encoded by the host's `defaultPreset` schema.
* @param view - permission namespace descriptor.
* @param schema - settings schema operations.
* @returns current value and selectable options.
*/
export function permissionDefaultOf(view: SettingsNamespaceView, schema: SettingsSchemaService): {
currentValue: string
options: PermissionDefaultOption[]
} {
const value = (view.value as { defaultPreset?: unknown } | null)?.defaultPreset
if (typeof value !== 'string') throw new Error('permission settings has no defaultPreset value')
const node = schema.nodeAtPath(schema.rehydrate(view.schema), ['defaultPreset'])
if (node === undefined) throw new Error('permission settings schema has no defaultPreset field')
const rawChoices = node.type === 'union'
? (node.list as SchemaNode[] | undefined) ?? []
: [node]
const options = rawChoices.flatMap((candidate) => {
const choice = candidate as unknown as ConstChoice
if (choice.type !== 'const' || typeof choice.value !== 'string') return []
const described = choice.meta?.description
return [{
id: choice.value,
label: typeof described === 'string' && described.length > 0
? displayPermissionPreset(choice.value, described)
: displayPermissionPreset(choice.value, choice.value),
}]
})
if (options.length === 0 || !options.some(option => option.id === value)) {
throw new Error('permission settings schema does not advertise its current preset')
}
return { currentValue: value, options }View on GitHub (pinned to b150a551b8)
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
Example fix
// before
const { currentValue, options } = permissionDefaultOf(view, schema)
// after
const node = schema.nodeAtPath(schema.rehydrate(view.schema), ['defaultPreset'])
if (node === undefined) {
renderDegradedPicker() // plain input, no enumerated choices
return
}
const { currentValue, options } = permissionDefaultOf(view, schema) Defensive patterns
Strategy: validation
Validate before calling
const node = schema.nodeAtPath(schema.rehydrate(view.schema), ['defaultPreset']) if (node === undefined) return degradedPicker(currentValueOnly) return permissionDefaultOf(view, schema)
Prevention
- 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
When it happens
Trigger: 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.
Common situations: Upgrading the client ahead of the host; custom host profiles dropping the schema field; settings schema format changes across versions.
Related errors
- the host offers no /permission command
- provider-mismatch
- command.list failed: ${result.error.code}: ${result.error.me
- permission switch failed: ${result.error.code}: ${result.err
- permission settings has no defaultPreset value
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/45385b44619293af.
Report an issue: GitHub.