Skip to content

fix(agent): circuit breaker + exponential backoff#327

Merged
gHashTag merged 1 commit intomainfrom
fix/circuit-breaker-backoff
Mar 12, 2026
Merged

fix(agent): circuit breaker + exponential backoff#327
gHashTag merged 1 commit intomainfrom
fix/circuit-breaker-backoff

Conversation

@gHashTag
Copy link
Copy Markdown
Owner

Summary

  • Adds circuit breaker to entrypoint.zig — prevents respawn loop when API is down
  • 3 attempts with exponential backoff: 30s → 60s → 120s
  • On permanent failure: STOP, comment on issue with CIRCUIT BREAKER TRIPPED, do NOT respawn
  • Removes dead code from initial implementation

Problem

Agent #312 was cycling AWAKENING→FAILED→AWAKENING→FAILED — consuming a pool slot and spamming Telegram. z.ai circuit breaker tripped but nothing stopped the agent from retrying forever.

Test plan

  • zig build — clean
  • ISSUE=312 ./zig-out/bin/agent-entrypoint --dry-run — works
  • Deploy and verify stuck agent stops after 3 attempts

Closes #312 (respawn loop)

🤖 Generated with Claude Code

…ig (#312)

Prevents respawn loop when API is down (z.ai circuit breaker):
- 3 attempts with exponential backoff (30s, 60s, 120s)
- On permanent failure: STOP, comment on issue, do NOT respawn
- Removes dead code from initial implementation

Without this, agent #312 was cycling: AWAKENING→FAILED→AWAKENING→FAILED
consuming a pool slot and spamming Telegram indefinitely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gHashTag gHashTag merged commit 09853f9 into main Mar 12, 2026
@gHashTag gHashTag deleted the fix/circuit-breaker-backoff branch March 12, 2026 08:48
gHashTag added a commit that referenced this pull request Mar 18, 2026
fix(agent): circuit breaker + exponential backoff
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.

SEC-DELTA: Add rate limiting to cloud monitor HTTP server

1 participant