# Grix Update Cron Setup

This document defines the automatic maintenance integration after plugin installation is complete.

## Recommended Goal

After installation is complete, there should be a scheduled cron task that periodically executes `grix-update`.

Recommended requirements:

1. Use `isolated` session
2. Execute silently by default
3. Executed by the main agent responsible for maintaining this machine
4. Run once every 6 hours by default

## Recommended Create Command

```bash
openclaw cron add \
  --name "grix auto update" \
  --every "6h" \
  --agent <main_agent> \
  --session isolated \
  --light-context \
  --no-deliver \
  --message 'Use the grix-update skill with {"mode":"check-and-apply","plugin_id":"grix","notify_on":"never","allow_restart":true}. If there is no update or the update succeeds, reply exactly NO_REPLY. If the install is unsupported or any step fails, return one short failure summary.'
```

## Handling Duplicate Installations

If a task with the same name already exists, do not create a duplicate; use `edit` instead:

```bash
openclaw cron edit <job_id> \
  --every "6h" \
  --agent <main_agent> \
  --session isolated \
  --light-context \
  --no-deliver \
  --message 'Use the grix-update skill with {"mode":"check-and-apply","plugin_id":"grix","notify_on":"never","allow_restart":true}. If there is no update or the update succeeds, reply exactly NO_REPLY. If the install is unsupported or any step fails, return one short failure summary.'
```

## Verification Commands

```bash
openclaw cron list
openclaw cron status
openclaw cron runs --id <job_id> --limit 20
```

## Notes

1. `--session isolated`: Avoid updates and gateway restarts interrupting the current main chat.
2. `--no-deliver`: Do not send messages externally on success.
3. `notify_on=never`: In cron scenarios, do not let the skill send notifications on its own; let the cron run records handle convergence uniformly.
4. If failure alerting is needed later, it should be handled in the upper-level cron rules; do not embed notification logic back into the skill.
