{"record":{"id":"f3f65f5cf3602aae","repo":"deepseek-ai/deepseek-harness","slug":"terminal-tools-require-an-initiating-agent","errorCode":null,"errorMessage":"terminal tools require an initiating agent","messagePattern":"terminal tools require an initiating agent","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/terminal/tool-terminal/src/index.ts","lineNumber":118,"sourceCode":"} as const\n\nconst SESSION_SNAPSHOT_SCHEMA = {\n  type: 'object',\n  additionalProperties: false,\n  properties: SESSION_SNAPSHOT_PROPERTIES,\n} as const\n\nconst BACKGROUND_TASK_OUTPUT_SCHEMA = {\n  type: 'object',\n  additionalProperties: false,\n  properties: {\n    kind: { type: 'string', required: true, const: 'background' },\n    jobId: { type: 'string', required: true },\n  },\n} as const\n\nfunction requireAgent(agent: Agent | undefined): Agent {\n  if (agent === undefined) throw new Error('terminal tools require an initiating agent')\n  return agent\n}\n\nfunction sessionId(args: SessionArgs): TerminalSessionIdType {\n  if (args.sessionId.length === 0) {\n    throw new Error('sessionId must be a non-empty string')\n  }\n  return TerminalSessionId(args.sessionId)\n}\n\nfunction textResult(text: string, maxBytes: number): ContentBlock[] {\n  return [{ type: 'text', text: boundTerminalText(text, maxBytes) }]\n}\n\nfunction rawContentText(content: readonly ContentBlock[]): string | undefined {\n  if (content.length !== 1) return undefined\n  const block = content[0]\n  return block?.type === 'text' ? block.text : undefined","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/terminal/tool-terminal/src/index.ts#L100-L136","documentation":"Error \"terminal tools require an initiating agent\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/terminal/tool-terminal/src/index.ts:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Invoke terminal tools within an agent session so an initiating agent exists."],"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"}