Skip to content

refactor(qa): consolidate mock provider response helpers - #118425

Merged
steipete merged 1 commit into
mainfrom
codex/cleanup50k-docker-qa-20260802-183204
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cleanup50k-docker-qa-20260802-183204

Conversation

@steipete

@steipete steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The QA mock-provider test duplicated hundreds of successful-response checks and provider request-envelope fields, making scenario-specific behavior harder to review and maintain.

Why This Change Was Made

Centralizes successful HTTP response validation and canonical OpenAI/Anthropic request defaults in provider-local test helpers, and shares the repeated WhatsApp structured fixtures. Intentional failure requests remain on the raw response path, while every test title, non-status assertion, protocol frame, ordering check, and error scenario stays intact.

User Impact

No user-visible runtime behavior changes. The QA coverage is smaller and makes protocol regressions easier to identify.

Evidence

  • LOC: +497/-826 in one test file (net -329 test LOC; production delta 0).
  • Exact latest-base Blacksmith proof: 211/211 focused tests, including the Anthropic Code Mode compaction-retry success, semantic-diff, and invalid-result cases.
  • pnpm check:changed passed on the same exact-head Testbox lease: extension-test typecheck, lint (0 warnings/errors), formatting, dependency/boundary, duplicate, and dead-code guards.
  • Assertion audit: 164 it(...) declarations and 17 parameterized declarations preserved; all 207 removed assertions were repeated HTTP 200 checks now owned by expectOk.
  • Autoreview: clean, no accepted/actionable findings (overall: patch is correct (0.99)).

@steipete steipete self-assigned this Aug 3, 2026
@clawsweeper clawsweeper Bot added 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 2, 2026, 11:41 PM ET / August 3, 2026, 03:41 UTC.

ClawSweeper review

What this changes

The branch replaces repeated successful mock-provider response checks and repeated OpenAI/Anthropic request defaults with local QA test helpers, while retaining raw paths for intentional failure assertions.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep this active: it is a focused, assigned, maintainer-labeled QA test refactor with no blocking correctness or security defect found. The shared success helpers preserve raw non-200 paths, retain the scenario-specific assertions, and current main has not changed the affected test or mock-server factory since the PR base.

Priority: P3
Reviewed head: 6ab7af2e51fdf159acfdc849274ca556b55932c1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test refactor with clear helper boundaries, retained error-path assertions, and supplied exact-head QA validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-labeled, test-only refactor has no independent user-facing runtime path to demonstrate; the supplied exact-head focused QA execution is the relevant behavior proof.
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 refactor has no independent user-facing runtime path to demonstrate; the supplied exact-head focused QA execution is the relevant behavior proof.
Evidence reviewed 5 items Shared helper boundary: The PR adds a single expectOk status assertion and composes it into JSON/text, OpenAI-default, and Anthropic-default helpers; raw post helpers remain available for tests that intentionally assert non-200 responses.
Failure-path coverage remains explicit: The 503 provider fixture and malformed-request assertions still use raw request calls and explicitly verify 503/400 responses, so the new success helper does not hide intended error behavior.
Scenario declaration parity: The branch preserves 160 ordinary it declarations, 17 parameterized declarations, and both top-level describes while reducing repeated successful HTTP-status assertions from 208 to the helper-owned check.
Findings None None.
Security None None.

How this fits together

QA Lab runs deterministic scenarios against a local mock OpenAI-compatible and Anthropic-compatible server rather than live providers. The test suite sends mock requests, checks request/response protocol behavior, and feeds those results into QA smoke validation.

flowchart LR
  Scenarios[QA scenarios] --> Server[Mock provider server]
  Server --> Requests[Request envelopes]
  Requests --> Helpers[Success-response helpers]
  Helpers --> Assertions[Scenario-specific assertions]
  Assertions --> Smoke[QA smoke CI]
Loading

Before merge

  • Add real behavior proof - Not applicable: This maintainer-labeled, test-only refactor has no independent user-facing runtime path to demonstrate; the supplied exact-head focused QA execution is the relevant behavior proof.
  • Resolve merge risk (P1) - GitHub reports the branch as behind main. The affected test and mock-server factory are unchanged on current main, but normal merge-ref and required-check validation should still run against the final base.
  • Complete next step (P2) - This active maintainer-labeled PR needs ordinary maintainer merge review and final-base validation, not a repair job.
Agent review details

Security

None.

PR surface

Tests -329. Total -329 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 497 826 -329
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 497 826 -329

Review metrics

Metric Value Why it matters
Production versus test LOC production +0; tests −329 net The change is confined to one QA test file and removes repeated success-path boilerplate without expanding runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the consolidation after the normal current-base merge check confirms the exact branch head still preserves the successful-response and intentional-error test split.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the consolidation after the normal current-base merge check confirms the exact branch head still preserves the successful-response and intentional-error test split.

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

Not applicable: this PR refactors the QA harness rather than reporting a user-facing defect. The relevant verification is preservation of its successful and intentional-failure request paths, which current source and the supplied focused QA proof cover.

Is this the best way to solve the issue?

Yes. Centralizing only repeated successful-response checks and canonical provider defaults is the narrowest maintainable solution; it leaves intentional non-200 and malformed-input assertions on raw request paths.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a behavior-neutral QA test maintenance refactor with no user-facing runtime change.
  • 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: This maintainer-labeled, test-only refactor has no independent user-facing runtime path to demonstrate; the supplied exact-head focused QA execution is the relevant behavior proof.

Label justifications:

  • P3: This is a behavior-neutral QA test maintenance refactor with no user-facing runtime 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 refactor has no independent user-facing runtime path to demonstrate; the supplied exact-head focused QA execution is the relevant behavior proof.

Evidence

What I checked:

Likely related people:

  • steipete: Peter Steinberger recently changed the same mock-provider test surface on current main and authored the focused refactor under review. (role: recent area contributor; confidence: high; commits: 1fedcca9a916, 6ab7af2e51fd; files: extensions/qa-lab/src/providers/mock-openai/server.test.ts)
  • Vincent Koc: Vincent Koc’s recent QA repair also touched this central test file, making him an adjacent owner for mock-provider regression coverage. (role: recent QA contributor; confidence: medium; commits: f5637c068517; files: extensions/qa-lab/src/providers/mock-openai/server.test.ts)

Rank-up moves

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

  • Refresh the final merge ref and required checks against current main before landing.

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 e5eff98 into main Aug 3, 2026
105 of 113 checks passed
@steipete
steipete deleted the codex/cleanup50k-docker-qa-20260802-183204 branch August 3, 2026 03:47
@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

extensions: qa-lab 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: XL 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