Skip to content

Diagnostics reference ​

Technical details for operators who need to investigate problems in depth. For common problems, start with Troubleshooting.

Application logs ​

Logs are structured JSON lines (docker logs -f nimbot). Follow a task by agentId and taskId; task.host_accepted adds hostTaskId to correlate Server and agent-process work.

EventMeaning
task.queuedTask submitted; includes how many tasks were ahead
task.preparation_started / task.preparation_finishedModel preparation; ready: false leaves the task queued
task.host_submission_started, task.host_accepted, task.host_completedSubmission versus execution
task.host_polling_failed / task.host_polling_resumedObservation outages, without logging each retry
task.waitingEvery 30 seconds while waiting, with stage and elapsedMs; a notice, not proof of a hang
task.delivery_finishedThe delivery handler returned; check Chat delivery in the panel to confirm delivery
task.finalization_failedThe final task state couldn't be saved
server.task_recovery_finishedOn startup, how many running tasks were marked interrupted or cancelled
bot.connection_failedTelegram connection stage and errorCode; a 409 is classified as polling_conflict
schedule.fired, schedule.skipped, schedule.failed, schedule.tick_failedSchedule activity with agentId, scheduleId, and outcome
mcp.started, mcp.finished, mcp.failed, mcp.diagnosticMCP attempts, with numbered diagnostic parts

task.waiting stages are preparing, executing, progress_delivery, finalizing, and chat_delivery. Logs never include prompts, response text, provider error bodies, connection URLs, or credentials.

The container health check only tests the panel's local login endpoint. It doesn't check Telegram, AI credentials, model access, or agents.

MCP history and diagnostics ​

Each integration's MCP history records connection tests, discovery, and tool executions, including failed credential preparation. Filter by result or agent, search an exact Attempt ID, and use Refresh history. Pages show up to 50 entries. Each entry shows revision, transport, task and invocation correlation, last stage, duration, HTTP/JSON-RPC/SDK/process codes, request count, and a valid Retry-After. Copy diagnostic copies only the sanitized record. History doesn't keep invocation arguments or full responses and isn't a manual tool console.

  • History is stored in server.sqlite, independently of logging, for seven days, up to the newest 5,000 entries. Cleanup runs at startup and when an attempt is registered.
  • Deleting an agent or integration doesn't delete its history. A deleted integration's history stays available through the authenticated /api/mcp/:definitionId/attempts endpoints until it expires.
  • Attempts pending during a restart become Interrupted. An interrupted write may have taken effect. Nimbot never retries automatically; replaying a saved invocation reuses its original reference.
  • Catalog searches and reading saved result pages don't create attempts.
  • The model receives a short English summary, the available codes, and the same attemptId shown in the panel. MCP isError results keep their content and gain the reference. Local process stderr stays in the panel and logs, never in the model diagnostic.
  • Detailed diagnostics are limited to 4 KiB. They strip terminal controls and redact credentials, environment values, endpoint URLs, launcher and invocation arguments, including escaped forms. HTTP bodies are excluded. If an MCP server only reports Tool call failed, Nimbot says no further details were supplied; check the MCP server's own logs.
  • When a result is too large for one message, the agent reads the remaining parts with read_mcp_result during the same task, without repeating the external call.

In chats, agents use list_mcp_tools to search the catalog and call_mcp_tool to run a tool.

Local MCP processes ​

  • Packages run under the installation's account in a dedicated integration folder. Public and private variables are stored in private credential files and passed only to that integration's process. Nimbot's Git helper settings take precedence over integration variables with the same names.
  • Caches live in mcp-runtime/ (pnpm uses mcp-runtime/pnpm-cache and mcp-runtime/pnpm-store). Caching speeds up installation but not the server's own startup. pnpm uses its default build-script policy.
  • Enabled local integrations start in the background when Nimbot starts or when enabled. One process per integration stays running across tool calls and connection tests, keeping in-memory caches and rate-limit state. Changing the command or environment restarts it; changing labels, tools, or access doesn't. Maintenance and shutdown stop all local processes.
  • Startup and installation have a five-minute deadline. Failed npm and pnpm connections include bounded, redacted installation progress.
  • A failure or exit triggers up to three automatic restarts after 1, 5, and 15 seconds. Sixty seconds of stable uptime resets the counter. Failed or uncertain tool calls are never replayed.
  • Ready sessions keep a 30-second per-call budget and a 45-second outer dispatch deadline (TOOL_DISPATCH_TIMEOUT). Persistent sessions don't guarantee recovery from upstream HTTP 429 errors.
  • JSONC import: local mcpServers entries support command: "npx", "pnpm", or "uvx", an args array of strings, and an optional env object of strings; type may be omitted or "stdio". pnpm args must start with "dlx" and a package; OpenCode entries use command: ["pnpm", "dlx", "package"]. Nimbot removes dlx from the editable arguments. Other pnpm subcommands, custom working directories, and unsupported authentication options are rejected.

