{"record":{"id":"b425f41e632e6ff3","repo":"deepseek-ai/deepseek-harness","slug":"tool-name-run-code-name-is-reserved-for-the-c","errorCode":null,"errorMessage":"tool name \"${RUN_CODE_NAME}\" is reserved for the Code Mode presentation transport and cannot be registered or shadowed","messagePattern":"tool name \"(.+?)\" is reserved for the Code Mode presentation transport and cannot be registered or shadowed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/tools/src/index.ts","lineNumber":1055,"sourceCode":"  register(definition: ToolDefinition): () => void {\n    const name = definition.name\n    const output = (definition as Partial<ToolDefinition>).output\n    if (output === undefined || typeof output !== 'object'\n      || typeof output.render !== 'function'\n      || (output.presentationMeta !== undefined && typeof output.presentationMeta !== 'function')) {\n      throw new TypeError(`tool \"${name}\" must declare output { schema, render, presentationMeta? }`)\n    }\n    assertSupportedJsonSchema(output.schema)\n    const timeoutMs = definition.timeoutMs\n    if (timeoutMs !== undefined\n      && (!Number.isFinite(timeoutMs) || timeoutMs <= 0)) {\n      throw new TypeError(`tool \"${name}\" timeoutMs must be a positive finite number`)\n    }\n    // Reserved unconditionally: any agent may select a code mode for itself,\n    // so a name free to take under the deployment default would become a\n    // collision the moment a preset mounted.\n    if (name === RUN_CODE_NAME) {\n      throw new Error(`tool name \"${RUN_CODE_NAME}\" is reserved for the Code Mode presentation transport and cannot be registered or shadowed`)\n    }\n    return this.layers.effect(\n      this.ctx,\n      layer => layer.tools.insert(name, definition),\n      { label: 'tools.register()' },\n    )\n  }\n\n  /**\n   * Restrict global tools for the calling agent scope. Empty filters, unknown\n   * names, scope-local names, and reserved transport names fail. Restrictions\n   * intersect; scoped registrations remain visible.\n   * @param filter - global-tool mask: `allow` (keep only) and/or `deny` (remove).\n   * @returns the exact disposer that lifts this restriction.\n   */\n  restrict(filter: ToolRestriction): () => void {\n    const scope = scopeOf(this.ctx)\n    if (scope === undefined) {","sourceCodeStart":1037,"sourceCodeEnd":1073,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/tools/src/index.ts#L1037-L1073","documentation":"Reserved-name guard in tools.register(): the requested tool name is `run_code`, the Code Mode presentation transport. Registering or shadowing it would replace the transport that carries Code Mode program calls, so both global and scoped registration of that exact name are forbidden.","triggerScenarios":"Thrown at packages/core/tools/src/index.ts:1055 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different name for the tool","If you mean to change code execution, configure the code runtime rather than replacing the transport tool"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}