DeLoDocs Watchdog Recovery
Use this when the vault automation looks superficially healthy but the Inbox is not draining:
delodocs-inbox-watchdog.serviceis active- router logs keep saying
pipeline-status is new - watchdog state shows many files at
status: failedwithattempts: 3 - a provider/model/key fix was already applied, but stuck files still do not retry
This skill is specifically for the recovery path after root auth/model problems are fixed.
Trigger signals
Reach for this skill when any of these are true:
- Current
Inbox/*.mdfiles still containpipeline-status: [new] ~/.local/state/delodocs/inbox-watchdog/state.jsonshows current Inbox files withstatus: failed- Resetting state on disk seems to work temporarily, then reverts back to stale failures
- A one-shot watchdog run says another watchdog is already running because the service lock file exists
Core diagnosis
The watchdog is stateful in two places at once:
- on disk:
~/.local/state/delodocs/inbox-watchdog/state.json - in memory: the running watchdog process
The dangerous failure mode is:
- old watchdog process loads stale failed state into memory
- operator edits
state.jsonon disk to reset stuck files - running watchdog continues with its old in-memory copy
- running watchdog writes the stale failure state back to disk
- it looks like the reset "didn't stick"
This is why a reset must be coordinated with service lifecycle.
Recovery rule
Do NOT reset stuck entries while the watchdog service is still running. Stop it first, repair state, run a backfill, then start it again.
Known-good recovery sequence
1. Stop the service
systemctl --user stop delodocs-inbox-watchdog.service
2. Back up state first
cp ~/.local/state/delodocs/inbox-watchdog/state.json \
~/.local/state/delodocs/inbox-watchdog/state.json.bak-$(date -u +%Y%m%dT%H%M%SZ)
3. Reset only the current stuck Inbox files
Target: current Inbox/*.md files that still have pipeline-status: [new].
For each such file entry in state.json:
- set
statustopending - set
attemptsto0 - update
size,mtime_ns,sha256,last_seen_at,last_changed_at - clear these fields if present:
processed_sha256processed_atlast_errorlast_attempt_atenrichment_policy_versionenrichment_policy_sha256enrichment_policy_atlast_outputmissing_at
If a current Inbox file is absent from watchdog state entirely, create a fresh entry with:
first_seen_atlast_seen_atlast_changed_atsizemtime_nssha256status: pendingattempts: 0
Why all this clearing matters:
- clearing only
attemptsis not enough - if
processed_sha256 == sha256, the watchdog can still skip the file
4. Run a one-shot backfill while the service is stopped
python3 _vault/scripts/inbox_watchdog.py \
--vault "$PWD" \
--state "$HOME/.local/state/delodocs/inbox-watchdog/state.json" \
--scan-existing \
--once
Useful tweak during manual recovery:
python3 _vault/scripts/inbox_watchdog.py \
--vault "$PWD" \
--state "$HOME/.local/state/delodocs/inbox-watchdog/state.json" \
--scan-existing \
--debounce 0 \
--once
5. Start the service again
systemctl --user start delodocs-inbox-watchdog.service
6. Verify progress
Check that:
- current Inbox files are no longer all
failed - router logs stop accumulating
pipeline-status is newholds for those files - watchdog logs show actual processing rather than only
no ready files
OpenRouter auth source for this vault
The intended runtime for the watchdog is:
- provider:
openrouter - model:
deepseek/deepseek-v4-flash - key source:
opg openrouter hermes
Important pitfall:
opgis a shell function, not a standalone binary- non-interactive contexts must source the helper file first
Known-good pattern:
zsh -fc 'source ~/.config/zshyzsh/helpers.zsh; opg openrouter hermes'
This matters for repo-local env files or shell startup files that export OPENROUTER_API_KEY.
Verification checklist
After recovery, confirm all of the following before declaring success:
systemctl --user show delodocs-inbox-watchdog.service -p ExecMainPID -p ActiveEnterTimestamp --valueshows a fresh process if you restarted it- current Inbox file status counts in watchdog state are no longer dominated by
failed - router state/logs show movement or at least fewer
heldentries caused bypipeline-status is new - a direct Hermes OpenRouter call works with the repo-local config
Relationship to other skills
- Use
delodocs-vault-pipelinefor overall pipeline architecture and first-pass diagnosis - Use this skill for the specific recovery path where stale watchdog state survives a provider/auth fix