Skip to content

fix(qa): select the scenario's required provider before its models - #119491

Merged
steipete merged 4 commits into
mainfrom
codex/autoqa-provider-lane-selection-20260805
Aug 5, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/autoqa-provider-lane-selection-20260805

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where selecting one QA scenario could choose the wrong provider/model or reject a supported scenario depending on which existing scenario field declared its provider lane. Explicitly conflicting lane declarations also had no single authoritative owner.

Why This Change Was Made

Resolve both existing scenario-provider declarations in one canonical QA owner before choosing models or planning scenarios. Preserve explicit operator selections and implicit single-scenario defaults, reject conflicting declarations, and remove the old late override and duplicated lane filter. This changes private QA selection only; it adds no product configuration, provider API, persisted state, or compatibility surface.

User Impact

QA operators get the intended mock or live provider consistently across direct runs, profile planning, and implicit single-scenario selection.

Evidence

  • Authentic pre-fix regressions reproduced mismatched Matrix lane selection, conflicting scenario declarations, and config-only mock scenarios selecting the live default.
  • Focused owner coverage: extensions/qa-lab/src/scenario-lane.test.ts and extensions/qa-lab/src/suite-planning.test.ts, including explicit-override and implicit-singleton controls.
  • Trusted Blacksmith Testbox aggregate: 916 passing tests across 28 files; the final owner-adjacent rerun passed 102 tests across 6 files.
  • Independent structured review found no accepted actionable findings; Testbox run: https://github.com/openclaw/openclaw/actions/runs/30973152491
  • Production owner delta: 47 additions / 52 deletions (-5 net); regression tests: 149 additions. The follow-up type-narrowing correction is net-zero.

Inspectable owner-path proof

Trusted Blacksmith Testbox exercised the real unified suite owner, not a selector-only mock:

[qa-suite] run start: scenarios=1
[qa-suite] lab start
extensions/qa-lab/src/suite-provider-selection.test.ts: 8 tests passed

The runtime-partitioned singleton reaches the injected real lab-start boundary and records providerMode: live-frontier in the unified summary. Its explicit mock-override control does not start a lab and reports the actual provider-lane mismatch. Inference is limited to an omitted override plus exactly one selected flow scenario; native-only, mixed, profile, operator-explicit, and default provider behavior remain unchanged. Provider resolution happens before suite progress starts.

Real Gateway provider-selection verdict

Trusted Testbox invoked the actual private-QA CLI with no provider override and a real config-only mock-pinned scenario:

pnpm openclaw qa suite --scenario goal-context-next-turn --output-dir .artifacts/qa-e2e/autoqa-provider-direct-proof
[qa-suite] provider start: mock-openai
[qa-suite] gateway ready: http://127.0.0.1:41921
[qa-suite] scenario start (1/1): goal-context-next-turn
[qa-suite] scenario pass (1/1): goal-context-next-turn
[qa-suite] run complete: passed=1 failed=0 skipped=0 total=1
{"proof":"direct-implicit-provider-selection","run":{"providerMode":"mock-openai","primaryModel":"mock-openai/gpt-5.6-luna","alternateModel":"mock-openai/gpt-5.6-luna-alt"},"counts":{"total":1,"passed":1,"failed":0,"skipped":0}}

The same run passed the real unified-suite owner regressions (8 tests) and 154 owner/sibling tests across nine files; unified scenario summary asserts live-frontier primary and alternate OpenAI models while explicit mock remains rejected. Exact touched PR files were verified byte-identical to the integration proof checkout. Testbox run: https://github.com/openclaw/openclaw/actions/runs/30983445783

Current-main and shipped-tag contract audit

