Agent Troubleshooting

Updated May 22, 2026 · 2 min read

Fix common agent failures: API key and auth token errors, context limits, connectivity drops, and Telegram setup issues.

A general check pass when an agent is misbehaving, then specific error fixes.

General checks (run these first)

  1. 1

    Railway logs

    look for errors

  2. 2

    AI API key

    must be paid; not expired or out of credits

  3. 3

    SENPI_AUTH_TOKEN

    fresh, no extra spaces, no Bearer prefix

  4. 4

    Railway plan

    $5/month paid plan; free tier lacks resources

  5. 5

    Context

    /new for fresh, /compact to reduce

Senpi cannot access or fix your agent - it is fully under your control.

Specific error fixes

"No Senpi runtimes running" / can't connect to Senpi.

Fix

Run openclaw senpi runtime list to see if any runtimes are registered. If none, create one with openclaw senpi runtime create -p <recipe.yaml>. If listed but failing: check SENPI_AUTH_TOKEN (or apiKey in the plugin config) is set correctly - no extra spaces, no Bearer prefix. Verify the agent can reach https://mcp.prod.senpi.ai/mcp. Run openclaw senpi status for per-runtime state and log level. Make sure your AI API key is paid - free/trial keys cause hallucinated errors.

"User not authorised" on authenticated endpoints (while public market-data endpoints work).

Fix

This is always a token issue. Senpi has no permission levels - one valid token gives full access. Generate a fresh token on senpi.ai after login. Set as SENPI_AUTH_TOKEN in Railway with no extra spaces. Use the raw token value - no Bearer prefix. Redeploy. Agents never need private keys or wallet keys - only the SENPI_AUTH_TOKEN.

HTTP 401 authentication_error: invalid x-api-key

Fix

Your AI provider API key is being rejected. Verify the key is still active and not expired in your provider's dashboard, ensure AI_PROVIDER is correctly set in Railway (all lowercase: openai, anthropic, gemini, openrouter), and redeploy.

"Context limit exceeded" / agent ran out of context.

Fix

Type /new for a fresh session or /compact to reduce context size. This is normal after extended conversations.

"OpenClaw: access not configured" with a pairing code on your Telegram bot.

Fix

Your Telegram user ID is not properly set. Go to Railway → your project → Variables and make sure TELEGRAM_USERID is your personal Telegram user ID (numeric), not your bot's ID. Find it by messaging @userinfobot on Telegram. After updating, redeploy and try messaging the bot again.

OpenClaw Gateway is unreachable

Fix

The runtime can't reach the gateway process (ECONNREFUSED, ETIMEDOUT, ENOTFOUND). Check the gateway is running.

OpenClaw is missing the plugin endpoint. Please reinstall the plugin.

Fix

HTTP 404 - the runtime plugin is not loaded. Reinstall with openclaw plugins install @senpi-ai/runtime.

Signal Dropped - AI model didn't respond in 90 seconds

Fix

LLM call timeout (HTTP 408/504). Does not retry automatically - next attempt happens on the next scanner signal.

Signal Dropped - AI model failed to respond

Fix

The LLM tool layer is erroring inside an otherwise-healthy gateway (often Gemini overloaded). Does not retry automatically.

Signal Dropped - OpenClaw hit an unexpected error

Fix

Any other 5xx. Does not retry automatically.

For runtime-specific install/build errors (TypeBox, no_margin_configured, action-history regression), see article 21.

Share

Related articles