AiRunFailedPayload ai.run.failed@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
ai
Visibility
first-party
Status
planned
Compatibility
backward
Decision
ADR-015
Schema
https://openvibe.network/contracts/events/payloads/ai.run.failed.v1.json

ai.run.failed v1 (OpenVibe.AI server/runs.js execute / recoverInterrupted). PLANNED: AI does not publish run events yet (its manifest notes list ai.run.queued|succeeded|failed|cached once the Events client is wired in); this is the shape it is to send. A run ended failed: a provider, route, source or output error, run.internal, or run.interrupted after a restart or shutdown (retryable with POST /api/v1/runs/:id/retry unless its input was not retained). A projection of ai.run@1 without input or output (ADR-015: request metadata, never raw prompts). requester is the token principal that created the run (service, app or mod). Envelope: subject { type: run, id: <run_id> }, visibility internal, priority important, actor service:ai.

Fields

FieldTypeRequiredDescriptionConstraints
run_idstringyes
  • pattern ^run_[0-9A-HJKMNP-TV-Z]{26}$
statusconstyes
  • = "failed"
workflowobjectyes
  • no other fields
workflow.keystringyes
workflow.versionintegeryes
  • minimum 1
requesteridentity.subject-refyes
on_behalf_ofone ofyes
targetone ofyes
attributionone ofyes
providerstring | nullyesProvider that produced the output; null before a provider call and for cached runs.
modelstring | nullyes
fallback_usedbooleanyes
syntheticbooleanyesStub provider output.
cached_fromnullyes
usageobjectyes
  • no other fields
usage.tokens_inintegeryes
  • minimum 0
usage.tokens_outintegeryes
  • minimum 0
usage.cost_usdnumberyes
  • minimum 0
usage.attemptsintegeryes
  • minimum 0
errorobjectyes
  • no other fields
error.codestringyes
  • pattern ^[a-z][a-z0-9_]*(\.[a-z0-9_]+)+$
error.detailstring | nullyes
citations_countintegeryes
  • minimum 0
retry_ofstring | nullyes
  • pattern ^run_[0-9A-HJKMNP-TV-Z]{26}$
created_atstringyes
  • format date-time
finished_atstringyes
  • format date-time

Examples

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

Valid: interrupted
{
  "run_id": "run_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "status": "failed",
  "workflow": {
    "key": "news.summarize_story",
    "version": 2
  },
  "requester": {
    "type": "service",
    "id": "news"
  },
  "on_behalf_of": null,
  "target": {
    "service": "news",
    "type": "story",
    "id": "sty_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "attribution": null,
  "provider": null,
  "model": null,
  "fallback_used": false,
  "synthetic": false,
  "cached_from": null,
  "usage": {
    "tokens_in": 0,
    "tokens_out": 0,
    "cost_usd": 0,
    "attempts": 1
  },
  "error": {
    "code": "run.interrupted",
    "detail": "the service restarted while this run was in progress"
  },
  "citations_count": 0,
  "retry_of": null,
  "created_at": "2026-09-23T10:00:00.000Z",
  "finished_at": "2026-09-23T10:00:04.200Z"
}
Rejected: no-error
{
  "run_id": "run_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "status": "failed",
  "workflow": {
    "key": "news.summarize_story",
    "version": 2
  },
  "requester": {
    "type": "service",
    "id": "news"
  },
  "on_behalf_of": null,
  "target": {
    "service": "news",
    "type": "story",
    "id": "sty_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "attribution": null,
  "provider": "anthropic",
  "model": "claude-sonnet",
  "fallback_used": true,
  "synthetic": false,
  "cached_from": null,
  "usage": {
    "tokens_in": 1200,
    "tokens_out": 300,
    "cost_usd": 0.0081,
    "attempts": 2
  },
  "error": null,
  "citations_count": 1,
  "retry_of": null,
  "created_at": "2026-09-23T10:00:00.000Z",
  "finished_at": "2026-09-23T10:00:04.200Z"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('ai.run.failed@1', value);   // { valid, errors: [{ path, message }] }