Skip to content

fix(revive): double --resume flag when revive + session_persist are both active #119

@CoreyRDean

Description

@CoreyRDean

Follow-up from Codex review on PR #56 (P2, lib/run-job.sh:469).

Problem

Revive injects `--resume <session_id>` from the revive override file (line ~188 after commit a408508). The existing session-persistence block later appends another `--resume` when the job has `session_persist: true` and a `.session-id` file exists.

Result: the `claude` command gets two `--resume` flags on revive runs for session-persistent jobs. Behavior is undefined — last-flag-wins would pick the stale persisted session, losing the explicit tombstone session the user is trying to revive.

Fix

The revive override takes precedence. When `REVIVE_SESSION_ID` is set, skip the session_persist `--resume` append entirely. A guard like:

```sh
if [ -z "$REVIVE_SESSION_ID" ] && [ -n "$SESSION_PERSIST" ] && [ -f "$SESSION_ID_FILE" ]; then
CLAUDE_ARGS=("--resume" "$(cat $SESSION_ID_FILE)" "${CLAUDE_ARGS[@]}")
fi
```

(Adjust to match actual variable names in the file.)

Acceptance

  • Revive of a `session_persist: true` job produces exactly one `--resume` flag in the `claude` invocation.
  • Revived session matches the tombstone's session_id, not the persisted session file.
  • Test covering: (a) revive of session_persist job, (b) revive of non-session_persist job, (c) normal run of session_persist job (no revive).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions