Skip to content

refactor(plugins): reuse auth config merge dispatch - #147933

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/provider-auth-patch-recursion-20260914
Sep 14, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/provider-auth-patch-recursion-20260914

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The provider-auth config merger repeats its own record-versus-replacement decision inside the recursive loop.

This specific canonical-merge consolidation was explicitly selected for the active maintainer-requested maintainability and duplication-reduction deliverable permitted by CONTRIBUTING.md. The goal is to leave that policy in one existing owner; the tests characterize preserved behavior.

User Impact

Config patches keep the same recursive merge, replacement, sanitization and deletion behavior.

Why This Change Was Made

Call the existing merge function for each allowed property so its entry guard owns the decision. Remove the duplicate inner branch. Production: −5 lines; tests: +47 lines.

Evidence

  • Personal review covered the complete merge owner and tests, both actual callers, canonical record guard, model/provider normalization owners, auth-result contract and the original recursive-sanitization change.
  • One new public patch test covers record merging, scalar and array replacement by records, replacement by arrays and null, undefined deletion, nested unsafe-key removal and base preservation. It also checks that an unsafe key remains on the replacement input.
  • Input and output shapes, blocked-key policy, normalization order and opt-in model replacement are unchanged. This change adds no stored format, schema, config surface, auth behavior or migration.
  • Signed head fb82d4547732cead72cf4b91c952a7f79d513d33 against parent 069710f909f0a7158777d0fc0bf1eab84e20c699 passed git diff --check and a fresh P2 review with no actionable findings. P2 used the supplied diff and entry-guard context; primary review supplied full owner and contract context. No tests were executed by P2.
  • Normal CI 34821396740, attempt 1 passed on this unchanged head: 119 successful jobs and 17 unselected skips, including the required aggregate gate. The actual test checkout was 161fc83df4fe538acf175430afc0ed2f0f9d3d52 (47060d1cef27c69794b68f6652ba183ad65a494d + reviewed head); both changed files match the reviewed bytes. Target job 103905427331 executed all 22 provider-auth helper cases, including the new nested merge/replacement/input-preservation case. The worker-provider-registry sibling suite also executed all 22 cases. Types, lint, dependencies, build and UI gates passed; pinned formatting checked 38,122 files.
  • ClawSweeper revision 2 covers this exact head with no actionable findings, Before merge items or Rank-up moves. No live provider or authentication execution is claimed.

@vincentkoc vincentkoc self-assigned this Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@vincentkoc
vincentkoc marked this pull request as ready for review September 14, 2026 05:17
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@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 Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 6:57 AM ET / 10:57 UTC (Revision 3).

ClawSweeper review

What this changes

The PR reuses the existing provider-auth configuration merger’s recursive dispatch and adds coverage for preserved merge, replacement, sanitization, deletion, and input-preservation behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: the maintainer’s sponsorship clarification supports this focused refactor, and source inspection found no actionable correctness defect. Current main still contains the duplicate dispatch.

Priority: P3
Reviewed head: fb82d4547732cead72cf4b91c952a7f79d513d33

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving simplification with useful contract coverage, successful cited CI, and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored internal refactor preserves the configuration merger’s behavior and does not materially change authority; the external-contributor runtime-proof gate does not apply. CI is supplemental evidence, and no live authentication execution is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored internal refactor preserves the configuration merger’s behavior and does not materially change authority; the external-contributor runtime-proof gate does not apply. CI is supplemental evidence, and no live authentication execution is claimed.
Evidence reviewed 7 items Introduced change preserves dispatch semantics: The removed inner condition and the existing entry guard select the same recursive-merge or sanitized-replacement path. Blocked-key filtering remains before recursion, and normalization and deletion order are unchanged.
Public-boundary characterization coverage: The complete test module was inspected. The new case exercises nested replacement combinations, unsafe keys inside replacement arrays, undefined deletion, and preservation of input objects through applyProviderAuthConfigPatch; it adds no production-only testing seam.
Current-main and release comparison: Both fetched main and v2026.9.4 retain the inner record-versus-replacement branch. Existing user behavior is already supported; this PR supplies an internal consolidation rather than a missing capability or bug fix.
Findings None None.
Security None None.

How this fits together

Provider sign-in can return configuration updates that OpenClaw combines with existing settings. This helper sanitizes and normalizes those updates before callers pass them to the configuration writer.

flowchart TD
  A[Provider sign-in result] --> C[Configuration merge]
  B[Existing settings] --> C
  C --> D{Both values are records?}
  D -->|Yes| E[Merge allowed properties]
  D -->|No| F[Sanitize replacement]
  E --> G[Delete undefined fields and normalize models]
  F --> G
  G --> H[Configuration writer]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -5, Tests +47. Total +42 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 6 -5
Tests 1 47 0 +47
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 48 6 +42

Review metrics

None.

Technical review

Best possible solution:

Keep recursive merge and replacement decisions in the existing dispatcher while preserving configuration and sanitization contracts.

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

Not applicable: the PR explicitly characterizes existing behavior rather than reporting a defect; no failing current-main behavior is claimed.

Is this the best way to solve the issue?

Yes: delegating to the existing entry guard removes duplicate branching without adding another owner or changing the supported configuration contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against df663a946582.

Labels

