Repository navigation
refactor(qa): consolidate mock provider response helpers - #118425
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 11:41 PM ET / August 3, 2026, 03:41 UTC. ClawSweeper reviewWhat this changesThe 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 readinessKeep 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 Review scores
Verification
How this fits togetherQA 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]
Before merge
Agent review detailsSecurityNone. PR surfaceTests -329. Total -329 across 1 file. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
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
pnpm check:changedpassed on the same exact-head Testbox lease: extension-test typecheck, lint (0 warnings/errors), formatting, dependency/boundary, duplicate, and dead-code guards.it(...)declarations and 17 parameterized declarations preserved; all 207 removed assertions were repeated HTTP 200 checks now owned byexpectOk.overall: patch is correct (0.99)).