Skip to content

refactor(plugins): return self-hosted auth results directly - #140332

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-self-hosted-setup-result
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-self-hosted-setup-result

Conversation

@steipete

@steipete steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Self-hosted provider setup retains an intermediate result layer left behind after its former public consumer was removed.

Why This Change Was Made

Return the existing public auth result directly from the interactive prompt flow. Delete the private result type, forwarding function and unused returned model ID while preserving the three prompts, normalization, model metadata and shared configuration builder.

User Impact

The public setup API, prompts and generated configuration remain unchanged. Production code decreases by 22 lines.

Evidence

The same three selected interactive/noninteractive cases pass before and after using synthetic prompt values. All 29 canonical checks and the managed P2 review pass. The new characterization lives in a focused sibling test file; the original test file is unchanged, and the existing line limit is preserved. No live provider or credential-store operation was exercised.

Return the existing public auth result directly from the interactive prompt flow. Remove its unused private result layer and returned model ID while preserving all prompts, normalization, metadata, and the shared configuration builder.

Validation: the same three ordinary interactive/noninteractive cases pass before and after; all 29 canonical stages and managed P2 review pass. The new characterization lives in a focused sibling test file so existing line limits stay intact.
@clawsweeper

clawsweeper Bot commented Sep 6, 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.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 17:37
@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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 1:43 PM ET / 17:43 UTC.

ClawSweeper review

What this changes

The PR removes an intermediate result wrapper from self-hosted provider setup and adds coverage for the unchanged prompts, credentials, and generated configuration.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a coherent, behavior-preserving cleanup that remains absent from current main. No actionable defect was found, and the maintainer-authored, protected PR is not eligible for automated closure.

Priority: P3
Reviewed head: 1aaafe0523dcc8940654c73079a8744faf452084

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused simplification with preserved public behavior, useful characterization coverage, and no blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored refactor preserves the setup helper's returned credentials and configuration; reported before/after tests are supplemental, and no live provider or credential-store execution is claimed. No material authority change triggers additional proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored refactor preserves the setup helper's returned credentials and configuration; reported before/after tests are supplemental, and no live provider or credential-store execution is claimed. No material authority change triggers additional proof.
Evidence reviewed 7 items Introduced production change preserves the public contract: The pinned merge-base-to-head diff removes only the private intermediate result and forwarding function; the exported function still returns the same profiles, configPatch, and defaultModel values.
Cleanup remains absent from current main: The fetched main revision retains the private prompt result type and forwarding function.
Latest release retains the same intermediate layer: The v2026.9.2 source also contains the intermediate result and public forwarding wrapper; this cleanup is not already present in the supplied latest release.
Findings None None.
Security None None.

How this fits together

Self-hosted provider setup collects a server URL, API key, and model name through the onboarding prompts. It returns credentials and configuration to the existing authentication flow, which owns persistence and model selection.

flowchart LR
  A[Provider setup entry] --> B[URL, key, and model prompts]
  B --> C[Normalize inputs]
  C --> D[Shared configuration builder]
  D --> E[Authentication result]
  E --> F[Existing persistence and model selection]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -22, Tests +108. Total +86 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 6 28 -22
Tests 1 108 0 +108
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 114 28 +86

Review metrics

Metric Value Why it matters
Production versus test growth Production -22 lines; tests +108 lines The production simplification is paired with a focused characterization of the existing interactive setup contract.

Technical review

Best possible solution:

Keep one interactive setup implementation that returns the existing authentication contract directly while retaining the shared configuration builder.

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

Not applicable: this is a behavior-preserving refactor, not a reported runtime defect; source inspection confirms the redundant layer.

Is this the best way to solve the issue?

Yes: returning the existing public result directly removes unnecessary private plumbing without changing the SDK signature, configuration values, or persistence owner.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This removes redundant internal plumbing without changing user-facing behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored refactor preserves the setup helper's returned credentials and configuration; reported before/after tests are supplemental, and no live provider or credential-store execution is claimed. No material authority change triggers additional proof.

