Skip to content

fix(test): stop deep-importing Radius from provider auth tests - #148502

Closed
steipete wants to merge 1 commit into
mainfrom
steipete/upd-red-main-radius-deep-import
Closed

steipete wants to merge 1 commit into
mainfrom
steipete/upd-red-main-radius-deep-import

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Refs #148469

What Problem This Solves

The core plugin-boundary test fails on main because the provider auth-method regression imports the Radius plugin entrypoint directly.

User Impact

No production behavior changes. This restores the core test boundary so unrelated PRs can pass the affected CI check.

Why This Change Was Made

Use a typed generic provider-auth fixture through the real auth runner and wizard session. Preserve local/remote link presentation, device-code metadata, and cancellation coverage while removing the Radius registration and HTTP mock. The fixture explicitly verifies that the wizard's cancellation signal reaches the auth method. Radius-specific OAuth behavior remains owned by its plugin tests; no new public export or boundary exception is needed.

Evidence

  • Before: node scripts/run-vitest.mjs src/plugins/contracts/boundary-invariants.test.ts src/plugins/provider-auth-method.test.ts stopped at the boundary suite with 1 failed / 12 passed. The sole offender was src/plugins/provider-auth-method.test.ts at the assertion on line 333.
  • Before: node scripts/run-vitest.mjs src/plugins/provider-auth-method.test.ts passed all 8 cases independently.
  • After: the combined command passed both suites: 13 boundary tests and 8 auth-method tests.
  • Independent autoreview through P1 found no actionable issues.
  • No runtime, public API, schema, dependency, or invariant/baseline changes. No live provider authentication was needed for this test-only repair.
  • node scripts/check-changed.mjs passed, including the core TypeScript boundary, affected test typecheck, formatting, lint, and export scans. git diff --check passed.

@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.

@steipete
steipete marked this pull request as ready for review September 14, 2026 19:57
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 14, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The boundary failure is confirmed, but replacing the registered Radius cases drops coverage that the PR body says is preserved. extensions/radius/oauth.test.ts builds a prompter without deviceCode; its browser and cancellation cases exercise the legacy note path. None exercises the structured openUrl + deviceCode branch in extensions/radius/oauth.ts:151–159 after this change.

Please retain the existing registered-provider cases through loadBundledPluginFacade from src/test-utils/bundled-plugin-public-surface.ts, using the declared index.js entrypoint. src/agents/runtime-plan/materialize-model.arcee.test.ts already uses that seam with registerSingleProviderPlugin. This removes the static plugin import/type-graph leak while preserving the actual local/remote device-link, code, and pre-poll cancellation regression. No new export or boundary exception is needed.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 14, 2026, 4:03 PM ET / 20:03 UTC.

ClawSweeper review

What this changes

The PR replaces the registered Radius provider in authentication tests with a generic fixture, removing a forbidden plugin import while checking wizard presentation and cancellation.

Merge readiness

⛔ Needs changes before merge - 2 items remain

The boundary repair remains necessary on current main, but the discussion correctly identifies lost Radius regression coverage. The protected PR should remain open for that focused correction.

Priority: P2
Reviewed head: 8e8aec77e48e84d8ba7d65679a02c3b7e0ebf4a3

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch addresses the import violation but unnecessarily weakens an existing provider regression.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied member-author classification exempts this test-only repair from contributor runtime proof; reported focused test results support the boundary fix but do not resolve the identified coverage loss.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied member-author classification exempts this test-only repair from contributor runtime proof; reported focused test results support the boundary fix but do not resolve the identified coverage loss.
Evidence reviewed 6 items Introduced test replacement: The pinned introduced delta replaces the registered Radius OAuth method with a hand-written method and removes the transport-call assertion. Host-verified test-merge evidence confines the resulting change to this test file.
Coverage concern verified: Radius has a structured deviceCode branch that opens the verification URL before presenting the code. Its OAuth tests construct a prompter without deviceCode, and its index tests cover catalog/model transport rather than this sign-in path. The replacement therefore removes actual coverage, as reported at #148502 (comment).
Existing narrow repair path: loadBundledPluginFacade dynamically loads the declared public entrypoint while sharing the test runner’s SDK state and mocks. The Arcee regression already combines this helper with registerSingleProviderPlugin; Radius declares its index entrypoint in package metadata.
Findings 1 actionable finding [P2] [P2] Retain the registered Radius device-flow regression
Security None None.

How this fits together

The provider authentication runner connects plugin sign-in methods to OpenClaw’s setup wizard. These tests check that provider links and device codes reach clients and that cancellation reaches authentication.

flowchart LR
  A[Provider sign-in method] --> B[Shared authentication runner]
  B --> C{Client can present links}
  C --> D[Wizard link and device code]
  C --> E[Local browser fallback]
  F[User cancels wizard] --> B
Loading

