Repository navigation
refactor: consolidate measured runtime clone owners - #180552
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 replaces duplicated parsing, bounded stream reading, error aggregation, and diagnostic construction with existing shared operations. Example: Gravatar returns a chunked avatar larger than 1,000,000 bytes.
Review scores
ProductKind: Refactor · Worth it: Yes Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored refactor consolidates existing runtime owners, and no actionable introduced defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway handlers, agent tools, CLI commands, and bundled plugins consume external bytes and runtime results, then produce bounded payloads, diagnostics, or settled lifecycle outcomes. flowchart TD
A[CLI and Gateway requests] --> B[Runtime and plugin owners]
B --> C[Shared parsing and validation]
B --> D[Bounded stream readers]
B --> E[Lifecycle error aggregation]
C --> F[Results and diagnostics]
D --> F
E --> F
Technical reviewBest possible solution: Retain the existing-owner consolidation and the explicitly accepted cancellation tradeoffs, subject to the normal exact-head CI gate. Do we have a high-confidence way to reproduce the issue? This is a refactor rather than a reported bug; source inspection verified the affected contracts, and no target code or tests were executed during this read-only review. Is this the best way to solve the issue? Reusing the existing readers, normalization helpers, and error owners is appropriate; the diff removes replaced paths without introducing competing state or public APIs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eee5efec4249. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -261, Tests +320, Other -3. Total +56 across 55 files. Added test files: 2. 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 22, 2026, 7:53 AM ET / 11:53 UTC. |
|
Merged via squash auto-merge.
|
* refactor: consolidate measured runtime clone owners * chore: shrink assertion allowances after clone cuts
What Problem This Solves
Runtime and bundled plugins repeat bounded body readers, JSON parsing, error aggregation, finding reporting, cache TTL preparation, and account diagnostics despite existing owners.
User Impact
No intended user-visible change. Byte limits, validation order, error messages and identities, cancellation, authority, cache scope, and shutdown settlement remain protected.
Why This Change Was Made
Use existing normalization, byte-stream, HTTP-body, error and weak-owner-map operations. Put repeated media parameter preparation and Doctor finding reporting in their existing owners. Consolidate plugin-local diagnostic construction and install-source planning without crossing plugin-private boundaries.
This is the runtime/plugin area slice of a measured 409-net-line cleanup spanning 95 files. The campaign's wide-change rule requires splitting by area; this slice removes 261 net production lines across 39 production files (55 files including tests and a shrink-only assertion baseline repair; 320 net test lines added). The UI slice is #180536. No new SDK export, config key, schema, protocol, dependency, locale, or Phase E memory-backend change.
Best-effort tradeoffs accepted
Other changes share existing behavior rather than removing guards. Marketplace keeps lazy reader acquisition, bounded staging and awaited outer cleanup. Native hook relay passes the request's native async iterator to preserve overflow socket closure. Error helpers retain zero/single/aggregate shapes and original failure order; security, durability and write settlement are unchanged.
Evidence
The first exact-head CI run 39769638063 correctly rejected four stale assertion-safety allowances in changed paths. The repair only shrinks those entries (xAI web search 2 to 0, capability web 5 to 3, log parsing 1 to 0, Claude invocation 1 to 0). The native assertion ratchet now passes: 2,469 files / 5,649 grandfathered assertions. Fresh independent review of this repair is scoped-clean P0–P2. The suppression audit was repeated and retains the same three unchanged-path inventory failures below. No production code, test, suppression or allowance was broadened to repair CI; the new exact head receives fresh hosted proof.
Fresh-main area formatting, targeted native core/plugin typechecks and both typed-lint passes passed. All 15 changed test files passed (170 seconds serially), as did selected websocket upgrade-error/body-cap, actual Claude CLI output truncation, and PR wrapper/import-closure tests. Runtime and static import cycles are both zero. Independent full-area review found no actionable P0–P2 issue. No new lint suppression.
The local suppression-inventory audit still fails with three unexpected entries in unchanged paths:
src/cron/store/job-mutations.ts|unicorn/prefer-structured-clone|1,src/transcripts/library.query-budget.test-support.ts|typescript/unbound-method|1, andui/src/pages/sessions/view.tsx|typescript/only-throw-error|1. A serial replay on exact clean base4d270d3bfd708be964b39558cb02b038380cc4f0reproduced the exact Expected/Received block (head 4.7 seconds, base 6.5 seconds). No baseline or test is weakened. This local failure is not a hosted-CI waiver.Earlier packet proofs cover affected sibling owners, including TypeSafe native cancellation/release, media limits, cache TTL, install-source selection, Doctor finding order, readonly-worker cleanup and session settlement. Current production bytes match those packet receipts except gateway-client's preserved newer main timer cleanup; its upgrade-error boundary is re-proved separately. No broad local suite/build/live-provider or E2E claim. Exact-head PR CI is the broad gate.