- Track a heartbeat timestamp in ~/.sharedinbox-agent-heartbeat at the start of each _run_loop() invocation so we can tell when it last ran. - Add `agent_loop.py monitor` subcommand that exits 1 with a WARNING message if the heartbeat is missing, corrupted, or older than 2 hours. - Add .forgejo/workflows/monitor.yml scheduled workflow that runs the monitor check every 2 hours on the self-hosted runner; a CI failure serves as the warning when the loop is stalled. - Add 7 unit tests covering all monitor / heartbeat scenarios. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
347 B
YAML
19 lines
347 B
YAML
name: Monitor Agent Loop
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 */2 * * *' # every 2 hours
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
monitor:
|
|
name: Check Agent Loop Health
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Check agent loop heartbeat
|
|
run: python3 scripts/agent_loop.py monitor
|