Skip to content

feat(core): add AgentXError, CircuitBreaker, and onError API#229

Merged
deepracticexs merged 1 commit intomainfrom
feat/error-handling-circuit-breaker
Mar 12, 2026
Merged

feat(core): add AgentXError, CircuitBreaker, and onError API#229
deepracticexs merged 1 commit intomainfrom
feat/error-handling-circuit-breaker

Conversation

@deepracticexs
Copy link
Member

Summary

  • New @agentxjs/core/error module — AgentXError as core-level type (like AgentXPlatform)
  • CircuitBreaker: 5 consecutive driver failures → open → 30s cooldown → half-open probe
  • Message persistence failures now emit AgentXError via EventBus (no longer silently swallowed)
  • New ax.onError(handler) top-level API on AgentX interface
  • BDD feature: 03-error-handling.feature

Test plan

  • bun run build passes
  • Verify AgentXError import from @agentxjs/core/error and agentxjs
  • Verify ax.onError() receives persistence errors
  • Verify circuit breaker opens after 5 consecutive failures
  • Verify circuit breaker half-open probe after 30s

🤖 Generated with Claude Code

- New @agentxjs/core/error module with AgentXError class (top-level type like AgentXPlatform)
- CircuitBreaker: 5 consecutive failures → open → 30s cooldown → half-open probe
- Persistence failures now emit AgentXError via EventBus instead of silent logging
- New ax.onError(handler) top-level API on AgentX interface
- BDD feature: 03-error-handling.feature

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@deepracticexs deepracticexs merged commit 207a986 into main Mar 12, 2026
4 of 5 checks passed
@deepracticexs deepracticexs deleted the feat/error-handling-circuit-breaker branch March 12, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant