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.
npx agentmods add agents/the-teacher/active_harness/agent_error_processinggit clone --depth 1 https://github.com/the-teacher/active_harnessWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00950 |
| Opus 5 | $0.00000 | $0.00475 |
| Sonnet 5 | $0.00000 | $0.00190 |
| Haiku 4.5 | $0.00000 | $0.00095 |
Grade A, and why
agent_error_processing 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 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
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.
How it starts
The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Error Processing
ActiveHarness divides errors into two categories: retryable and non-retryable. Retryable errors trigger automatic retries with exponential backoff, then move to the next fallback model. Non-retryable errors abort the entire chain immediately.
Error Hierarchy
ActiveHarness::Errors::Error (base)
├── AllModelsFailed # raised when every model in the chain fails
└── ProviderError # base for all provider-level failures
├── TimeoutError
├── RateLimitError
├── ServerError
├── ProviderUnavailableError
├── InvalidRequestError
├── InvalidApiKeyError
└── SafetyBlockedError
ProviderError carries optional metadata:
error.error_code # => "model_not_found" (provider-specific code, or nil)
error.metadata # => Hash with raw provider response fields, or nil
Retryable vs Non-Retryable
| Error | Retryable | Behaviour |
|---|---|---|
TimeoutError |
✓ | Retry same model, then next fallback |
RateLimitError |
✓ | Retry same model, then next fallback |
ServerError |
✓ | Retry same model, then next fallback |
ProviderUnavailableError |
✓ | Retry same model, then next fallback |
InvalidRequestError |
✓ | Treated as retryable — next fallback will be tried |
InvalidApiKeyError |
✗ | Stops the entire chain immediately |
SafetyBlockedError |
✗ | Stops the entire chain immediately |
Handling AllModelsFailed
Raised when every model in the fallback chain has been exhausted.
Use a standard rescue block around call:
begin
agent = SupportAgent.call(input: "Hello")
puts agent.result.output
rescue ActiveHarness::Errors::AllModelsFailed => e
puts "All models failed: #{e.message}"
# e.message contains the full list of attempted models and their errors
end
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.
- 2d ago First seen · 132 lines · 0 tokens per session scan A 6a9b0793a835
agent_error_processing is an agent published in the GitHub repository the-teacher/active_harness (89 stars, last pushed 23d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 950 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
AGENTS
The core Agents SDK, published to npm as agents. This is the most complex package in the monorepo.
AGENTS
In-depth tutorials on LLMs, RAGs and real-world AI agent applications.
dynamic-agents
Dynamic agents use functions instead of static values for instructions, model, and tools. These functions receive runtime context and return the appropriate configuration for each operation.
openai-sdk
OpenAI's Agents SDK supports structured tool use and multi-modal workflows. ContextForge can serve as a unified tool registry for OpenAI agents.
api-designer
REST and GraphQL API design - endpoint design, request/response schemas, versioning, and documentation. Use for designing new APIs or evolving existing ones.
accessibility-specialist
Accessibility expert: WCAG 2.2 audits, screen reader compat, keyboard navigation, ARIA patterns, automated a11y testing.