Skip to content

refactor(providers): remove redundant private runtime facades - #130212

Merged
steipete merged 2 commits into
mainfrom
codex/cleanup20k-provider-private-facades-20260826
Aug 26, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/cleanup20k-provider-private-facades-20260826

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Remove redundant private LM Studio and Google thinking facades while preserving every public named value/type export and provider initialization order.
  • Consolidate xAI search payload construction, config ownership, authentication dispatch, and calendar validation into their existing canonical owners without changing strict input errors, credential priority, cancellation, caching, or external-content provenance.
  • Update the retained changed-lanes fixtures to use an existing unique LM Studio module so targeted extension routing and the original nine-path batching assertions remain intact.

Production: +51/-184, net -133. Tests: +6/-6, net 0.

Validation

  • All 69 xAI, Google, and LM Studio provider test files pass: 1,378 tests.
  • The complete changed-lanes owner suite passes: 144 tests.
  • All three production/full-tree/script dead-export scans report zero findings.
  • Targeted source lint, formatting, public-export parity, security contract review, and authenticated full-change review pass.
  • One inherited local Google ambient-credential fixture collision reproduces unchanged on clean main and disappears when that unrelated host credential is omitted from the test subprocess; hosted runners do not inherit local credentials.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 1:59 PM ET / 17:59 UTC.

ClawSweeper review

What this changes

The PR deletes private Google and LM Studio provider facades, redirects their public exports to canonical modules, and consolidates duplicated xAI helper logic.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking correctness finding. This maintainer-owned, behavior-preserving refactor remains open for the protected maintainer decision after its current-head checks finish green.

Priority: P3
Reviewed head: 2fc6e7c6bc7d89a0777edae53cc6de146e1496ce
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has a coherent canonical-owner shape and no identified defect, pending exact-head CI completion.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor proof gate; its body supplies focused provider-test and contract-check claims.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor proof gate; its body supplies focused provider-test and contract-check claims.
Evidence reviewed 5 items Google facade removal preserves exports: The retained Google API facade re-exports the same thinking values and types from the shared provider-stream contract; the deleted module was only a forwarding re-export.
LM Studio public API remains canonical: The root LM Studio API keeps the prior public named exports while reaching their actual defaults, models, runtime, and setup owners directly; the deleted src/api module was forwarding-only.
xAI call path retains its guards: The x_search entrypoint still resolves effective configuration, performs the shared enabled/auth check, and uses the same shared API-key resolver; its payload continues to mark external content untrusted.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs extensions/xai/x-search.test.ts

Result: PASS (completed)

[test] starting test/vitest/vitest.extension-providers.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130212-cu8HD9/target

 ✓  extension-providers  extensions/xai/x-search.test.ts (23 tests) 128ms

 Test Files  1 passed (1)
      Tests  23 passed (23)
   Start at  18:00:33
   Duration  10.56s (transform 8.18s, setup 1.16s, import 9.11s, tests 128ms, environment 0ms)

[test] passed 1 Vitest shard in 17.16s
[test] starting test/vitest/vitest.extension-providers.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130212-cu8HD9/target

 ✓  extension-providers  extensions/xai/x-search.test.ts (23 tests) 123ms

 Test Files  1 passed (1)
      Tests  23 passed (23)
   Start at  18:00:51
   Duration  4.84s (transform 2.60s, setup 519ms, import 4.03s, tests 123ms, environment 0ms)

[test] passed 1 Vitest shard in 11.31s

Assertions:

  • PASS expect_output: x-search.test.ts

How this fits together

Provider plugins expose setup and runtime entrypoints, then use plugin-local and shared SDK helpers to make vendor requests and normalize results. This refactor changes internal helper ownership while retaining the public plugin APIs.

flowchart LR
  A[Provider configuration] --> B[Public plugin API]
  B --> C[Canonical plugin or SDK helpers]
  C --> D[Provider request]
  D --> E[Normalized tool result]
Loading

Decision needed

Question Recommendation
After exact-head checks are green, should this protected maintainer refactor be accepted as the canonical provider-facade cleanup? Accept after exact-head CI: Confirm the current head is green and merge the canonical-owner cleanup.