HTTPS MCP connections and schema review ​

  • Edit an integration in MCP catalog to change its endpoint, allowed tools, argument schemas, and read/write classification. New tools are classified as write-or-unknown.
  • Changing the endpoint retires the shared credential and keeps each agent's access switch. Removing the credential returns the integration to anonymous mode. A configured but missing credential fails without falling back to anonymous access. Failed credential file cleanup is retried on startup or a later MCP settings change.
  • Test connection and Retry tool setup save and enable new compatible tools. Previously disabled tools stay disabled. Redirects are rejected; discovery is limited to eight seconds, 256 KiB of responses, and four tool pages.
  • Schemas use JSON Schema 2020-12 by default, or an explicit draft-07 declaration. Unsupported keywords, unknown formats, unresolved references, and asynchronous schemas are rejected; external references are never fetched. Schemas and arguments are limited to 16 KiB and 32 nesting levels. Arguments are validated without type conversion, defaults, or removing extra fields.
  • If a tool goes missing, changes its schema, or the listing is malformed, Nimbot records a block in server.sqlite that survives restarts and edits. The integration shows Review needed, and the agent's Access page links to it. Discovery alone never clears a block. A draft opened before a block must be refreshed before saving. Remote tools absent from the approved catalog are never exposed.
  • Approved tools are available to chat, scheduled, manual, and webhook tasks when the agent has access. Delegated tasks receive none. Remote servers receive the tool name, validated arguments, MCP session data, and the configured bearer credential.
  • After upgrading from per-agent MCP credentials, save a new Shared credential for each integration that used one; anonymous integrations keep working.

Channel connections ​

  • Each agent page shows Telegram polling and Discord connection state separately. Discord can be connecting, connected, reconnecting, failed, or disconnected. A linked owner chat doesn't imply a live connection, and a connected channel doesn't prove the agent process or provider is ready.
  • Tasks from both channels share one queue and conversation. Discord failures don't stop Telegram polling, and tasks survive a Telegram polling failure.
  • Discord uses a Gateway connection with the direct-message intent; privileged intents aren't required. Changing the token or owner replaces the connection. Reconnects use Discord's resume endpoint; replayed events pass through the same deduplication, so a replayed message never runs a task twice. Approval buttons work only in the owner DM.
  • On startup, a restored Telegram task waits in the queue until its verified bot is attached, keeping order. A failed Telegram identity check leaves work queued; restore a valid token and restart. Discord tasks at the head of the queue can run without Telegram.
  • Telegram files: the Server saves the file reference before downloading; the agent stores it in attachments/<task-id>/. Exports come from exports/<task-id>/ and are held in memory for up to ten minutes. Queued imports resume after a restart; interrupted imports or tasks are not replayed.

Notification tests and alerts ​

  • The test API accepts a request ID, which deduplicates repeated submissions, and sends a fixed message. The five-per-minute quota counts new attempts across channels, including provider rate-limit responses; locally blocked requests don't count. Records and quotas are stored in server.sqlite, with a content hash and sanitized delivery state.
  • Uncertain deliveries (for example, interrupted by a restart) are never resent. The Discord adapter splits long text, suppresses mentions, and honors rate-limit cooldowns.
  • Owner alerts (three consecutive schedule failures, unexpected agent exits) go through the agent's Telegram bot. Delivery intent survives restarts; uncertain deliveries are never replayed. Unexpected exits are checked every 30 seconds; deliberate stops are ignored and the incident clears after a successful start.
  • Provider API key checks run at startup, every five minutes, and after credential changes, and use no inference quota.

How schedules run ​

  • The scheduler runs in the Server at startup and every 30 seconds. Recording an occurrence, enqueueing its task, and advancing the next run happen in one SQLite transaction, so a repeated tick or restart can't enqueue the same occurrence twice. This doesn't guarantee exactly-once external side effects.
  • Recurring occurrences up to 10 minutes late run once; older ones are recorded as missed, without replaying a backlog. An unfinished previous run produces skipped_overlap. A stopped agent, incomplete setup, or unlinked Telegram/Discord chat produces skipped_not_ready; only the first skip in a streak tries to send a notice.
  • Once schedules wait without a lateness limit and without recording repeated skips. Enqueueing disables them in the same transaction. The task receives the schedule ID and instructions to delete it only after verifying success. Failure or cancellation leaves it disabled.
  • MCP tools are snapshotted when a run starts, and access, schemas, and rules are checked again before each call. Ask rules wait 30 seconds for the owner in the saved delivery channel (the panel for Web, even with the browser closed). Memory, attachments, and peer/delegation tools are unavailable to scheduled and webhook runs.
  • Results are prefixed with the schedule name saved at enqueue time. Scheduled runs show no typing indicator and send no progress updates. Web skip outcomes stay in the panel without bot notifications.
  • The latest 20 runs per schedule are kept. Deleting a schedule or agent removes its history; queued task metadata is kept.
  • Three consecutive failures (timed, manual, and webhook runs together) trigger an owner alert. A success resets the streak; skips, cancellations, and interruptions don't change it.

Agents manage schedules with schedule_context, schedule_list, schedule_get, schedule_create, schedule_update, schedule_set_enabled, and schedule_delete. Create and update take the full name, prompt, time zone, and cadence; update also takes the schedule ID; delivery channel is optional. Webhook secrets are only available in the panel. Schedule administration doesn't require approval.

Panel and webhook API ​

Schedules are managed under the authenticated /api/agents/:id/schedules API. Mutations use POST with form fields name, prompt, timeZone, and cadence (a JSON object with its kind and fields). The optional deliveryChannel accepts telegram, discord, or web; omitting it on edit keeps the saved channel. The server assigns interval anchors. For a weekday schedule at 9 a.m., send cadence={"kind":"cron","expression":"0 9 * * 1-5"}.

Read or change the installation's schedule time zone with GET or POST /api/settings/schedules (form field timeZone).

For webhooks, create or edit with cadence={"kind":"webhook"} and timeZone=UTC. GET /api/agents/:id/schedules/:scheduleId/webhook and POST /api/agents/:id/schedules/:scheduleId/webhook/rotate read or regenerate {url, token}. The webhook endpoint POST /hooks/schedules/:id uses only the Bearer token (no cookies) and returns an outcome and, on failure, an error. Tokens are stored in server.sqlite, included in backups, and excluded from schedule listings. Rate limits survive restarts, and recent skipped and manual runs count toward them; 429 responses include Retry-After: 60.