{"record":{"id":"4a30b1302e061207","repo":"deepseek-ai/deepseek-harness","slug":"output-render-returned-describereturn-value","errorCode":null,"errorMessage":"output.render returned ${describeReturn(value)} — it must return an ARRAY of content blocks:\n  ✓ return [{ type: 'text', text: String(value) }]","messagePattern":"output\\.render returned (.+?) — it must return an ARRAY of content blocks:\n  ✓ return \\[(.+?)\\]","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/extensions/cordis-host-runner/src/guard.ts","lineNumber":536,"sourceCode":" * Compact JSON preview of an invalid execute return for the teaching error\n * (`String(…)` for the un-stringifiable undefined case), truncated to\n * {@link RETURN_PREVIEW_LIMIT}.\n */\nfunction describeReturn(value: JsonValue): string {\n  // The caller has already crossed cloneJson, so this value is lossless JSON\n  // and serialization cannot produce undefined.\n  const json = JSON.stringify(value)\n  return json.length > RETURN_PREVIEW_LIMIT ? `${json.slice(0, RETURN_PREVIEW_LIMIT)}…` : json\n}\n\n/**\n * Validate and host-materialize a sandbox renderer's content blocks.\n */\nfunction assertRenderedContent(value: JsonValue): ContentBlock[] {\n  if (Array.isArray(value) && value.every(isContentBlockShape)) {\n    return value as unknown as ContentBlock[]\n  }\n  throw new Error(\n    `output.render returned ${describeReturn(value)} — it must return an ARRAY of content blocks:\\n`\n    + '  ✓ return [{ type: \\'text\\', text: String(value) }]',\n  )\n}\n\n/**\n * The `harness.defineTool` handed into the sandbox: the real DSL, with `parameters` normalized\n * into a fresh host-realm ParameterSchemaSpec (raw object wrappers unwrapped,\n * required arrays mapped, and explicit DSL object openness enforced) and the tool's `execute` return normalized into the host realm\n * via a JSON round-trip. Non-JSON or wrong-shape output fails that call instead of poisoning\n * the session log.\n * @param options - the standard `defineTool` options; `parameters` may be the ParameterSchemaSpec DSL or a JSON-Schema-style wrapper.\n * @returns the marker-tagged definition `harness.registerTool` (and the guarded `ctx.tools.register`) accepts.\n */\nexport function sandboxDefineTool(options: unknown): ToolDefinition {\n  if (!isPlainRecord(options)) throw new Error('harness.defineTool options must be an object')\n  const normalized = normalizeParameterSchemaSpec(options.parameters)\n  if (!isPlainRecord(options.output)) {","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/extensions/cordis-host-runner/src/guard.ts#L518-L554","documentation":"Error \"output.render returned ${describeReturn(value)} — it must return an ARRAY of content blocks:\n  ✓ return [{ type: 'text', text: String(value) }]\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/extensions/cordis-host-runner/src/guard.ts:536 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"}