Skip to main content

Opinionated SRE ops for AgentBus: edge-triggered health watchdog and SREWatchdogAgent.

Project description

okf-agentbus-ops

Opinionated SRE ops for AgentBus: edge-triggered health watchdog as a deterministic Python process (SREWatchdogAgent).

Item Value
PyPI name okf-agentbus-ops
Import agentbus_ops
CLI agentbus-ops
Core dependency okf-agentbus>=0.16.3
Version train Independent of core (0.1.0 ops vs 0.17.x core)

Why a separate package

Core (okf-agentbus) stays pure: routing, metrics, validate-config.
Opinionated policy (level transitions, cooldown, idempotency, hooks) lives here.

Install

pip install okf-agentbus-ops
# or path-install from monorepo during development:
# pip install -e packages/python/agentbus-ops

CLI (parity with bash P2)

# One-shot edge decision (no publish)
agentbus-ops watchdog --dry-run --json

# Live: publish SRE_STATUS only on healthy↔degraded↔critical edges
agentbus-ops watchdog --json

# Bootstrap seed silent (default); force first publish:
agentbus-ops watchdog --force-bootstrap-publish

# Attach compact metrics line
agentbus-ops watchdog --include-metrics

Exit codes match bash:

Code Meaning
0 silence / successful publish / dry-run decision
1 usage / config error
2 publish failed

Health level is not mirrored as process exit (cron stays green on steady degraded).

Library

from agentbus_ops import SREWatchdogAgent

class MyWatchdog(SREWatchdogAgent):
    def on_critical_alert(self, cur, decision):
        # optional LLM / page — default is no-op
        pass

agent = SREWatchdogAgent(workspace="/path/to/okf")
decision = agent.run_once(dry_run=True)
print(decision.action, decision.level)

Probe (v0.1 MVP)

v0.1 wraps the coordination-root bash probe:

scripts/swarm_health_check.sh --json

Pure-Python probe port is deferred. Edge policy, state file, and publish path are native Python and share .agentbus/sre_last_state.json with the bash strangler so cron can switch without dual state.

State file

Same contract as sre-edge-triggered runbook:

.agentbus/sre_last_state.json under AGENTBUS_WORKSPACE.

Not in scope (v0.1)

  • Autonomous restart daemon
  • Default-on LLM every tick
  • TypeScript package

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

okf_agentbus_ops-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

okf_agentbus_ops-0.1.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file okf_agentbus_ops-0.1.0.tar.gz.

File metadata

  • Download URL: okf_agentbus_ops-0.1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for okf_agentbus_ops-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0dd58a7f61e7fa1ab31c0f9ea561c697d15b5534f6e7463d5ce061a356d3898e
MD5 d515b1dacc8ca628dd3336208709c811
BLAKE2b-256 ae500e9a85762d385dc874427f55d88fb98645cea8e540bb908a3433b23152bc

See more details on using hashes here.

File details

Details for the file okf_agentbus_ops-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for okf_agentbus_ops-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 350f5414ae427efce4bffac246c6eb7b03ec8f2c44099c99176f0d9d18bc6ce7
MD5 ac6da5f4c114ea5969e51fc8cc11c869
BLAKE2b-256 2c4dd662b93178b1380834b14c97a6776cba6bf5df33c205b9931c3f24fc2241

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page