{"record":{"id":"bbe0162c92e97dd9","repo":"deepseek-ai/deepseek-harness","slug":"tools-post-execute-cannot-replace-the-value-of-a-f","errorCode":null,"errorMessage":"tools/post-execute cannot replace the value of a failed result","messagePattern":"tools/post-execute cannot replace the value of a failed result","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/tools/src/index.ts","lineNumber":1766,"sourceCode":"    if (decision.kind === 'block') {\n      const message = failureMessageFromContent(decision.feedback)\n      return this.markCanonical(exec, {\n        content: decision.feedback,\n        isError: true,\n        error: { message },\n        ...decisionContexts.length > 0 ? { additionalContexts: decisionContexts } : {},\n      })\n    }\n    if (Object.hasOwn(decision, 'content') && Object.hasOwn(decision, 'value')) {\n      throw new TypeError('tools/post-execute accept decision cannot replace both value and content')\n    }\n    const additionalContexts = [\n      ...result.additionalContexts ?? [],\n      ...decisionContexts,\n    ]\n    if (Object.hasOwn(decision, 'value')) {\n      if (result.isError) {\n        throw new TypeError('tools/post-execute cannot replace the value of a failed result')\n      }\n      const tool = this.resolveExecution(exec.name, exec.agent, exec.parent !== undefined)\n      if (tool === undefined) throw new ToolNotFoundError(exec.name)\n      const replaced = this.createSuccessResult(exec, tool, decision.value)\n      return this.markCanonical(exec, {\n        ...replaced,\n        ...additionalContexts.length > 0 ? { additionalContexts } : {},\n      })\n    }\n    return this.markCanonical(exec, {\n      ...result,\n      ...decision.content !== undefined ? { content: decision.content } : {},\n      ...additionalContexts.length > 0 ? { additionalContexts } : {},\n    })\n  }\n\n  /** Registry-normalized results and the exact dispatch that validated each value. */\n  private readonly canonicalResults = new WeakMap<object, ToolExecutionToken>()","sourceCodeStart":1748,"sourceCodeEnd":1784,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/tools/src/index.ts#L1748-L1784","documentation":"Error \"tools/post-execute cannot replace the value of a failed result\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/tools/src/index.ts:1766 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"}