The latest automated review's claim that merged #119519 deliberately reverted scenario-derived provider selection is factually incorrect:

  • Shipped tag v2026.7.2-beta.7 already implements selected-singleton scenario provider AND primary/alternate model adoption in extensions/qa-lab/src/suite-model-selection.ts:39-55.
  • Both that shipped tag and current main explicitly document the existing contract in extensions/qa-lab/src/suite-planning.ts:83-86: "Explicit single-scenario runs adopt this provider later."
  • Alleged revert commit ae54355 (fix(qa): keep profile runs aligned with scenario contracts #119519) touches ZERO of scenario-lane.ts, suite-model-selection.ts, suite-planning.ts, suite-run.runtime.ts, or suite-launch.runtime.ts; direct git show of all five paths is empty. Its actual changes add config-form requiredProviderMode declarations and preserve profile-selection provenance.
  • This PR preserves the existing shipped single-scenario adoption contract, resolves BOTH equivalent metadata forms through one owner BEFORE eligibility filtering, and makes a single runtime-partitioned flow use the same already-supported behavior. Native-only/mixed/implicit/profile suites preserve their original defaults.
  • One intentional compatibility correction is explicit: a conflicting explicitly supplied operator provider now remains authoritative and produces a clear lane-mismatch error; the old late override silently discarded the operator's explicit choice.
  • The real private-Gateway verdict in this PR demonstrates the config-only mock scenario now selects mock-openai and passes, while the shipped execution-form scenario and both direct/unified paths retain explicit-override coverage.

The two automated P1 findings depend on a nonexistent "deliberate revert" and are rejected based on the exact shipped source, current source, merged commit file list, preserved operator intent, and real Gateway output. No provider-default policy or public configuration surface is added.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 5, 2026, 3:18 AM ET / 07:18 UTC.

ClawSweeper review

What this changes

The PR makes a single selected QA scenario supply the default provider and models before direct or unified QA suite planning, while rejecting conflicting provider declarations.

Merge readiness

⛔ Blocked by patch quality or review findings - 6 items remain

Keep open for a protected maintainer decision: current main deliberately preserves run-owned provider defaults, while this PR would reintroduce scenario-driven provider and model selection. The attached Gateway output is real proof of the branch behavior, but not that the now-reverted behavior is desired.

Priority: P2
Reviewed head: b21749bc637834eb3769448a388007f6b6b9304e
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The runtime proof is credible, but the patch conflicts with the newer run-level provider contract on current main.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body includes after-fix terminal output from the real QA CLI through an ephemeral Gateway, including the selected provider, passing scenario, and structured summary.
Patch quality 🧂 unranked krab (1/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body includes after-fix terminal output from the real QA CLI through an ephemeral Gateway, including the selected provider, passing scenario, and structured summary.
Evidence reviewed 5 items Current direct-run contract: Current main derives the requested provider/models before loading the scenario catalog, then applies only the established late flow override; the PR moves config-derived scenario selection ahead of that contract.
Current unified-run contract: Current main keeps unified-suite provider selection as the explicit run parameter or its run-level default; it does not infer it from one scenario.
PR reintroduces scenario-derived defaults: The branch selects a scenario requirement whenever providerMode is omitted, before deriving the default models.
Findings 2 actionable findings [P1] Keep direct suite provider defaults run-owned
[P1] Keep unified-suite provider defaults run-owned
Security None None.

How this fits together

QA Lab is OpenClaw’s private scenario runner: CLI inputs and scenario metadata determine a provider/model lane, then launch an ephemeral gateway and execute the selected flow. This PR changes which layer owns the default lane when an operator omits a provider.

flowchart LR
  A[QA CLI request] --> B[Scenario catalog]
  A --> C[Run-level provider default]
  B --> D[Scenario lane requirements]
  C --> E[Model selection]
  D --> E
  E --> F[Suite planning]
  F --> G[Ephemeral gateway run]
Loading

Decision needed

Question Recommendation
Should selected scenario metadata be allowed to replace an omitted QA run provider default, despite current main preserving run-owned defaults? Keep run-owned defaults: Do not merge the inference change; optionally re-scope a later PR to explicit metadata validation only.

Why: This is a product-contract choice for private QA execution, not a mechanical correction: current main intentionally restores the opposite behavior.

Before merge

  • Keep direct suite provider defaults run-owned (P1) - With no explicit provider, this changes a selected scenario’s metadata into the direct suite’s mock/live provider and model default before lane validation. Current main retains the run-level default and only uses scenario requirements as eligibility, so merging would silently replace existing CLI behavior.
  • Keep unified-suite provider defaults run-owned (P1) - This applies the same scenario-derived override to a unified run and all of its partitions. Current main deliberately restores the run-level default here, so a one-scenario invocation could change provider and models without an operator provider selection.
  • Resolve merge risk (P1) - Merging would change an existing omitted-provider QA invocation from a run-owned default to scenario-derived mock/live provider and model selection, contrary to current main’s preserved execution contract.
  • Improve patch quality - Obtain an owner decision on whether scenario metadata may replace omitted run-level provider defaults.
  • Improve patch quality - If retaining the current contract, remove the inference changes rather than rebasing them unchanged.

Findings

  • [P1] Keep direct suite provider defaults run-owned — extensions/qa-lab/src/suite-model-selection.ts:25-35
  • [P1] Keep unified-suite provider defaults run-owned — extensions/qa-lab/src/suite-launch.runtime.ts:682-692
Agent review details

Security

None.

PR surface

Source +8, Tests +222. Total +230 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 5 64 56 +8
Tests 3 263 41 +222
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 327 97 +230

Review metrics

Metric Value Why it matters
Production versus test delta production +64/-52; tests +263/-41 The net production growth establishes a new provider-default contract that current main deliberately rejects.

Stored data model

Persistent data-model change detected: serialized state: extensions/qa-lab/src/suite-provider-selection.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Preserve the current QA contract (recommended)
    Pause or close this branch unless a maintainer wants scenario metadata to override an omitted run-level provider.
  2. Sponsor the new default
    Accept the behavior change only with an explicit owner decision and refreshed proof covering all run modes that inherit defaults.

Technical review

Best possible solution:

Keep provider and model defaults run-owned; retain only a separately approved, narrow metadata-validation change if conflicting scenario declarations must be rejected.

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

Yes—source-reproducible: current main initializes the direct and unified run-level defaults before scenario-derived selection, while the branch changes that ordering and the PR body shows the resulting Gateway run.

Is this the best way to solve the issue?

No. Current main’s newer contract keeps provider defaults at the run owner; scenario requirements remain eligibility constraints unless a maintainer explicitly adopts a different defaulting rule.

Full review comments:

  • [P1] Keep direct suite provider defaults run-owned — extensions/qa-lab/src/suite-model-selection.ts:25-35
    With no explicit provider, this changes a selected scenario’s metadata into the direct suite’s mock/live provider and model default before lane validation. Current main retains the run-level default and only uses scenario requirements as eligibility, so merging would silently replace existing CLI behavior.
    Confidence: 0.97
  • [P1] Keep unified-suite provider defaults run-owned — extensions/qa-lab/src/suite-launch.runtime.ts:682-692
    This applies the same scenario-derived override to a unified run and all of its partitions. Current main deliberately restores the run-level default here, so a one-scenario invocation could change provider and models without an operator provider selection.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: An omitted provider can switch mock/live lane and default models for existing QA invocations.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from the real QA CLI through an ephemeral Gateway, including the selected provider, passing scenario, and structured summary.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes after-fix terminal output from the real QA CLI through an ephemeral Gateway, including the selected provider, passing scenario, and structured summary.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.
  • remove merge-risk: 🚨 automation: Current PR review merge-risk labels are merge-risk: 🚨 compatibility.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This changes private QA operator behavior with limited production blast radius.
  • merge-risk: 🚨 compatibility: An omitted provider can switch mock/live lane and default models for existing QA invocations.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (terminal): The PR body includes after-fix terminal output from the real QA CLI through an ephemeral Gateway, including the selected provider, passing scenario, and structured summary.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output from the real QA CLI through an ephemeral Gateway, including the selected provider, passing scenario, and structured summary.

Evidence

What I checked:

Likely related people:

  • Dallin Romney: History shows the heaviest contribution to the relevant owner files and the scenario-lane and unified-control-plane changes. (role: historical QA lane and unified-run contributor; confidence: high; commits: 652c6444b3ab, 9310586b092d, 19d17bc3c45a; files: extensions/qa-lab/src/scenario-lane.ts, extensions/qa-lab/src/suite-model-selection.ts, extensions/qa-lab/src/suite-run.runtime.ts)
  • Peter Steinberger: History records substantial prior work across the same QA owner files, including QA-wide repairs. (role: historical QA contributor and current branch author; confidence: high; commits: d16e33e08e45, cb16d739cfda; files: extensions/qa-lab/src/suite-model-selection.ts, extensions/qa-lab/src/suite-run.runtime.ts)
  • Vincent Koc: Recent main history attributes the current surrounding owner code to this contributor, alongside earlier QA lane work. (role: recent adjacent QA contributor; confidence: medium; commits: 17ef7771a66d, b403cb5d50ac; files: extensions/qa-lab/src/suite-model-selection.ts, extensions/qa-lab/src/suite-launch.runtime.ts)

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 (4 earlier review cycles)
  • reviewed 2026-08-05T05:33:23.445Z sha 4d1bb91 :: needs real behavior proof before merge. :: [P1] Resolve provider defaults in unified QA suite partitions
  • reviewed 2026-08-05T05:45:16.294Z sha cd82c72 :: needs real behavior proof before merge. :: [P1] Resolve provider lanes before unified-suite partitioning
  • reviewed 2026-08-05T06:17:43.793Z sha b21749b :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-05T06:34:43.966Z sha b21749b :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 5, 2026
@steipete
steipete merged commit 74014c2 into main Aug 5, 2026
153 of 162 checks passed
@steipete
steipete deleted the codex/autoqa-provider-lane-selection-20260805 branch August 5, 2026 12:53
@steipete

steipete commented Aug 5, 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 6, 2026
…penclaw#119491)

* fix(qa): resolve scenario provider requirements before selection

* fix(qa): preserve validated scenario provider lane type

* test(qa): isolate provider lane selection regressions

* fix(qa): honor explicit scenario lanes in unified runtime suites
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: M 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.

1 participant