{"record":{"id":"72f7d960095368e8","repo":"deepseek-ai/deepseek-harness","slug":"command-command-returned-unknown-result-kind","errorCode":null,"errorMessage":"command \"${command}\" returned unknown result kind \"${String(result.kind)}\"","messagePattern":"command \"(.+?)\" returned unknown result kind \"(.+?)\"","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/interaction/commands/src/index.ts","lineNumber":242,"sourceCode":"      throw new TypeError(`command \"${command}\" success text must be a string when supplied`)\n    }\n    if (result.sourceEventSeq !== undefined\n      && (!Number.isSafeInteger(result.sourceEventSeq) || (result.sourceEventSeq as number) < 0)) {\n      throw new TypeError(`command \"${command}\" success sourceEventSeq must be a non-negative safe integer when supplied`)\n    }\n    return Object.freeze({\n      kind: 'success',\n      ...result.text === undefined ? {} : { text: result.text },\n      ...result.sourceEventSeq === undefined ? {} : { sourceEventSeq: result.sourceEventSeq as number },\n    })\n  }\n  if (result.kind === 'error') {\n    if (typeof result.text !== 'string' || result.text.trim().length === 0) {\n      throw new TypeError(`command \"${command}\" error text must be a non-empty string`)\n    }\n    return Object.freeze({ kind: 'error', text: result.text })\n  }\n  throw new TypeError(`command \"${command}\" returned unknown result kind \"${String(result.kind)}\"`)\n}\n\n/**\n * Human-command registry. Plain-context definitions are global; definitions\n * registered through a command-injected child of an agent context shadow\n * globals for that agent.\n */\nexport class CommandRuntime extends TypertRemoteService {\n  private readonly layers = new ScopedLayers(\n    scope => new CommandLayer(scope),\n    () => { this.notifyChange() },\n  )\n\n  /** Monotonic per-instance counter behind {@link mintCommandId}. */\n  private commandSeq = 0\n  /** Instance token keeping minted ids unique across process restarts over one resumed log. */\n  private readonly instanceToken = crypto.randomUUID().slice(0, 8)\n","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/interaction/commands/src/index.ts#L224-L260","documentation":"Error \"command \"${command}\" returned unknown result kind \"${String(result.kind)}\"\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/interaction/commands/src/index.ts:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}