Repository navigation
refactor(providers): share catalog facts and JSON response ownership - #173375
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: blocked before merge. What this changesThis PR shares admitted provider catalogs, centralizes JSON response cleanup, and removes repeated internal parsing across provider and Codex paths. Example: MiniMax submits a video-generation task and then polls its status.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: the maintainer-directed consolidation follows the documented ownership contracts, and source review found no concrete introduced bug. Priority: P3 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherProvider plugins supply catalogs and make guarded HTTP requests; the SDK and Codex bridge turn their results into model selections, session listings, and turn outcomes. flowchart TD
A[Provider plugins] --> B[Shared provider SDK]
B --> C[Guarded HTTP transport]
C --> D[Bounded JSON response]
D --> A
E[Codex app server] --> F[Notification and catalog admission]
F --> G[Session and turn projections]
Technical reviewBest possible solution: Keep one guarded JSON response owner and pass admitted catalog and notification facts through their existing consumers without repeated validation. Do we have a high-confidence way to reproduce the issue? This PR proposes a refactor rather than reporting a failing user scenario; inspection found no concrete introduced failure, and no target execution was performed. Is this the best way to solve the issue? Centralizing status/read/release ownership and trusting admitted internal values fits the repository's existing contracts and avoids a competing implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 071c4ad0a4e1. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. 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 15, 2026, 2:33 PM ET / 18:33 UTC. |
…penclaw#173375) * refactor(providers): share admitted facts and JSON response ownership * fix(providers): preserve cleanup boundary contracts * fix(codex): retain previews at native admission
What Problem This Solves
Provider implementations repeatedly copy admitted catalogs, parse the same internal facts, and duplicate JSON-submission response ownership.
User Impact
No intended user-visible change, migration, or configuration change. Provider requests, diagnostics, public permissive parsers, credential checks, and ordinary concurrent session/shutdown behavior remain supported.
Why This Change Was Made
One existing provider HTTP seam now owns JSON submission, status handling, bounded response reading, and transport release for fourteen provider paths. Provider-specific endpoints, labels, timeout policies, polling, and downloads remain local.
Admitted catalogs and static declarations pass by reference instead of being defensively reconstructed. NVIDIA projects remote listings once before caching. Codex prepares terminal notifications once before router/projector fan-out, carries catalog DTOs through worker dispatch, parses native subagent completions and delivery receipts together, and shares the native-history predecessor check. Typed configuration/context facts remain typed through their consumers.
Net production reduction: 574 lines (1,386 added / 1,960 removed across 147 production files), excluding tests, fixtures, support modules, generated files, declarations, and documentation. This is the final 500–999-line honest-pass exception, not a partial first scan.
Best-effort tradeoffs accepted
unknown. Actual network/plugin settings, generic JSON variants, model output, and authored configuration still retain their boundary admission.f53346944db(feat: correlate native search outcomes in audit history #98704), which does not cite a human abort-getter incident requiring that swallow; an exotic getter now fails visibly. The test solely pinning that containment is retired; ordinary abort, private observer, security, and settlement tests remain.Evidence
resolveBedrockRuntimeAuthreadsprocess.envbefore that branch. The complete first CI repair review and the final two-file generic-preview correction review are clean through P2. Hosted tests caught the overbroad preview omission missed by the earlier review, and that entire production hunk is dropped rather than weakening the unchanged metadata/client assertions.check:changedwas stopped after its SQLite worker ratchet consumed 1,454 seconds; no database behavior changed. Its owned line-cap/assertion findings are repaired, while two stale max-lines allowances name files unchanged by this PR. Exact-head hosted CI remains the broad gate.c35dcdd80693e99277eec0fb6752d1aa93076d83to candidatedf833852801f8d2e727efd21888115dfdf8a2858(digestff7b090f). Blacksmith Testboxtbx_01m50phr1w3kex9qyqyt509zmh, control-plane run 38808094929, rendered both revisions and finalized the JSON/Markdown report. Payload completed in 16m24.818s on measured 4 CPUs / approximately 16 GB RAM. The wrapper returned 1 only during post-proof settlement, after transferring the report; the lease is independently verified completed and its control-plane run is terminal/cancelled. Local per-file timings are recorded by the focused runner (the unchanged packaged-discovery integration case took 87 seconds under host load).check-plugin-extension-import-boundaryandcheck-extension-plugin-sdk-boundary --allowners were used instead. The eager/PR import-closure assertions pass; the pre-push tooling selection passed 24 tests across three files.Old-head CI attribution (run 38784047744, head
45bb51dc39f2bd90c9df1aca830c00e92c0de409):All listed failures are PR-owned, not inherited-red claims. The old-head aggregate CI gate reflects these failures. No hosted job was rerun; the first fixes were batched at
2219f8bb454573e50cbf8a65a06c8cb9aaec2e23. On that head, run 38790597977 additionally failed bundles 5-1 (client preview/worker decoding) and 6-3 (catalog metadata events): the first repair's source-visibility filter dropped legitimate generic previews whensourcewas absent or noninteractive. The entire filter/import is dropped, retaining the unchanged client/event/preview-transition assertions. The resident cache and its measured no-reparse benefit (#150659) remain; only the impossible decoded-JSON throwing-getter fixture is replaced by direct visible/hidden no-sanitize checks.The final two-file correction is signed and pushed at
df833852801f8d2e727efd21888115dfdf8a2858; its fresh review, targeted types, lint, format, diff, two-file line-cap and three-test suppression proof pass. Earlier expanded types, runtime/Madge cycles (both zero), assertion safety and 199-file line-cap pass. The mock baseline canonically shrank from 9,553 to 9,549 exact factories. The final correction only removes an import edge, so cycle proof remains valid. Exact-head hosted CI run 38793616373 completed successfully with no failed jobs. The final catalog replay exited zero; dependency review, sensitive-product review andopenclaw/ci-gateall report success. The full SDK API comparison also passes with no changes. No hosted rerun or inherited-red/admin exception was used.Inventory and retained ownership
The lane ledger covers all 4,249 original mandatory inventory hits in 655 files, correcting eight support-only exclusions. Every candidate is implemented or has a source-backed KEEP decision; no concrete deletion remains outstanding.
Repeated hook names are not automatically repeated policy. Provider-specific Doctor migrations remain with their provider, sharing the existing generic migration owner. Thinking/fast-mode implementations already use the effort/Claude/Gemini owners where semantics match; vendor model availability, mandatory thinking, auth, and effort vocabulary remain distinct. URL/config normalizers retain distinct endpoint/default/loaded-versus-lazy contracts rather than gaining a central vendor switch or convenience wrapper.
Explicitly retained: public LM Studio configured-catalog and xAI runtime-compat parsers; external raw/native/persisted validation; live credential/tool authority; genuine bounded resources; normal desktop/client update ownership; ordinary parallel sessions/tools; accepted-write settlement and durable transcripts. The standalone Phase E session-memory backend and its factory, registry, expiry, federation, and tests are untouched. No schema, durability, retention, permission, dependency, or protocol-shape change is intended.