Repository navigation
refactor(gateway): reuse live-text receipt map allocation - #178019
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. |
Security-sensitive guard clearedCurrent revision: This PR no longer changes files in the maintainer security-review tier. Separate CODEOWNERS requirements still apply to security policy and enforcement files. |
|
Codex review: needs maintainer review before merge. What this changesThis PR consolidates nested Map allocation into the existing Map utility and removes replaced helpers. Example: Two Models page requests use different provider sets for the same agent.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed refactor removes duplicated allocation code without changing caller behavior; no actionable code or security findings were identified. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway, agent, plugin, and worker owners pass their existing Map or WeakMap and owner key to a dependency-free utility, which returns the existing inner Map or allocates one. flowchart TD
A[Gateway and agent callers] --> C[Map allocation utility]
B[Plugin and worker callers] --> C
C --> D[Existing Map or WeakMap]
D --> E[Owner scoped inner Map]
E --> F[Caller managed entries and lifecycle]
Technical reviewBest possible solution: Retain the shared allocation operation in the existing utility while keeping keys, authorization, eviction, and cleanup with their current callers. Do we have a high-confidence way to reproduce the issue? This is a behavior-preserving refactor rather than a reported runtime defect; source inspection confirms repeated allocation blocks, and no target code was executed. Is this the best way to solve the issue? The change uses an existing dependency-free owner, removes replaced paths, and preserves native key identity without adding state or public contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9970230915c8. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -139, Tests +7. Total -132 across 45 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 20, 2026, 12:24 AM ET / 04:24 UTC. |
a01e27b to
38ee757
Compare
|
Merged via squash.
|
Problem
The Gateway's live-text receipt path repeats the existing object-owner inner-map allocation helper.
What changed
Use the existing
getOrCreateWeakOwnerMapowner for that allocation. Receipt publication, pairing checks, current-publication checks, ordering and settlement remain in place. No new helper, SDK export, configuration, schema or protocol change remains.This is the retained area fragment after the campaign's mandatory CI-attribution repair, not the original 139-line cleanup. The original wider cut is preserved on
deslop/z33-parked-skill-snapshot-map-20261015ata01e27ba228fb0b1f86e8e29384bf73a052348a4without a separate PR. The initial family plus its disjoint accumulator exceeded 80 paths and was split by area; the failed-test slice is now parked rather than counted as landed savings.Best-effort tradeoffs accepted
None in this retained slice. No guard, timeout, authorization boundary, durability behavior or recovery guarantee is removed.
Size
One production file: 2 lines added, 5 removed; 3 net production lines removed. No test changes.
Proof
All 41 focused cases across four files passed, including the 23-case Gateway consumer, the existing WeakMap owner, all three wrapper/import-closure entrypoints, and the 14-case suppression audit. Targeted native typecheck of four explicit roots, typed lint, formatting, zero runtime/static cycles, and the staged changed-check planner dry run passed. Every proof receipt matches the current production source hash. No broad local suite or whole-graph typecheck ran.
The original exact-head CI run
39367982787failedchecks-node-changed-compact-large-12(118449540029) onsrc/skills/runtime/session-snapshot-content.test.ts, “ignores losing skill edits but refreshes when the precedence winner disappears,” with a worker-task timeout. Its downstream CI gate also failed. The failure report was UNKNOWN, not inherited; the coordinator flake list and the last six completed scheduled main runs did not establish a matching signature.One serial focused pinned-Bun replay of the seven-case file passed on the original head and on the captured main baseline. That is inconclusive, not a fix or inherited-failure proof. Following the campaign rule, all 41 changed files reachable through the conservative value/dynamic-import and named-worker graph now match fresh main. The extra worker edge was traced through the shared-state read-worker registry; declaration-resolution gaps are retained as a diagnostic limitation, not claimed absent. Remaining cost-neutral Map extractions and their proposed helper were also removed during simplification. Only the independent Gateway receipt-map reuse remains. The original 12-file CI shard was not replayed locally; exact-head PR CI supplies broad proof.
Independent P0–P2 review of the pre-simplification superset completed scoped-clean; the final subtractive simplification reuses the existing helper with the identical reviewed get/allocate/set body. No new runtime algorithm was added afterward.