Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 435617a0ee
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!fs.existsSync(resolveReservedJobFile(workspaceRoot, explicitJobId))) { | ||
| throw new Error( | ||
| `Claude Code job id ${explicitJobId} is not reserved. Reserve one with the companion reserve-job helper before reusing it.` |
There was a problem hiding this comment.
Claim reserved job IDs atomically before launching work
resolveExplicitJobId only checks existsSync on the reservation marker, and the marker is removed later in a separate step, so two concurrent invocations using the same --job-id can both pass this check before either one releases the reservation. In that race, both runs proceed with the same job id and can overwrite the same job record/log files, which breaks result routing for background jobs and retries. Reservation consumption should be atomic (single-writer claim) rather than a check-then-use pattern.
Useful? React with 👍 / 👎.
Summary
Verification