Why: The maintainer label requires an explicit human accept-or-hold decision even though the code review found no blocking defect.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main and the supplied current-head checks are incomplete, so merge readiness still depends on green exact-head validation.
Agent review details

Security

None.

PR surface

Source -133, Tests 0, Other 0. Total -133 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 10 49 182 -133
Tests 1 6 6 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 2 0
Total 12 57 190 -133

Review metrics

Metric Value Why it matters
Production versus test delta production +49/-182 (net -133); tests +6/-6; test support +2/-2 The change is net-negative production cleanup; test edits only replace the removed fixture path with an existing LM Studio module.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep one canonical implementation per provider behavior, then merge only after the refreshed current-head checks confirm that the retained public APIs and provider paths still pass.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep one canonical implementation per provider behavior, then merge only after the refreshed current-head checks confirm that the retained public APIs and provider paths still pass.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a behavior-preserving refactor, so the relevant evidence is public-export and provider-path preservation rather than a user-bug reproduction.

Is this the best way to solve the issue?

Yes: direct re-exports retain the public plugin API while deleting forwarding modules, and xAI delegates to the same shared owners instead of maintaining local wrappers.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f1491a203c88.

Labels

Label justifications:

  • P3: This is an internal, behavior-preserving provider cleanup rather than a user-facing feature or current defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored internal refactor is exempt from the external-contributor proof gate; its body supplies focused provider-test and contract-check claims.

Evidence

What I checked:

  • Google facade removal preserves exports: The retained Google API facade re-exports the same thinking values and types from the shared provider-stream contract; the deleted module was only a forwarding re-export. (extensions/google/thinking-api.ts:2, 2fc6e7c6bc7d)
  • LM Studio public API remains canonical: The root LM Studio API keeps the prior public named exports while reaching their actual defaults, models, runtime, and setup owners directly; the deleted src/api module was forwarding-only. (extensions/lmstudio/api.ts:2, 2fc6e7c6bc7d)
  • xAI call path retains its guards: The x_search entrypoint still resolves effective configuration, performs the shared enabled/auth check, and uses the same shared API-key resolver; its payload continues to mark external content untrusted. (extensions/xai/x-search.ts:129, 2fc6e7c6bc7d)
  • Existing behavior coverage: The xAI suite covers plugin-owned and inherited base URLs, auth reuse, cancellation, and calendar validation; LM Studio setup coverage protects explicit-model short-circuit and header-auth behavior. (extensions/xai/x-search.test.ts:391, 2fc6e7c6bc7d)
  • Current-main and history check: Current main is f1491a2; the PR is mergeable but behind it, so current-head CI—not source resemblance—is still required. History shows repeated xAI ownership work by steipete and earlier xAI/Google boundary work by Vincent Koc. (extensions/xai/src/x-search-shared.ts:78, e26bae5b2af4)

Likely related people:

  • steipete: Current-head provenance and repeated merged work cover xAI search, Google thinking, and LM Studio API surfaces. (role: recent area contributor; confidence: high; commits: 2fc6e7c6bc7d, e26bae5b2af4, e9b1fbb8c40f; files: extensions/xai/x-search.ts, extensions/google/thinking-api.ts, extensions/lmstudio/api.ts)
  • Vincent Koc: History attributes the xAI configuration boundary and shared Google/xAI provider-helper refactor to this contributor. (role: historical provider-boundary contributor; confidence: medium; commits: 3e4de956c068, 65842aabada0; files: extensions/xai/x-search.ts, extensions/google/thinking-api.ts)
  • Rugved Somwanshi: History identifies the initial LM Studio integration commit as an adjacent ownership signal for the retained public API. (role: original LM Studio integration contributor; confidence: medium; commits: 0cfb83edfae9; files: extensions/lmstudio/api.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Refresh the behind branch only as needed and wait for the exact current-head checks to finish green.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-26T17:10:32.129Z sha 91ebacb :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 50e4655 into main Aug 26, 2026
124 checks passed
@steipete
steipete deleted the codex/cleanup20k-provider-private-facades-20260826 branch August 26, 2026 18:33
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
…aw#130212)

* refactor(providers): remove redundant private runtime facades

* fix(xai): narrow x-search enabled config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: google extensions: lmstudio extensions: xai maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant