{"record":{"id":"082a56e38c3fec5b","repo":"deepseek-ai/deepseek-harness","slug":"tools-post-execute-accept-decision-cannot-replace","errorCode":null,"errorMessage":"tools/post-execute accept decision cannot replace both value and content","messagePattern":"tools/post-execute accept decision cannot replace both value and content","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/tools/src/index.ts","lineNumber":1758,"sourceCode":"   * Runs inside `execute`'s outer try/catch (a throwing listener → isError).\n   */\n  private async postExecute(exec: ToolExecution, result: ToolExecutionResult): Promise<ToolExecutionResult> {\n    const decision = await this.ctx.waterfall(\n      scopeTarget(this, exec.agent), 'tools/post-execute', exec, result,\n      () => Promise.resolve<PostToolDecision>({ kind: 'accept' }),\n    )\n    const decisionContexts = decision.additionalContexts ?? []\n    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, {","sourceCodeStart":1740,"sourceCodeEnd":1776,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/tools/src/index.ts#L1740-L1776","documentation":"Error \"tools/post-execute accept decision cannot replace both value and content\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/tools/src/index.ts:1758 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"}