Skip to content

Zombie job records accumulate in state.json until SessionEnd #15

Closed

Description

@JohnnyVicious

Summary

Related to but distinct from the dead-PID detection gap: plugins/opencode/scripts/lib/state.mjs caps at MAX_JOBS = 50, pruning by updatedAt. A crashed job whose status is still "running" has a fresh-looking updatedAt from when it last reported progress, so it survives pruning and occupies a slot. Over a long session this leads to the /opencode:status "running" list filling with zombies while real completed jobs get pruned first.

Unlike codex-plugin-cc, opencode-plugin-cc does not currently block new tasks on the presence of a running job (no resolveLatestTrackedTaskThread guard in handleTask), so the impact is lower than the upstream report — but the state file still drifts.

Suggested fix

  1. Pair this with the dead-PID check in issue-to-be-filed (#164-equivalent) so zombies get demoted to failed in enrichJob / buildStatusSnapshot before pruning runs.
  2. Consider a separate "zombie sweep" pass inside upsertJob that checks every running row's PID when the state is rewritten.

Upstream reference

Derived from openai/codex-plugin-cc#202.

Activity

  1. JohnnyVicious commented on Apr 12, 2026

    @JohnnyVicious
    OwnerAuthor

    Consolidated into #14. Zombie accumulation is a symptom of missing dead-PID reconciliation and should be fixed under the canonical job reconciliation issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions