Skip to content

Keep retry dispatch fresh without leaking claims - #110

Merged
frantic-openai merged 2 commits into
mainfrom
codex/fix-retry-claim-leak
Jul 20, 2026
Merged

Keep retry dispatch fresh without leaking claims#110
frantic-openai merged 2 commits into
mainfrom
codex/fix-retry-claim-leak

Conversation

@frantic-openai

@frantic-openai frantic-openai commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Context

A retry performs a fresh by-id lookup, then dispatch revalidates before starting work. If that second read missed or went stale, the popped retry could stay claimed forever; bypassing it instead could dispatch stale work.

TL;DR

Keep dispatch-time freshness and let retries release or reschedule from its outcome.

Summary

  • Preserve dispatch-time issue revalidation for retried work.
  • Release the retry claim when the second refresh is missing or stale.
  • Reschedule rather than drop the claim when dispatch-time refresh errors.
  • Add a regression proving a missing second read cannot dispatch stale work or strand a claim.

Alternatives

  • Reusing the first retry lookup was smaller but reopened a stale-dispatch window.

Test Plan

  • HEX_HOME=/private/tmp/symphony-hex mise exec -- make -C elixir all
  • mise exec -- mix test test/symphony_elixir/core_test.exs:875
  • mise exec -- mix test test/symphony_elixir/core_test.exs

frantic-openai and others added 2 commits July 20, 2026 14:26
Summary:
- Dispatch retry attempts from the issue fetched by the retry handler.
- Add a regression for a retry whose redundant second read disappears.

Rationale:
- The retry lookup is already a fresh by-id read immediately before
  dispatch.
- Reading again could skip dispatch after the retry entry was popped,
  leaving the issue claimed with no running task or future retry.

Tests:
- mise exec -- mix test test/symphony_elixir/core_test.exs:875
- mise exec -- mix test test/symphony_elixir/core_test.exs
- mise exec -- mix test test/symphony_elixir/orchestrator_status_test.exs
- HEX_HOME=/private/tmp/symphony-hex mise exec -- make -C elixir all

Co-authored-by: Codex <codex@openai.com>
Summary:
- Preserve dispatch-time issue revalidation for retried work.
- Release retry claims when the second refresh is missing or stale.
- Reschedule retries when dispatch-time refresh fails.

Rationale:
- Reusing the first retry poll fixed a claim leak but could dispatch an issue
  that disappeared or became ineligible before work started.
- The retry handler needs the revalidation outcome so it can release or retry
  instead of silently keeping the claim.

Tests:
- red/green retry dispatch revalidation regression
- mise exec -- mix test test/symphony_elixir/core_test.exs
- HEX_HOME=/private/tmp/symphony-hex mise exec -- make -C elixir all

Co-authored-by: Codex <codex@openai.com>
@frantic-openai frantic-openai changed the title Reuse refreshed issues when dispatching retries Keep retry dispatch fresh without leaking claims Jul 20, 2026
@frantic-openai
frantic-openai merged commit 0517275 into main Jul 20, 2026
3 checks passed
@frantic-openai
frantic-openai deleted the codex/fix-retry-claim-leak branch July 20, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant