{"record":{"id":"36b5c9d38a57d750","repo":"deepseek-ai/deepseek-harness","slug":"run-in-background-is-disabled-for-this-tool-instan","errorCode":null,"errorMessage":"run_in_background is disabled for this tool instance (enableRunInBackground: false)","messagePattern":"run_in_background is disabled for this tool instance \\(enableRunInBackground: false\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/subagent/tool-subagent/src/index.ts","lineNumber":264,"sourceCode":"\ninterface DelegationRunRequest {\n  readonly run_in_background?: boolean\n}\n\ninterface DelegationRunSpec {\n  readonly runInBackground: boolean\n}\n\n/** Resolve the model's optional scheduling request into one execution route. */\nfunction resolveDelegationRun(\n  request: DelegationRunRequest,\n  options: { readonly backgroundEnabled: boolean; readonly continuable: boolean },\n): DelegationRunSpec {\n  if (!options.backgroundEnabled) {\n    // The validator permits undeclared keys, so schema omission also needs\n    // execution-time enforcement.\n    if (request.run_in_background === true) {\n      throw new Error('run_in_background is disabled for this tool instance (enableRunInBackground: false)')\n    }\n    return { runInBackground: false }\n  }\n  return {\n    // Continuable work is independently scheduled unless the caller explicitly\n    // needs the result before its next action. One-shot policy keeps its existing\n    // foreground default because its background result requires Task collection.\n    runInBackground: request.run_in_background ?? options.continuable,\n  }\n}\n\nexport function apply(ctx: Context, config: Config): void {\n  // Direct apply() bypasses Schemastery's numeric constraints. A direct-apply\n  // omission stays capless (the schema default only runs through the loader).\n  if (config.maxDepth !== 'provider-managed') assertSubagentMaxDepth(config.maxDepth)\n  // Reject an empty explicit filter at load instead of failing every delegation.\n  if (config.toolFilter !== undefined && config.toolFilter.allow === undefined && config.toolFilter.deny === undefined) {\n    throw new Error('tool-subagent: `toolFilter` is configured but names neither `allow` nor `deny` — remove the key or fill the filter')","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/subagent/tool-subagent/src/index.ts#L246-L282","documentation":"Error \"run_in_background is disabled for this tool instance (enableRunInBackground: false)\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/subagent/tool-subagent/src/index.ts:264 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set enableRunInBackground: true on the tool instance, or run the subagent in the foreground."],"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"}