StopFailure

A failure handler that runs when an agent stops because of a service or request error. It responds to causes such as rate limits, failed authentication, billing problems, overloaded services, and server errors.

In plain words
What is it for?
Use it to trigger automatic handling or logging for different agent-stop failures, including unavailable models, organisation access problems, invalid requests, and output limits.
Why use it?
It gives these stop events a defined follow-up action instead of leaving every failure unhandled. Each recognised failure type is passed to a Python runner command.

Hook

Part of the audio-hooks plugin — 1 skill, 30 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add hooks/chanmeng666/echook/stop-failure
Clone the repo
git clone --depth 1 https://github.com/ChanMeng666/echook

Or install audio-hooks, the plugin that ships this one along with the rest of its 1 skill, 30 hooks.

Per session not measured What this adds to a session before it is invoked.
When invoked not measured Not applicable: nothing here is loaded into a session.
Security scan A 0 findings. Scan, not verified.
Origin 86% copy Near-identical to another mod in the catalogue.
Security

Grade A, and why

StopFailure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the commands this hook runs, not an audit. A hook is shell that executes on your machine at the event it names, which is why every command in it is printed with what was found.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

86% identical to Notification — 101 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/audio-hooks/hooks/hooks.json · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

{
  "StopFailure": [
    {
      "matcher": "rate_limit",
      "hooks": [
        {
          "type": "command",
          "command": "python \"${CLAUDE_PLUGIN_ROOT}/runner/run.py\" stop_failure_rate_limit",
          "async": true,
          "timeout": 10
        }
      ]
    },
    {
      "matcher": "authentication_failed",
      "hooks": [
        {
          "type": "command",
          "command": "python \"${CLAUDE_PLUGIN_ROOT}/runner/run.py\" stop_failure_authentication_failed",
          "async": true,
          "timeout": 10
        }
      ]
    },
    {
      "matcher": "oauth_org_not_allowed",
      "hooks": [
        {
          "type": "command",
          "command": "python \"${CLAUDE_PLUGIN_ROOT}/runner/run.py\" stop_failure_oauth_org_not_allowed",
          "async": true,
          "timeout": 10
        }
      ]
    },
    {
      "matcher": "account_on_hold",
      "hooks": [
        {
          "type": "command",
          "command": "python \"${CLAUDE_PLUGIN_ROOT}/runner/run.py\" stop_failure_account_on_hold",
          "async": true,
          "timeout": 10
        }
      ]
    },
    {
      "matcher": "billing_error",
      "hooks": [
        {
          "type": "command",
          "command": "python \"${CLAUDE_PLUGIN_ROOT}/runner/run.py\" stop_failure_billing_error",
          "async": true,
          "timeout": 10
        }
      ]
    },
    {
      "matcher": "overloaded",
      "hooks": [
        {
          "type": "command",
          "command": "python \"${CLAUDE_PLUGIN_ROOT}/runner/run.py\" stop_failure_overloaded",
          "async": true,
          "timeout": 10
        }
      ]
    },
    {
      "matcher": "invalid_request",
      "hooks": [
        {
          "type": "command",
          "command": "python \"${CLAUDE_PLUGIN_ROOT}/runner/run.py\" stop_failure_invalid_request",
          "async": true,
          "timeout": 10
        }
      ]
    },
    {
      "matcher": "model_not_found",
      "hooks": [
        {
      

Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 125 lines scan A 558ae9a1c71b

Subscribe to this mod's changes

StopFailure is a hook published in the GitHub repository ChanMeng666/echook (86 stars, last pushed 10d ago), licensed MIT. Its token cost is not measured: a hook is shell that never enters the context. A static security scan graded it A with 0 findings. It is 86% identical to Notification, differing in 101 lines, and is treated as a copy.