Skip to content

feat: Gateway Guardian v4 + Smart Session Archiver#6

Merged
profbernardoj merged 1 commit into
mainfrom
feat/guardian-v4-session-archiver
Feb 14, 2026
Merged

feat: Gateway Guardian v4 + Smart Session Archiver#6
profbernardoj merged 1 commit into
mainfrom
feat/guardian-v4-session-archiver

Conversation

@profbernardoj
Copy link
Copy Markdown
Contributor

What

Adds two scripts from Everclaw v0.9.3-v0.9.4:

Gateway Guardian v4 (scripts/gateway-guardian.sh)

Billing-aware self-healing watchdog. Classifies inference errors as billing vs transient — billing errors trigger backoff + notification instead of useless restarts. Includes proactive Venice DIEM credit monitoring, Signal notifications, and four-stage restart escalation.

Smart Session Archiver (scripts/session-archive.sh)

Size-triggered session archiver that prevents the OpenClaw dashboard from choking on large session histories. At ~17MB (134+ sessions), browsers hit 'Page Unresponsive' because the DOM renderer can't handle thousands of chat elements. The archiver monitors directory size and moves old sessions to archive/ when it exceeds 10MB (configurable).

Why

  • Guardian v3 couldn't distinguish billing exhaustion from transient failures, leading to restart loops
  • Dashboard unresponsive issue hit us at 17MB of session data — needs automated prevention

Testing

  • Guardian v4 running in production on launchd for 24+ hours
  • Session archiver tested: correctly excludes archive/ subdir from size calculation, protects active sessions, reports accurate headroom

Checklist

  • Scripts tested on macOS (arm64)
  • README architecture diagram updated
  • Both scripts are chmod +x

From Everclaw v0.9.3-v0.9.4:

Gateway Guardian v4 (scripts/gateway-guardian.sh):
- Billing-aware escalation — classifies errors as billing vs transient
- Proactive Venice DIEM credit monitoring
- Signal notifications on billing exhaustion/recovery
- Four-stage restart escalation with nuclear reinstall

Smart Session Archiver (scripts/session-archive.sh):
- Size-triggered archiving (default 10MB threshold)
- Prevents dashboard 'Page Unresponsive' from large session histories
- Protects active sessions, guardian probe, keeps 5 most recent
- --check/--force/--verbose modes
- JSON output for cron consumption

Updated architecture diagram in README.
@profbernardoj profbernardoj merged commit 04d0c90 into main Feb 14, 2026
2 of 3 checks passed
profbernardoj added a commit that referenced this pull request Feb 23, 2026
From Everclaw v0.9.3-v0.9.4:

Gateway Guardian v4 (scripts/gateway-guardian.sh):
- Billing-aware escalation — classifies errors as billing vs transient
- Proactive Venice DIEM credit monitoring
- Signal notifications on billing exhaustion/recovery
- Four-stage restart escalation with nuclear reinstall

Smart Session Archiver (scripts/session-archive.sh):
- Size-triggered archiving (default 10MB threshold)
- Prevents dashboard 'Page Unresponsive' from large session histories
- Protects active sessions, guardian probe, keeps 5 most recent
- --check/--force/--verbose modes
- JSON output for cron consumption

Updated architecture diagram in README.
@profbernardoj profbernardoj deleted the feat/guardian-v4-session-archiver branch February 23, 2026 06:28
profbernardoj pushed a commit that referenced this pull request Feb 23, 2026
From Everclaw v0.9.3-v0.9.4:

Gateway Guardian v4 (scripts/gateway-guardian.sh):
- Billing-aware escalation — classifies errors as billing vs transient
- Proactive Venice DIEM credit monitoring
- Signal notifications on billing exhaustion/recovery
- Four-stage restart escalation with nuclear reinstall

Smart Session Archiver (scripts/session-archive.sh):
- Size-triggered archiving (default 10MB threshold)
- Prevents dashboard 'Page Unresponsive' from large session histories
- Protects active sessions, guardian probe, keeps 5 most recent
- --check/--force/--verbose modes
- JSON output for cron consumption

Updated architecture diagram in README.
profbernardoj pushed a commit that referenced this pull request Feb 25, 2026
From Everclaw v0.9.3-v0.9.4:

Gateway Guardian v4 (scripts/gateway-guardian.sh):
- Billing-aware escalation — classifies errors as billing vs transient
- Proactive Venice DIEM credit monitoring
- Signal notifications on billing exhaustion/recovery
- Four-stage restart escalation with nuclear reinstall

Smart Session Archiver (scripts/session-archive.sh):
- Size-triggered archiving (default 10MB threshold)
- Prevents dashboard 'Page Unresponsive' from large session histories
- Protects active sessions, guardian probe, keeps 5 most recent
- --check/--force/--verbose modes
- JSON output for cron consumption

Updated architecture diagram in README.
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