Skip to content

improve(tests): fixture wizard model auth policy - #118417

Merged
steipete merged 1 commit into
mainfrom
codex/test-perf-large6-wizard
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-perf-large6-wizard

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

One default-agent model-auth wizard case accidentally entered real plugin manifest and setup-provider discovery after its auth/model owners were already mocked. That unrelated inventory work consumed virtually the entire test file.

Why This Change Was Made

Provide narrow hoisted fixtures for the manifest auth-choice identity and the absence of an explicit setup-provider policy. The real wizard target-selection branch and every default-agent assertion remain unchanged; manifest policy, provider auth, setup registry, and agent targeting retain dedicated owner coverage.

User Impact

No runtime or user-visible behavior changes. The same wizard coverage completes much faster with lower memory use.

Evidence

  • Median wall: 21.21s -> 3.51s (83.5% faster).
  • Vitest: 18.04s -> 783ms; test bodies: 17.21s -> 81ms.
  • Max RSS: about 1.006GB -> 341MB.
  • Target: 6/6; manifest-policy owner: 1/1; provider-auth/setup-registry/default-agent owners: 43/43.
  • Formatting, typed targeted lint, git diff --check, and autoreview are clean.
  • Test-only diff: +25 lines; production LOC delta: 0.

@steipete steipete self-assigned this Aug 3, 2026
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 1:37 AM ET / 05:37 UTC.

ClawSweeper review

What this changes

The PR adds typed hoisted mocks for manifest auth-choice and setup-provider discovery so the model-auth wizard test stays isolated from real plugin inventory work.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This remains necessary: current main does not contain the typed fixtures that prevent this focused wizard test from entering real plugin discovery. The patch follows the existing wizard-test mocking pattern and introduces no actionable correctness or security finding; the maintainer label keeps the final merge decision with a human reviewer.

Priority: P3
Reviewed head: 8b1411ed127cdb9201694bf4392267d2c218e672
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, typed test-isolation patch with no actionable review finding and credible focused validation evidence.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labeled, test-only PR does not require external user-flow proof; the PR body provides focused timing and test-run evidence, while normal exact-head checks remain the merge gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-labeled, test-only PR does not require external user-flow proof; the PR body provides focused timing and test-run evidence, while normal exact-head checks remain the merge gate.
Evidence reviewed 6 items Changed test seam: The PR adds typed hoisted mocks for both discovery functions and registers them with Vitest before the wizard module is exercised; no production file changes.
Runtime owner boundary: The wizard's policy helper imports manifest discovery, resolves the selected manifest choice, then asks the setup registry for that plugin's provider policy. Mocking these calls at the test boundary prevents the unrelated registry load while retaining the wizard's target-selection assertions.
Typed mock contract: The mocked manifest object supplies every required ProviderAuthChoiceMetadata field, while the setup-provider mock returns the resolver's valid no-owner outcome.
Findings None None.
Security None None.

How this fits together

The setup wizard prepares an authentication choice, derives that provider's model-selection policy, then prompts for and validates the selected model. Plugin manifest and setup-provider discovery feed that policy; this PR replaces those discovery boundaries only inside a focused unit test.

flowchart LR
  A[Wizard auth choice] --> B[Auth preparation]
  B --> C[Model-selection policy]
  C --> D[Manifest auth-choice lookup]
  D --> E[Setup-provider policy lookup]
  C --> F[Model picker and validation]
  G[Focused unit-test fixtures] --> D
  G --> E
Loading

Decision needed

Question Recommendation
Should this focused test-isolation patch merge after its exact head is refreshed against current main and pending checks complete? Approve after refresh: Merge once the current PR head is clean against main and the remaining required checks finish successfully.

Why: The patch has no concrete review defect, but the PR carries the protected maintainer label and therefore requires an explicit human merge decision.

Before merge

  • Add real behavior proof - Not applicable: This maintainer-labeled, test-only PR does not require external user-flow proof; the PR body provides focused timing and test-run evidence, while normal exact-head checks remain the merge gate.
  • Resolve merge risk (P1) - GitHub reports the branch as cleanly mergeable but behind current main; refresh the exact head after pending required checks complete before merging.
