CodesTaskStartResult codes.task-start-result@1

Generated at from openvibe-contracts v0.177.0 and openvibe-sdk v0.44.0.

Version
1.0.0
Owner
codes
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/codes/task-start-result.v1.json

codes.task-start-result@1: the answer of POST /api/v1/tasks (201 created, or 200 with created false for a repeated idempotency key).

Fields

FieldTypeRequiredDescriptionConstraints
taskcodes.taskyes
createdbooleanyes

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: created
{
  "task": {
    "id": "tsk_01M4XEV0JT93CAYTXVD6V0QW1E",
    "state": "queued",
    "repo": "https://github.com/octocat/Hello-World",
    "ref": null,
    "agent": "deepseek",
    "url": "https://openvibe.codes/run/tasks/tsk_01M4XEV0JT93CAYTXVD6V0QW1E",
    "created_at": "2026-10-14T15:00:00.000Z",
    "updated_at": "2026-10-14T15:00:00.000Z"
  },
  "created": true
}
Valid: repeated
{
  "task": {
    "id": "tsk_01M4XEV0JT93CAYTXVD6V0QW1E",
    "state": "succeeded",
    "repo": "https://github.com/octocat/Hello-World",
    "ref": null,
    "agent": "deepseek",
    "url": "https://openvibe.codes/run/tasks/tsk_01M4XEV0JT93CAYTXVD6V0QW1E",
    "created_at": "2026-10-14T15:00:00.000Z",
    "updated_at": "2026-10-14T15:01:12.000Z",
    "result": {
      "ok": true,
      "agents": [
        "deepseek"
      ],
      "summary": "Appended the line.",
      "files": [
        {
          "path": "README",
          "added": 1,
          "removed": 0
        }
      ],
      "patch": "diff --git a/README b/README\n--- a/README\n+++ b/README\n@@ -1 +1,2 @@\n Hello World!\n+Edited.\n",
      "cost_usd": 0.0011,
      "duration_ms": 4200,
      "push": {
        "pushed": false,
        "reason": "no GITHUB_TOKEN on this machine"
      }
    }
  },
  "created": false
}
Rejected: bad-task
{
  "task": {
    "id": "tsk_01M4XEV0JT93CAYTXVD6V0QW1E",
    "state": "nope",
    "repo": "https://github.com/octocat/Hello-World",
    "ref": null,
    "agent": "deepseek",
    "url": "https://openvibe.codes/run/tasks/tsk_01M4XEV0JT93CAYTXVD6V0QW1E",
    "created_at": "2026-10-14T15:00:00.000Z",
    "updated_at": "2026-10-14T15:00:00.000Z"
  },
  "created": true
}
Rejected: no-created
{
  "task": {
    "id": "tsk_01M4XEV0JT93CAYTXVD6V0QW1E",
    "state": "queued",
    "repo": "https://github.com/octocat/Hello-World",
    "ref": null,
    "agent": "deepseek",
    "url": "https://openvibe.codes/run/tasks/tsk_01M4XEV0JT93CAYTXVD6V0QW1E",
    "created_at": "2026-10-14T15:00:00.000Z",
    "updated_at": "2026-10-14T15:00:00.000Z"
  }
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('codes.task-start-result@1', value);   // { valid, errors: [{ path, message }] }