Skip to content

Error Reporting

nodyn includes opt-in error reporting via Sentry. When configured, crashes, unhandled errors, and user-submitted bug reports are captured with structured context — without sending user prompts or response content.

  1. Sign up at sentry.io (free tier: 5K events/month)
  2. Create a new Node.js project
  3. Select EU region (Frankfurt) for DSGVO/GDPR compliance
  4. Copy the DSN (format: https://[email protected]/id)
Terminal window
# Environment variable (recommended for deployments)
NODYN_SENTRY_DSN=https://[email protected]/id
# Or in ~/.nodyn/config.json
{ "sentry_dsn": "https://[email protected]/id" }
# Or in project-level .nodyn/config.json (sentry_dsn is a PROJECT_SAFE_KEY)
{ "sentry_dsn": "https://[email protected]/id" }

Without a DSN, Sentry is completely inactive — zero overhead, no imports loaded.

Terminal window
docker run -d \
-e ANTHROPIC_API_KEY=sk-ant-... \
-e NODYN_SENTRY_DSN=https://[email protected]/id \
-v ~/.nodyn:/home/nodyn/.nodyn \
nodyn
DataDetails
CrashesuncaughtException, unhandledRejection — full stack trace
NodynError hierarchyError code, type, safe context keys (tool name, run ID, session ID)
Tool breadcrumbsTool name, success/failure, duration — NO input data
LLM breadcrumbsModel name, input/output token counts — NO prompt content
WorkerLoop failuresBackground task ID, type, error message
Release tracking[email protected] — see which version caused which errors

Telegram users can report issues with /bug Something went wrong:

/bug The summary was completely wrong
/bug Tool keeps timing out on large files

The report is sent to Sentry as user feedback, linked to the latest error event.

DataProtection
User promptsNever sent — stripped by beforeBreadcrumb and beforeSend
AI responsesNever sent
File contentsNever sent
API keys / secretsNever sent
HTTP request bodiesStripped by beforeSend
NodynError contextAllowlisted keys only (toolName, runId, sessionId, etc.)
Performance tracesDisabled (tracesSampleRate: 0)

The beforeBreadcrumb hook strips prompt, response, content, and message fields from all breadcrumbs. The beforeSend hook strips request.data from all events.

Engine.init()
├─ initSentry(dsn) // Dynamic import, cached module ref
├─ installGlobalHandlers() // uncaughtException, unhandledRejection
└─ subscribe(toolEnd) // Automatic tool breadcrumbs via diagnostics_channel
Session.run()
├─ streamHandler // LLM breadcrumbs (model + tokens)
└─ catch // captureNodynError() or captureError()
WorkerLoop.executeTask()
└─ catch // captureError() with task tags
Engine.shutdown()
└─ shutdownSentry() // flush(5s) + close()

All Sentry calls are fire-and-forget — errors in Sentry itself never affect nodyn operation.

Sentry has built-in alerting. Configure in your Sentry project under Alerts:

  • Email (default) — immediate notifications for new issues
  • Slack/Teams — via Sentry integrations
  • Weekly digest — summary of error trends

No custom Telegram or webhook integration is needed — Sentry handles notification routing.

When using nodyn as a library, you can initialize Sentry yourself or let the Engine handle it:

import { Engine } from '@nodyn-ai/core';
// Option 1: Via config (Engine handles init)
const engine = new Engine({ });
// Set NODYN_SENTRY_DSN env var or sentry_dsn in config
await engine.init();
// Option 2: Direct API
import { initSentry, captureError, addToolBreadcrumb } from '@nodyn-ai/core';
await initSentry('https://[email protected]/id');
// Now all errors in Session.run() are automatically captured
// Manual breadcrumbs (optional)
addToolBreadcrumb('my-tool', true, 250);

nodyn works with self-hosted Sentry instances. Point the DSN to your server:

Terminal window
NODYN_SENTRY_DSN=https://[email protected]/id

No code changes needed — the DSN determines the destination.

@sentry/node is a regular dependency (BSD-3-Clause, compatible with ELv2). It is only imported when a DSN is configured — no overhead for users who don’t enable Sentry.