Originally created by: Akarsh-Hegde
await_coding_ready capped its wait with Instant::now() + CODING_MAX_WAIT — a process-relative deadline. Every daemon restart therefore restarts the 20-minute wait from zero, so a daemon that restarts more often than CODING_MAX_WAIT never reaches the cap and the hour is never processed at all.
This is now anchored to the hour's end in wall-clock: hour_end + CODING_MAX_WAIT against Utc::now(). The wait survives restarts, and an hour already past its cap (a backlog after downtime) proceeds best-effort immediately instead of buying a fresh 20 minutes on every attempt.
Observed live on this dev machine: cargo-watch restarting the daemon on every source save produced 13 restarts in ~5 minutes, exactly one distill, and the timeline frozen at noon for ~3 hours. A crash loop or a run of updates does the same in production. ledger.rs already documents the intended semantics — the aging escape fires "if an hour has been over for longer than the aging window" — i.e. anchored to the hour being over, not to when the daemon booted. This makes the code do what it already claims.
run_hour (distil + LLM calls) is still SIGKILLed by a restart mid-generation; surviving that is a separate concern.Ready rather than stalling the hour, matching the module's existing "never block the worklog on a bad read" posture.Three unit tests on the extracted pure coding_deadline(he): anchored-to-hour-end (and stable across calls), stale-hour deadline is already in the past, unparseable bound → None. cargo fmt, clippy -D warnings, and the full worklog_pipeline suite pass.
Base is feat/llm-provider-connectivity-test per request, to land the fix in the branch the dev app currently builds. The fix is independent of the LLM-provider work; a sibling branch (fix/worklog-coding-wait-deadline) carries the same commit for a clean pre-main PR.
🤖 Generated with Claude Code
Originally posted by: coderabbitai[bot]
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `fix/worklog-coding-deadline-on-llm`Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands.Ticket changed by: Akarsh-Hegde