Skip to content

Reconcile worker instance backoff from State#2028

Open
AlexCheema wants to merge 1 commit into
codex/api-stream-reconcile-statefrom
codex/worker-backoff-reconcile-state
Open

Reconcile worker instance backoff from State#2028
AlexCheema wants to merge 1 commit into
codex/api-stream-reconcile-statefrom
codex/worker-backoff-reconcile-state

Conversation

@AlexCheema
Copy link
Copy Markdown
Contributor

Why

The worker still reset instance backoff by reacting directly to InstanceDeleted. With snapshot bootstrap, that deletion may already be reflected in State and the original event may not replay. The backoff cleanup should therefore reconcile from State.

How

  • Add KeyedBackoff.tracked_keys() so callers can inspect local backoff state without reaching into private fields.
  • Remove the worker InstanceDeleted event side effect.
  • Add a worker reconciliation loop that resets instance backoff for keys no longer present in state.instances.
  • Add focused tests for tracked_keys() and worker backoff reconciliation.

Tests

  • uv run pytest src/exo/utils/tests/test_keyed_backoff.py src/exo/worker/tests/unittests/test_worker_instance_backoff.py
  • uv run pytest
  • uv run ruff check src/exo/utils/keyed_backoff.py src/exo/utils/tests/test_keyed_backoff.py src/exo/worker/main.py src/exo/worker/tests/unittests/test_worker_instance_backoff.py
  • uv run basedpyright
  • nix fmt

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