Repository navigation
refactor(agents): keep media request identity with its operation - #177906
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR stores media request identity on the existing operation and removes the separate recent-start cache. Example: Repeat an identical image request for “draw a tree” 10 seconds after its detached generation succeeds.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the maintainer-directed refactor removes redundant bookkeeping without an identified correctness defect; exact-head CI remains pending. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherImage, music, and video tools pass prepared request keys into detached media admission; the process-owned operation registry supplies scoped duplicate decisions and status while the existing completion machinery owns delivery. flowchart TD
A[Media tool request] --> B[Request preparation]
B --> C[Duplicate lookup]
C --> D[Scoped operation registry]
C --> E[Detached admission]
E --> D
E --> F[Provider work and completion delivery]
Technical reviewBest possible solution: Keep request identity and expiry with the existing media operation owner and let exact-head CI finish. Do we have a high-confidence way to reproduce the issue? This PR addresses redundant internal ownership rather than a reported user failure; source confirms the separate cache exists on fetched main, and no target code was executed. Is this the best way to solve the issue? The change is a small, complete consolidation: existing operation lifetime and scope absorb request identity, while the replaced cache, recorder, pruning machinery, and test publication are removed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0583592c9e81. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -171, Tests -78, Other -1. Total -250 across 12 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 19, 2026, 9:23 PM ET / October 20, 2026, 01:23 UTC. |
|
Merged via squash auto-merge.
|
What Problem This Solves
Media duplicate detection maintains a second request-start cache and joins it back to operations that already own the same work and completion lifetime.
User Impact
No intended user-visible change. Duplicate paid generation is still blocked, different requests remain independent, and recently completed detached work is reused for two minutes. No migration or operator action is needed.
Why This Change Was Made
Keep request identity on the existing process-owned media operation, at the same detached-only admission call site. Remove the parallel recent-start map, matching and pruning machinery, recorder, and production test-global publication. Operation retention is now the only completion-expiry clock. Status projections still select their public fields explicitly; request identity is not exposed.
Production delta: 17 added, 188 removed; 171 net lines removed, three production files. This is a completed-owner residue under the campaign's 100+ waiver, not a large-PR claim. Security/lifecycle authority, paid-call suppression, blocked-result retention, completion delivery and resource settlement remain intact. The obsolete assertion allowance is removed rather than retained as spare budget.
Best-effort tradeoffs accepted
When equivalent operations already coexist, duplicate lookup prefers a matching running/queued operation before an older successful completion. It still prevents another provider call. No security, durability or paid-call guard is removed. The removed cache was only request metadata joined back to the retained native owner (structural provenance #84006); it could never restore retired work. No human incident is claimed as provenance for a speculative guard removal.
Evidence
Exact-head hosted CI is the broad gate. No whole-graph typecheck, whole test suite, build or live-provider result is claimed.