Repository navigation
refactor: consolidate duplicate HTTP, voice, and catalog adapters - #169756
Conversation
Share HTTP execution, realtime WebSocket transport, provider selection, catalog activity, hosted media, and UI request lifecycle while retaining adapter-specific contracts. Clear stale returned MCP errors after successful configuration retries to match persisted state.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
Campaign inherited-failure landing evidence for exact head Enumerated all 240 check runs with the paginated commits/check-runs API immediately before landing. Every product build/test/type/lint/security check completed; no product suite was canceled. There are exactly two failed jobs:
Main was corrected during this run by Canceled ancillary jobs are not claimed as passing test proof. They only run PR metadata/comment automation; the inspected workflows contain no product test/build suite. Their missing metadata coverage has successful exact-head successors:
Security-sensitive review and dependency review both succeeded. Independent full-candidate and final follow-up reviews found no actionable P0–P2 issue. Local final-source production types, focused lint/tests, suppression checks, runtime cycles (0), Madge (0), and SDK API comparison passed; the PR body retains the broader local-proof gaps. Net production reduction is 681 lines, under the campaign's documented 500–999-line exception after the extended implementation pass. Using Peter's standing inherited-only-red admin exception, pinned to the exact reviewed head. This is not a claim that CI was fully green. |
…enclaw#169756) * refactor: consolidate duplicated icons and provider helpers * refactor: consolidate HTTP and provider runtime owners Share HTTP execution, realtime WebSocket transport, provider selection, catalog activity, hosted media, and UI request lifecycle while retaining adapter-specific contracts. Clear stale returned MCP errors after successful configuration retries to match persisted state. * refactor(gateway): isolate chat image input handling
What Problem This Solves
Maintainer-requested duplicate-code consolidation gives HTTP, realtime voice, and catalog adapters shared execution owners instead of parallel implementations that can drift.
Continues #169499 after its below-threshold closeout. GitHub refused to reopen that PR after the rebased branch update; this continuation contains only the remaining work and new approved-scope consolidations.
User Impact
Existing HTTP, voice, catalog, and media behavior stays intact. Successful MCP configuration retries no longer return stale failure text after the stored error has been cleared. No configuration, protocol, database schema, retention, permission, or dependency change is required.
Why This Change Was Made
The adapters now share OpenAI-compatible HTTP execution, OpenAI/xAI WebSocket transport, provider-selection preparation, UI set-request lifecycle, hosted-media request parsing, and bounded JSONL activity scanning. Vendor authentication, wire messages, transcript classification, stream-flush differences, resource bounds, and authorization remain with their existing owners. The retained branch also contains ACP catalog-adoption and TLS-preflight consolidation.
Net production reduction: 681 lines (+1,839/−2,520), excluding tests, fixtures, generated files, declaration files, documentation, and baseline maintenance. This uses the campaign's 500–999-line exception after the extended implementation pass; the coverage log below records rejected clusters. The former icon/usage-rendering changes are absent because #169367 already landed them.
Best-effort tradeoffs accepted
Evidence
ff7b090f); the follow-up only relocates private Gateway image handling and fixes import/shorthand lint. Final-head checks found zero runtime value cycles and zero Madge cycles.93fac510284f12c5a52f459bbbcf1691434d358d. Merged as2fc20b367b69df1c9dc52c88d85f100f8f203ef9, verified reachable on main with an exact reconstructed merge-tree match. Hosted run38223234952completed with 67 successful jobs, 20 inapplicable skips, and only the inherited inventory failure plus its aggregate gate failure. The documented campaign admin exception was used; CI is not claimed fully green.38223234952:checks-node-compact-small-3failed only the suppression inventory case because untouchedscripts/lib/managed-cleanup-handoff.mtsadds an unlisted Bunconnect({ fd })type suppression. The exact case reproduced on fresh main2b4c2a10bb419014419482a8c44e3d2925b83310(51.29-second wrapper; 19 entries versus 18 expected). The source, inventory owner, and test are byte-identical between CI parent14b24b111abe2cafefb5c5fc5a94b0d8a1924887, tested mergee6a4942a7b7393495d8a271072c69bc757fc9286, and that fresh main. This is a qualified inherited failure for the campaign's admin exception, subject to attribution of every remaining failed check. No inventory entry or suppression was added here.64f11ced232c7dfe0fe262767f707f90597abff3during the run; the merge retains that correction. All 240 exact-head check runs were enumerated before landing, including canceled ancillary automation with successful same-head successors. No product suite was canceled.Duplicate-cluster coverage and retained distinctions
Exact-token and normalized structural scans covered the coordinator-approved production scope, followed by an SDK-only plugin scan. Tests, fixtures, generated declarations, other live-lane areas, audit, changelog and PR tooling were excluded from implementation scope.
Provenance inspected includes #167775 and #115652 (HTTP/flush behavior), #117865 and #122414 (realtime lifecycle/bridge split), #169111 (async provider-selection counterpart), and #167925/#168656 (UI lifecycle/refresh bookkeeping). This is a structural cutover; no speculative race removal is claimed for those families.