Skip to content

bug: an interrupted update run self-reports as fresh and the no-op check then skips every retry #364

Description

What happens

Since #277 (merged), a run that fails mid-stream still persists openwiki/.last-update.json — deliberately, so content that was already generated stays diffable. But the metadata schema has no notion of how the run ended (updatedAt, command, gitHead, model only), so a crashed half-update is indistinguishable from a completed one.

The next openwiki --update (no user message) then runs getUpdateNoopStatus: clean worktree + HEAD === lastUpdate.gitHead"No repository changes detected since the last OpenWiki update; skipping agent run." The retry is silently skipped, and keeps being skipped until an unrelated commit lands in the repo.

Why it matters

A possibly partial wiki self-reports as fresh and locks itself in:

  1. Scheduled openwiki code --update --print crashes late (provider error, timeout) after writing some pages — metadata is persisted (per fix: persist .last-update.json when a run fails after generating content #277).
  2. Every subsequent scheduled run is a no-op skip.
  3. Consumers (coding agents pointed at the wiki via AGENTS.md/CLAUDE.md) read a half-written wiki whose .last-update.json carries a fresh updatedAt.

Expected

An interrupted run should be recorded as such, and the update no-op check should not skip while the last run is interrupted — while metadata written by older versions (no status field) keeps behaving as a completed run, so upgrades don't force spurious re-runs.

I have a tightly-scoped fix with regression tests ready — PR incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions