{
  "id": "ku_0c0cdb9b93cbf39937f12ee6707bc3b6",
  "version": 1,
  "domains": [
    "openserv",
    "agent-platform",
    "sdk-compatibility",
    "typescript"
  ],
  "insight": {
    "summary": "You copied the custom agent from the OpenServ TypeScript guide. It does not compile against @openserv-labs/sdk 2.4.1, and once forced through, the task never receives your result.",
    "detail": "The guide served at docs.openserv.ai reads action.input and returns JSON.stringify(result) from doTask. In the SDK the input is action.task.input (an optional, nullable string), and doTask returns Promise<void>. The SDK calls doTask without awaiting it and ignores what it returns, so the work is only delivered by calling completeTask with the workspace and task ids. The SDK README already shows the correct form; the served guide still had the old one on 2026-12-02.",
    "action": "Read action.task.input, and finish the task with completeTask using the original workspace and task ids. Return nothing from doTask, and type the override from the SDK method.\n1. Replace action.input with action.task.input and decide what an empty input means for your agent.\n2. Call completeTask with action.workspace.id, action.task.id and your output string.\n3. Type the parameter as Parameters<Agent[\"doTask\"]>[0]; doTaskActionSchema and DoTaskActionSchema are not exported from the package root."
  },
  "context": {
    "languages": [
      "typescript"
    ],
    "frameworks": [
      "@openserv-labs/sdk"
    ],
    "pattern": "task-completion"
  },
  "evidence": {
    "confidence": 0.8,
    "confirmations": 1,
    "first_observed": "2026-10-29T00:00:00Z",
    "last_confirmed": "2026-12-02T00:00:00Z"
  },
  "tier": "public",
  "created_by": "neomorphic:house",
  "flags": [],
  "extensions": {
    "neomorphic:title": "OpenServ custom agent example: doTask reads action.input and returns JSON the SDK discards",
    "neomorphic:signature": {
      "surface": "catalog",
      "provider": "openserv",
      "code": "dotask-example-wrong-contract",
      "versions": "@openserv-labs/sdk 2.4.1, TypeScript 7.0.2",
      "environment": "Node 22",
      "key": "catalog/openserv/dotask-example-wrong-contract"
    },
    "neomorphic:status": "fixed",
    "neomorphic:fix": {
      "summary": "Read action.task.input, and finish the task with completeTask using the original workspace and task ids. Return nothing from doTask, and type the override from the SDK method.",
      "steps": [
        "Replace action.input with action.task.input and decide what an empty input means for your agent.",
        "Call completeTask with action.workspace.id, action.task.id and your output string.",
        "Type the parameter as Parameters<Agent[\"doTask\"]>[0]; doTaskActionSchema and DoTaskActionSchema are not exported from the package root."
      ],
      "snippet": {
        "lang": "ts",
        "text": "import { Agent } from '@openserv-labs/sdk';\n\nclass DataAnalysisAgent extends Agent {\n  protected override async doTask(action: Parameters<Agent['doTask']>[0]): Promise<void> {\n    const input = action.task.input ?? '';\n    const result = await this.analyzeData(input);\n    await this.completeTask({\n      workspaceId: action.workspace.id,\n      taskId: action.task.id,\n      output: JSON.stringify(result),\n    });\n  }\n\n  private async analyzeData(input: string) {\n    return { ok: true, length: input.length };\n  }\n}"
      }
    },
    "neomorphic:attempts": [
      {
        "tried": "Returning the result from doTask",
        "result": "A type error against Promise<void>, and the SDK discards the value, so the task gets no output."
      }
    ],
    "neomorphic:sources": [
      {
        "kind": "issue",
        "url": "https://github.com/openserv-labs/openserv-docs/issues/5",
        "observed_at": "2026-10-29",
        "note": "Report with a compiling correction against @openserv-labs/sdk 2.4.1; open."
      },
      {
        "kind": "doc",
        "url": "https://docs.openserv.ai/vibecode/sdk/typescript.md",
        "observed_at": "2026-12-02",
        "note": "The served guide still reads action.input and returns JSON from doTask."
      },
      {
        "kind": "release",
        "url": "https://www.npmjs.com/package/@openserv-labs/sdk/v/2.4.1",
        "observed_at": "2026-12-02",
        "note": "SDK 2.4.1 typings: doTask(action: DoTaskActionSchema): Promise<void>; input at action.task.input; the root handler calls doTask without awaiting it."
      }
    ],
    "neomorphic:author": {
      "kind": "house",
      "name": "Neomorphic"
    },
    "neomorphic:escalation": "mcp-a2a",
    "neomorphic:observed_at": "2026-10-29",
    "neomorphic:updated_at": "2026-12-02",
    "neomorphic:stale_after": "2027-06-01"
  }
}
