Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused changes preserve cursor positions and prevent stale ID replay, with regression coverage and no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes deleted rollout IDs reappearing in terminal results while preserving existing pagination cursors, avoiding the index shifts proposed in #547.
Changes:
- Uses tombstones and an ID-to-index map for constant-time deletion without shifting cursors.
- Adds regression coverage for deletion, ID reuse, and cursor stability.
| File | Description |
|---|---|
| tests/server/test_endpoints.py | Tests deletion, recreation, and stable completion cursors. |
| tests/server/conftest.py | Clears the new index between tests. |
| agentlightning/server/store.py | Defines tombstone-capable storage and the completion index. |
| agentlightning/server/routes/rollouts.py | Maintains the index and skips deleted completion entries. |
Review effort: Balanced
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deleting a completed rollout leaves its ID in the completion log. Re-enqueueing the same client-assigned ID then makes
/api/rollouts/terminalreturn aqueuingrollout; completing it adds a second entry for the same new rollout.Replace deleted completion entries with tombstones, keeping the existing index-based cursors stable. A live ID-to-index map keeps deletion constant-time instead of rescanning the growing completion log. Wire response fields and pagination semantics stay the same.
Related: #547. That PR removes entries from the list, shifting positions underneath existing cursors. This alternative preserves those positions; its API regression also verifies that a cursor obtained before deletion still returns the next surviving completion. It covers recreation, exclusion before completion, and exactly one new completion after recreation.
Validation:
main: a newly queued rollout appears in the terminal page.uv run --locked --no-sync pytest -q tests/server— 33 passed.Prepared with Codex AI assistance; the diff and before/after regression results were checked locally. No model service or GPU is needed for these tests.