Agent review details

Security

None.

PR surface

Tests +25. Total +25 across 1 file.

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

Review metrics

Metric Value Why it matters
Production versus test LOC production +0, tests +25 The change is confined to test fixtures, so it does not alter runtime behavior or public configuration.
Focused test timing Vitest 18.04s → 783ms; median wall 21.21s → 3.51s The PR body reports that isolating plugin discovery removes the dominant test cost without reducing the target wizard assertions.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the production policy implementation unchanged and merge the typed test fixtures once a maintainer confirms the refreshed head is clean and required checks have completed.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the production policy implementation unchanged and merge the typed test fixtures once a maintainer confirms the refreshed head is clean and required checks have completed.

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

Not applicable: this is a test-only performance and isolation change, not a report of broken user-facing behavior. Source inspection identifies the discovery calls that the fixture replaces.

Is this the best way to solve the issue?

Yes. The test owns its isolation boundary, while manifest-policy and setup-provider behavior retain dedicated owner tests; the typed mocks avoid real inventory work without changing production policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • remove proof: sufficient: Current real behavior proof status is not_applicable, not sufficient.

Label justifications:

  • P3: This is a narrow test-performance and memory-use cleanup with no user-visible runtime 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 maintainer-labeled, test-only PR does not require external user-flow proof; the PR body provides focused timing and test-run evidence, while normal exact-head checks remain the merge gate.

Evidence

What I checked:

  • Changed test seam: The PR adds typed hoisted mocks for both discovery functions and registers them with Vitest before the wizard module is exercised; no production file changes. (src/wizard/setup.model-auth.test.ts:8, 8b1411ed127c)
  • Runtime owner boundary: The wizard's policy helper imports manifest discovery, resolves the selected manifest choice, then asks the setup registry for that plugin's provider policy. Mocking these calls at the test boundary prevents the unrelated registry load while retaining the wizard's target-selection assertions. (src/wizard/setup.model-auth.ts:61, 59cd041c37a9)
  • Typed mock contract: The mocked manifest object supplies every required ProviderAuthChoiceMetadata field, while the setup-provider mock returns the resolver's valid no-owner outcome. (src/plugins/provider-auth-choices.ts:13, 59cd041c37a9)
  • Existing sibling precedent: The broader wizard test already uses the same typed, hoisted mocks for these two policy-discovery calls, including an undefined setup-provider result. (src/wizard/setup.test.ts:52, 59cd041c37a9)
  • Feature history: Blame attributes the existing focused model-auth test fixture and its default-agent cases to Peter Steinberger in the immediately preceding wizard-test consolidation; the PR head is a follow-up fixture-isolation commit by the same area contributor. (src/wizard/setup.model-auth.test.ts:8, 1cc374b2f0a7)
  • Current-main status: The PR head is not contained in current main; its merge base is 122181649e..., so the test-isolation improvement has not already landed. (src/wizard/setup.model-auth.test.ts:8, 8b1411ed127c)

Likely related people:

  • steipete: Current-main history and blame attribute the focused wizard test baseline to Peter Steinberger, and this follow-up commit isolates its remaining plugin-policy discovery. (role: recent wizard-test contributor and policy-fixture owner; confidence: high; commits: 1cc374b2f0a7, 8b1411ed127c; files: src/wizard/setup.model-auth.test.ts, src/wizard/setup.model-auth.ts)

Rank-up moves

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

  • Refresh the exact head against current main and let the remaining required checks complete before merge.

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-03T03:32:32.459Z sha 007a62e :: needs maintainer review before merge. :: none

@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 3, 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 repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete force-pushed the codex/test-perf-large6-wizard branch from 007a62e to 8b1411e Compare August 3, 2026 05:32
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 3, 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 repository_dispatch).
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 removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 3, 2026
@steipete
steipete merged commit e3e0713 into main Aug 3, 2026
98 checks passed
@steipete
steipete deleted the codex/test-perf-large6-wizard branch August 3, 2026 05:46
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 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: XS 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