Before merge

  • [P2] Retain the registered Radius device-flow regression (P2) - Replacing the registered method with this fixture removes coverage of Radius’s structured openUrl + deviceCode branch and its cancellation before token polling. A regression in that branch now passes these cases, while extensions/radius/oauth.test.ts only supplies the legacy prompter without deviceCode. As the discussion requests, load Radius’s declared index.js through loadBundledPluginFacade and keep the registered-provider assertions; the existing Arcee test demonstrates this boundary-safe pattern.
  • Complete next step (P2) - Restore registered Radius coverage through loadBundledPluginFacade and verify both affected suites pass together.

Findings

  • [P2] [P2] Retain the registered Radius device-flow regression — src/plugins/provider-auth-method.test.ts:90-95
Agent review details

Security

None.

PR surface

Tests +5. Total +5 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 28 23 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 28 23 +5

Review metrics

None.

Technical review

Best possible solution:

Preserve the registered Radius local/remote regression through the existing public-entrypoint loader, retaining link, code, cancellation, and no-further-poll assertions.

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

Yes, from source: current main’s static Radius index import violates the core test-boundary assertion, and the replacement no longer executes Radius’s structured sign-in branch. No tests were run during this read-only review.

Is this the best way to solve the issue?

No. Removing the static import is appropriate, but the existing public-entrypoint loading helper can do that while preserving the registered-provider regression requested in the discussion.

Full review comments:

  • [P2] [P2] Retain the registered Radius device-flow regression — src/plugins/provider-auth-method.test.ts:90-95
    Replacing the registered method with this fixture removes coverage of Radius’s structured openUrl + deviceCode branch and its cancellation before token polling. A regression in that branch now passes these cases, while extensions/radius/oauth.test.ts only supplies the legacy prompter without deviceCode. As the discussion requests, load Radius’s declared index.js through loadBundledPluginFacade and keep the registered-provider assertions; the existing Arcee test demonstrates this boundary-safe pattern.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded test-boundary repair with a concrete regression-coverage loss and no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The supplied member-author classification exempts this test-only repair from contributor runtime proof; reported focused test results support the boundary fix but do not resolve the identified coverage loss.

Label justifications:

  • P2: This is a bounded test-boundary repair with a concrete regression-coverage loss and no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The supplied member-author classification exempts this test-only repair from contributor runtime proof; reported focused test results support the boundary fix but do not resolve the identified coverage loss.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/plugins/contracts/boundary-invariants.test.ts src/plugins/provider-auth-method.test.ts.
  • [P1] node scripts/check-changed.mjs.
  • [P1] git diff --check.

What I checked:

  • Introduced test replacement: The pinned introduced delta replaces the registered Radius OAuth method with a hand-written method and removes the transport-call assertion. Host-verified test-merge evidence confines the resulting change to this test file. (src/plugins/provider-auth-method.test.ts:90, 8e8aec77e48e)
  • Coverage concern verified: Radius has a structured deviceCode branch that opens the verification URL before presenting the code. Its OAuth tests construct a prompter without deviceCode, and its index tests cover catalog/model transport rather than this sign-in path. The replacement therefore removes actual coverage, as reported at fix(test): stop deep-importing Radius from provider auth tests #148502 (comment). (extensions/radius/oauth.ts:151, 8e8aec77e48e)
  • Existing narrow repair path: loadBundledPluginFacade dynamically loads the declared public entrypoint while sharing the test runner’s SDK state and mocks. The Arcee regression already combines this helper with registerSingleProviderPlugin; Radius declares its index entrypoint in package metadata. (src/test-utils/bundled-plugin-public-surface.ts:83, 8e8aec77e48e)
  • Current-main necessity and release context: Fetched main still contains the static Radius index import and registered-provider cases. The test file is absent from the supplied latest release v2026.9.4, so this addresses current development-tree validation rather than an established released runtime failure. (src/plugins/provider-auth-method.test.ts:2, 318ee9754d96)
  • Merged feature history: GitHub commit data verifies the auth adapter and registered Radius regression changes associated with merged fix(auth): retain sign-in links for local clients #148469 and identifies obviyus as the commit author. Local parent-diff inspection encountered an unavailable object; the GitHub commit response supplied the relevant patches. (src/plugins/provider-auth-method.ts:22, 5d6453e092ae)
  • Validation and proof scope: The captured PR body reports 13 boundary tests and 8 auth-method tests passing together after the change, plus changed-file checks. Tests were not executed in this read-only review. The three downloaded screenshots were inspected and belong to the earlier sign-in fix; they do not demonstrate this test replacement. The local introduced diff whitespace check passed. (src/plugins/provider-auth-method.test.ts, 8e8aec77e48e)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

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

  • Restore the registered Radius cases through the existing public-entrypoint loader and rerun the boundary and auth-method suites together.

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.

@vincentkoc

Copy link
Copy Markdown
Member

Superseded by #148504, merged as 867e655.

That landed the boundary repair while preserving the registered Radius device-code coverage in test/provider-auth-method.radius.integration.test.ts and also restored the wizard recovery database-worker route. #148511 is now closed as redundant against the same landed fix.

@vincentkoc vincentkoc closed this Sep 14, 2026
@RomneyDa
RomneyDa deleted the steipete/upd-red-main-radius-deep-import branch October 22, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants