Repository navigation
fix(gateway): retire ownerless requested placements - #124609
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 10:03 AM ET / 14:03 UTC. ClawSweeper reviewWhat this changesThe PR lets Gateway reconciliation delete a requested worker-placement record when its session is gone and the record has neither environment ownership nor a turn claim. Merge readiness✅ Ready for maintainer review Keep open. The PR is a focused, source-proven Gateway cleanup that current main does not contain; no blocking correctness or security finding was identified. Its protected maintainer label and incomplete exact-head CI leave it for normal maintainer review. Priority: P2 Review scores
Verification
How this fits togetherGateway persists worker-placement lifecycle records for sessions and periodically reconciles rows whose session evidence is absent. This path either safely retires an ownerless record or preserves it for the dispatch and environment-teardown lifecycle. flowchart LR
A[Persisted session placement] --> B[Session evidence lookup]
B --> C{Session absent?}
C -->|no| D[Keep placement]
C -->|yes| E{No claim or environment owner?}
E -->|yes| F[Exact guarded retirement]
E -->|no| G[Dispatch or teardown lifecycle]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -2, Tests +53. Total +51 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Retain the single retirement path: permit only absent-session requested records with no ownership to reach the store’s existing exact compare-and-swap deletion guard. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: an absent-session record created by Is this the best way to solve the issue? Yes. Extending the canonical store allowlist and retirement decision preserves the existing claim, generation, provisioning, and environment-teardown ownership boundaries instead of adding a cleanup side path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7f842da4bd45. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Land-ready proof: absent-session Production: +19/-21 (net -2). Tests: +54/-1. |
|
Merged via squash.
|
* fix(gateway): retire ownerless requested placements * fix(gateway): bind placement retirement test methods
What Problem This Solves
Periodic placement retirement skipped requested placement rows forever when their session was absent and they had neither a turn claim nor an environment assignment. Those ownerless rows could therefore remain in the placement store indefinitely.
Why This Change Was Made
The canonical retirement path now retires no-environment ownerless records. The placement store allowlist admits only requested placements plus the existing safe terminal and local states, preserving environment teardown requirements and the exact compare-and-swap checks on state and generation.
User Impact
Stale requested placements whose sessions have disappeared are now cleaned up by periodic reconciliation instead of accumulating indefinitely. Placements with live environment ownership continue through the existing teardown path.
Evidence