Engineering

Find out why an LLM call failed

Mention Merlin in Slack with an OpenRouter generation id from your logs. You get why the call failed and the fix it would make, from the generation, its providers and your code.

@Merlin from now on, when someone in #eng shares an OpenRouter generation id from a failed LLM call, look it up in OpenRouter: the model, the provider that served it, the tokens, the latency and the finish reason. Check the status of that model's providers, then read the timeout and retry code for the call in acme/app. Reply in the thread with the cause and the fix you'd make. Only read: don't change code or send test messages.

#eng
Get started for free
  1. Starts whenAn engineer mentions @Merlin in #eng with the generation id of a failed LLM call
  2. Merlin worksClaude Code or Codex looks up the generation in OpenRouter, checks the model's providers and reads the timeout and retry code for that call
  3. You getThe cause and the fix it would make, in the thread, with no code changed

Tools

  • Slack
  • OpenRouter

Capabilities

  • Integrations
  • Your agent's MCP

How it works

From a generation id to why the call failed.

Mention @Merlin in #eng with the generation id from your logs and what went wrong.

Acme

Channels

general

eng

product

support-eng

data

finance

it-help

legal

Direct messages

Merlin

Ana

Leo

eng

24

MessagesAdd canvasFiles

Today

Ana11:40

@Merlin invoice extraction keeps failing for one customer with Unexpected end of JSON input. Generation id from the logs: gen-7rKx2LmQ9vTzW4pNaB8cYdE1fH

Message #eng

Before and after

A failed LLM call gets a cause, not another retry.

Without Merlin

An engineer digs the generation out of OpenRouter, checks the providers and reads the client code to piece it together.

  1. 01See the failure in #eng
  2. 02Find the generation id in the logs
  3. 03Look up the generation
  4. 04Check the finish reason and tokens
  5. 05Check the model's providers
  6. 06Read the extraction call
  7. 07Read the retry wrapper
  8. 08Work out the cause
  9. 09Reply in the thread

With Merlin

One mention gets the cause and a fix in the thread where the failure came up.

  1. @Merlin in #engWith the generation id from the logs
  2. Checks OpenRouter and the code on Ana's MacBookClaude Code, read-only
  3. The cause and a fixIn the thread, no code changed

Setup

Add Merlin to #eng and give your agent OpenRouter.

Set these up once and anyone in #eng can ask why a call failed. The run only reads, so it sends no billable test messages.

  1. 01Connect a machineRuntimeInstall the Merlin desktop app or CLI on a computer running Claude Code or Codex. You can also use a machine a teammate shares with your workspace.
  2. 02Add Merlin to SlackIntegrationsInstall the Slack app and add Merlin to the channel you work in. A private channel needs /invite @Merlin.
  3. 03Add OpenRouter to your agentYour agent's MCPConnect the OpenRouter MCP server to Claude Code or Codex on the machine that runs this. Its credentials stay on that machine.
  4. 04Keep your code on the machineRuntimeMerlin reads the code in a local project on the runtime, so keep the repository checked out there.
  5. 05Connect the account your app usesYour agent's MCP

    Sign in to OpenRouter with the account your app's API key belongs to, so the generation ids in your logs are ones it can look up. The key it mints for your agent expires after 7 days (how it works), so reconnect when a lookup fails with an auth error.

  6. 06Log the generation id with each failureRuntime

    Log the id of each OpenRouter response next to its error, so a failed call has a generation id to share.

  7. 07Paste the setup promptGuidanceAn owner or admin sends the prompt below to @Merlin once, and it becomes workspace guidance for every future run.

Prompt

Tell Merlin how to look into a failed LLM call.

@Merlin from now on, when someone in #eng shares an OpenRouter generation id from a failed LLM call, look it up in OpenRouter: the model, the provider that served it, the tokens, the latency and the finish reason. Check the status of that model's providers, then read the timeout and retry code for the call in acme/app. Reply in the thread with the cause and the fix you'd make. Only read: don't change code or send test messages.

#eng

Once, when you paste it

  1. PromptYou paste the prompt to @Merlin
  2. GuidanceMerlin saves your rules as workspace guidance

Every time someone mentions Merlin in Slack

  1. IntegrationThe Slack app spots the mention
  2. RuntimeMerlin picks an available machine
  3. ContextThe run gathers context
  4. WorkClaude Code or Codex checks the generation and the code
  5. SteeringYour team steers the work in the thread
  6. ResultMerlin replies with the cause and a fix

Bring your coding agents into the tools your team already uses.

Let your whole team hand work to Claude Code and Codex today. Connect one machine and add Merlin to Slack, Linear or GitHub. 14-day free trial, no API keys, no card.