Problem
After a daemon crash or restart, jobs lose all context of what they were doing. The next run starts cold with no knowledge of whether the previous run succeeded, what it produced, or when it last ran.
Proposed solution
Add lastResult and lastRanAt fields per job in state.json:
{
"jobs": [{
"name": "morning-brief",
"nextAt": 1234567890,
"lastResult": "ok",
"lastRanAt": 1234567000
}]
}
lastResult: "ok" | "error" | "skipped"
lastRanAt: Unix timestamp of last completion
The heartbeat prompt can reference lastResult to avoid re-doing completed work after a restart. No breaking changes — fields are additive.
Source
Requested by @Nibbler1250 in #14 (Mega-Post).
Problem
After a daemon crash or restart, jobs lose all context of what they were doing. The next run starts cold with no knowledge of whether the previous run succeeded, what it produced, or when it last ran.
Proposed solution
Add
lastResultandlastRanAtfields per job instate.json:{ "jobs": [{ "name": "morning-brief", "nextAt": 1234567890, "lastResult": "ok", "lastRanAt": 1234567000 }] }lastResult:"ok"|"error"|"skipped"lastRanAt: Unix timestamp of last completionThe heartbeat prompt can reference
lastResultto avoid re-doing completed work after a restart. No breaking changes — fields are additive.Source
Requested by @Nibbler1250 in #14 (Mega-Post).