Label justifications:

  • P3: This removes redundant internal plumbing without changing user-facing behavior.
  • 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: The maintainer-authored refactor preserves the setup helper's returned credentials and configuration; reported before/after tests are supplemental, and no live provider or credential-store execution is claimed. No material authority change triggers additional proof.

Evidence

What I checked:

  • Introduced production change preserves the public contract: The pinned merge-base-to-head diff removes only the private intermediate result and forwarding function; the exported function still returns the same profiles, configPatch, and defaultModel values. (src/plugins/provider-self-hosted-setup.ts:118, 1aaafe0523dc)
  • Cleanup remains absent from current main: The fetched main revision retains the private prompt result type and forwarding function. (src/plugins/provider-self-hosted-setup.ts:119, 861804b1654b)
  • Latest release retains the same intermediate layer: The v2026.9.2 source also contains the intermediate result and public forwarding wrapper; this cleanup is not already present in the supplied latest release. (src/plugins/provider-self-hosted-setup.ts:119, 3928bad9badf)
  • Caller and persistence ownership remain intact: The provider SDK calls the same exported setup function through its lazy setup import. The existing models authentication flow consumes the returned profiles and configuration and continues to own credential persistence; no caller or persistence behavior is changed. (src/plugin-sdk/provider-model-shared.ts:68, 1aaafe0523dc)
  • Focused characterization covers the preserved result: The complete new test checks input normalization, preserved existing configuration, model metadata, sensitive prompting, and absence of direct fetch or credential-store calls. Existing noninteractive cases exercise the shared configuration builder. These are supplemental mocked tests, not live provider proof. (src/plugins/provider-self-hosted-setup.interactive.test.ts:20, 1aaafe0523dc)
  • Prior area history supports reviewer routing: Current-main history lists Peter Steinberger across recent self-hosted setup, normalization, and credential-handling changes. Deeper blame and historical patch inspection encountered unavailable Git objects, so no source-line introduction attribution is asserted. (src/plugins/provider-self-hosted-setup.ts, 0135046830ae)

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit 3b61f19 into main Sep 6, 2026
169 checks passed
@steipete
steipete deleted the codex/refactor-self-hosted-setup-result branch September 6, 2026 17:52
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main: (25 commits)
  docs(releases): keep the release-notes nav group to version routes (#140353)
  fix(ui): hide trust wrappers in imported chat history
  fix(subagents): subagent list building decodes unrelated saved prompts in large session stores (#139540)
  test(process): share relay startup fixtures (#140345)
  refactor(doctor): inline GitHub skill discovery inputs (#140343)
  refactor(ui): share channel status type definitions (#140331)
  refactor: simplify queue state and infrastructure dispatch (#140311)
  fix: require saved agent turns before update verification succeeds (#140274)
  fix(update): keep the service profile when switching to Git (#140263)
  fix(ui): prevent image avatars overlapping mobile chat (#140341)
  fix(test): accept release subpages in docs route shape (#140337)
  refactor(plugins): share uninstall mutation ownership (#140322)
  refactor(agents): use canonical tool execution arguments (#140280)
  perf(cli): keep inference metadata and domain help lazy (#140327)
  refactor(plugins): simplify self-hosted setup results (#140332)
  refactor(config): reuse parent lookup for unset operations (#140326)
  fix(plugins): preserve exact installed-index mutation receipts (#140328)
  test(agents): simplify MCP and LSP boundary fixtures (#140312)
  fix(ui): preserve literal source previews and copied whitespace (#140306)
  fix: OpenCode Go/Zen requests are missing the required x-opencode-session header (#137464)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Return the existing public auth result directly from the interactive prompt flow. Remove its unused private result layer and returned model ID while preserving all prompts, normalization, metadata, and the shared configuration builder.

Validation: the same three ordinary interactive/noninteractive cases pass before and after; all 29 canonical stages and managed P2 review pass. The new characterization lives in a focused sibling test file so existing line limits stay intact.
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