Label justifications:

  • P3: This is a sponsored internal simplification with no intended user-visible behavior change.
  • 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 MEMBER-authored internal refactor preserves the configuration merger’s behavior and does not materially change authority; the external-contributor runtime-proof gate does not apply. CI is supplemental evidence, and no live authentication execution is claimed.

Evidence

What I checked:

  • Introduced change preserves dispatch semantics: The removed inner condition and the existing entry guard select the same recursive-merge or sanitized-replacement path. Blocked-key filtering remains before recursion, and normalization and deletion order are unchanged. (src/plugins/provider-auth-choice-helpers.ts:82, fb82d4547732)
  • Public-boundary characterization coverage: The complete test module was inspected. The new case exercises nested replacement combinations, unsafe keys inside replacement arrays, undefined deletion, and preservation of input objects through applyProviderAuthConfigPatch; it adds no production-only testing seam. (src/plugins/provider-auth-choice-helpers.test.ts:95, fb82d4547732)
  • Current-main and release comparison: Both fetched main and v2026.9.4 retain the inner record-versus-replacement branch. Existing user behavior is already supported; this PR supplies an internal consolidation rather than a missing capability or bug fix. (src/plugins/provider-auth-choice-helpers.ts:92, df663a946582)
  • Maintainer sponsorship and review continuity: The supplied MEMBER comment at refactor(plugins): reuse auth config merge dispatch #147933 (comment) explicitly identifies this consolidation as part of an active maintainer-requested deliverable and explains reopening. That resolves the earlier sponsorship objection under CONTRIBUTING.md. The previous completed review covers the same head and contains no findings or published rank-up moves. (CONTRIBUTING.md, fb82d4547732)
  • CI evidence and execution boundary: GitHub confirms the cited normal CI run completed successfully for the reviewed head. The supplied body reports execution of all 22 helper cases and 22 registry sibling cases. This review executed no tests or target code; its read-only diff whitespace check passed. (fb82d4547732)
  • Prior area contribution: Current-main file history includes this earlier auth-patch deletion change, and GitHub identifies vincentkoc as its author with a patch adding undefined-leaf deletion. Local deeper blame/history inspection encountered unavailable objects; the GitHub commit evidence supports routing without claiming original feature introduction. (src/plugins/provider-auth-choice-helpers.ts:97, 4afe616f224c)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (2 earlier review cycles)
  • reviewed 2026-09-14T05:28:04.257Z sha 2a7caf2 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T08:37:53.962Z sha fb82d45 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc force-pushed the refactor/provider-auth-patch-recursion-20260914 branch from 2a7caf2 to fb82d45 Compare September 14, 2026 08:10
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review head fb82d4547732cead72cf4b91c952a7f79d513d33.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vincentkoc

Copy link
Copy Markdown
Member Author

Closing under CONTRIBUTING.md's refactor-only policy. The recursive dispatch is behavior-equivalent, and the added test passes against the pre-change implementation.

No concrete defect or explicitly sponsored deliverable is identified. Retain or resubmit only with a reproducible main failure fixed by this patch, or an explicit human-maintainer request tying it to an active deliverable.

@vincentkoc vincentkoc closed this Sep 14, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Clarifying the sponsorship missing from the body: this specific canonical-merge consolidation was explicitly selected for the active maintainer-requested maintainability and duplication-reduction deliverable allowed by CONTRIBUTING.md. It removes the duplicate recursive record/replacement branch (−5 production lines); the +47 test lines characterize preserved behavior and do not claim a pre-existing defect.

Unchanged head fb82d4547732cead72cf4b91c952a7f79d513d33 passed normal CI, including 22 helper cases and 22 registry sibling cases; its current review has no Before merge items or Rank-up moves. The body now records this scope and evidence; reopening on that basis.

@vincentkoc vincentkoc reopened this Sep 14, 2026
@vincentkoc
vincentkoc merged commit 50090f5 into main Sep 14, 2026
376 of 378 checks passed
@vincentkoc
vincentkoc deleted the refactor/provider-auth-patch-recursion-20260914 branch September 14, 2026 16:09
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 14, 2026
* commit '3c08384584f57787a26da9998488233fc15ccf7e': (122 commits)
  fix(agents): keep tool result summaries when middleware details exceed shape limits (#147805)
  test: make full-suite fixtures portable across runtimes (#148247)
  refactor(qa): share unknown confidence results (#148200)
  chore(android): remove unused test dependencies and duplicate Wear settings (#148231)
  test: reuse compiled preflight in startup fixtures (#148330)
  test(wizard): route recovery integration through database forks (#148337)
  refactor(plugins): simplify provider auth patch recursion (#147933)
  fix(cli): drain failed web capability output (#148234)
  refactor(android): remove unused production helpers (#148233)
  fix(plugins): scope feed integrity to hosted ClawHub (#148220)
  test(qa): compare Telegram entities semantically (#148219)
  test(qa): recognize native Slack exec progress rows (#148217)
  test(cron): distinguish repeated delivery incidents (#148151)
  test(qa): preserve restart command ownership (#148218)
  test(qa): isolate bundled skill CLI gateway state (#148150)
  test(qa): align process lifecycle contracts (#148149)
  improve(media): reduce metadata fetched during orphan cleanup (#148244)
  fix(matrix): retain sync state runtime for deferred persistence (#148152)
  test: deduplicate gateway watch exit fixtures (#148237)
  refactor(cli): derive daemon status contract from gatherer (#148108)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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: S 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