deepseek-ai/deepseek-harness · error · Error

expected a JSON object

Error message

expected a JSON object

What it means

Error "expected a JSON object" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/extensions/tool-cordis/src/index.ts:403

    if (ids.length === 0) return decision
    signal.throwIfAborted()
    const contexts = ids.map((id) => {
      const reference = ctx.dynamicCordisRunner.reference(agent, CordisDynamicPluginId(id))
      return createUserMessage({
        content: [{
          type: 'text',
          text: reference === undefined ? renderUnavailableReference(id) : renderReference(reference),
        }],
        source: { kind: 'plugin', plugin: name, form: 'instructions' },
      })
    })
    return { kind: 'enter', messages: [...decision.messages, ...contexts] }
  })
}

function requireJsonObject(value: JsonValue): Record<string, JsonValue> {
  if (typeof value !== 'object' || value === null || Array.isArray(value)) {
    throw new Error('expected a JSON object')
  }
  return value
}

function requireJsonString(value: Record<string, JsonValue>, key: string): string {
  const field = value[key]
  if (typeof field !== 'string') throw new Error(`expected JSON string field "${key}"`)
  return field
}

type SelfState = 'defined' | 'awaiting-approval' | 'client-pending' | 'stopped' | 'running' | 'waiting' | 'failed'

function selfSummary(reference: DynamicCordisReference & { packages?: readonly unknown[] }): Record<string, JsonValue> {
  const latest = reference.latestRun
  const state = selfState(reference)
  return {
    pluginId: String(reference.pluginId),
    name: reference.name,

View on GitHub (pinned to b150a551b8)

When it happens

Trigger: Thrown at packages/extensions/tool-cordis/src/index.ts:403 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/074a66d2349303d7. Report an issue: GitHub.