Skip to content

Allow Phase 2 memory claims after retry exhaustion#19809

Merged
jif-oai merged 1 commit intomainfrom
jif/fix-concurrency
Apr 27, 2026
Merged

Allow Phase 2 memory claims after retry exhaustion#19809
jif-oai merged 1 commit intomainfrom
jif/fix-concurrency

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented Apr 27, 2026

Why

The Phase 2 memories job row is only the global lock for the git-backed memory workspace. Manual memory edits do not enqueue new Stage 1 work, so a Phase 2 row with retry_remaining = 0 could be skipped before the worker ever claimed the lock and generated phase2_workspace_diff.md.

That left workspace-only changes unconsolidated after repeated failures, even when retry backoff had elapsed and the filesystem had real diffable work.

What Changed

  • Allow try_claim_global_phase2_job to claim the Phase 2 lock after the retry budget is exhausted, while still respecting active retry_at backoff and fresh running leases.
  • Treat SkippedRetryUnavailable for Phase 2 as backoff-only, and update the outcome docs to match.
  • Clamp Phase 2 retry bookkeeping at zero when failed attempts are recorded.

Verification

  • Added phase2_global_lock_can_be_claimed_after_retry_budget_is_exhausted to cover the exhausted-budget lock claim path.
  • Ran cargo test -p codex-state.

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Apr 27, 2026

@codex review

@jif-oai jif-oai changed the title fix: memories backoff Allow Phase 2 memory claims after retry exhaustion Apr 27, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Apr 27, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

@jif-oai jif-oai merged commit 5d314f3 into main Apr 27, 2026
24 of 25 checks passed
@jif-oai jif-oai deleted the jif/fix-concurrency branch April 27, 2026 12:58
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant