Skip to content

fix(qa): model-switch proof accepts served model reroutes - #127281

Merged
vincentkoc merged 2 commits into
mainfrom
codex/model-switch-proof
Aug 23, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
codex/model-switch-proof

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 21, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The model-switch QA scenario required effective.model === effective.responseModel, but the terminal-receipt producer deliberately records the assistant's reported model and provider response model as independent facts. A provider response-model reroute therefore could fail the proof before the alternate-model handoff was evaluated.

Why This Change Was Made

The scenario now validates the exact producer contract: requested identity, non-empty effective identities, and rerouted equal to any difference between the receipt's requested and effective provider/model/response model. It still requires run ownership, visible terminal disposition, distinct alternate served identity, and sent delivery evidence.

Evidence

  • Failing run: https://github.com/openclaw/openclaw/actions/runs/32444623691
  • The artifact proves the default receipt assertion failed; it does not serialize the receipt, so it does not prove which individual clause failed.
  • Producer: src/agents/embedded-agent-runner/run/terminal-preparation.ts computes reportedModelRef from assistant provider/model, computes responseModel independently, and marks a reroute for any requested/effective difference.
  • Transport: packages/ai/src/transports/openai-responses-stream-terminal-internal.ts records the provider response's model in responseModel; transport parity fixtures preserve separate model and response-model fields.
  • Regression coverage drives independent response models through the real YAML evaluator and fails on the removed equality assertion.
  • Autoreview after verifier-driven reinspection: clean, 0.99.
  • Focused Vitest is delegated to PR CI because this isolated worktree intentionally has no reconciled dependencies.

LOC

  • Production: 0
  • QA scenario: +2 / -2
  • Tests: +24 / -1

No Codex runtime/protocol behavior is involved.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@RomneyDa
RomneyDa force-pushed the codex/model-switch-proof branch from 83b9623 to 73b1d42 Compare August 21, 2026 16:54
@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 Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 4:51 PM ET / 20:51 UTC.

ClawSweeper review

What this changes

The PR updates model-switch QA assertions and evaluator coverage so a provider-served response model may differ from the requested or assistant-reported model.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. Current main still requires the effective model and provider response model to match, while the terminal-receipt producer deliberately records them independently; this PR aligns both affected QA scenarios and resolves the prior sibling tool-continuity finding.

Priority: P2
Reviewed head: e2ef0e0d879c14886543bf65b528cbff96f39aa9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-aligned QA repair with evaluator coverage for the formerly rejected receipt shape.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored QA-only PR is exempt from the external-contributor real-behavior-proof gate; its focused evaluator cases are the relevant validation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored QA-only PR is exempt from the external-contributor real-behavior-proof gate; its focused evaluator cases are the relevant validation.
Evidence reviewed 5 items Current-main defect: Current main still requires effective.model to equal effective.responseModel in both follow-up assertions and the tool-continuity alternate assertion, so a distinct provider-served model false-fails the scenario.
Producer contract: The terminal-receipt producer derives responseModel independently from the assistant response and marks rerouted for any requested/effective provider, model, or response-model difference; the PR predicate matches that contract.
Transport evidence: The OpenAI Responses terminal transport records the provider-returned response.model as responseModel, establishing a concrete route for a served identity distinct from the requested model.
Findings None None.
Security None None.

Live Verification

Command: pnpm test extensions/qa-lab/src/scenario-catalog-model-switch-follow-up-proof.test.ts extensions/qa-lab/src/scenario-catalog-model-switch-tool-continuity-proof.test.ts

Result: PASS (completed)

pnpm test extensions/qa-lab/src/scenario-catalog-model-switch-follow-up-proof.test.ts extensions/qa-lab/src/scenario-catalog-model-switch-tool-continuity-proof.
test.ts
runner@runnervm76f27:/tmp/clawsweeper-live-proof-127281-nAeoW7/target$ pnpm test extensions/qa-lab/src/scenario-catalog-model-switch-follow-up-proof.test.ts ext
ensions/qa-lab/src/scenario-catalog-model-switch-tool-continuity-proof.test.ts
$ node --import tsx scripts/test-projects.mts extensions/qa-lab/src/scenario-catalog-model-switch-follow-up-proof.test.ts extensions/qa-lab/src/scenario-catalog
-model-switch-tool-continuity-proof.test.ts
pnpm test extensions/qa-lab/src/scenario-catalog-model-switch-follow-up-proof.test.ts extensions/qa-lab/src/scenario-catalog-model-switch-tool-continuity-proof.
test.ts
[test] starting test/vitest/vitest.extension-qa.config.ts

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-127281-nAeoW7/target

 ✓  extension-qa  extensions/qa-lab/src/scenario-catalog-model-switch-follow-up-proof.test.ts (11 tests) 1074ms
     ✓ invokes the canonical alias target and records exact run-owned evidence  1054ms
 ✓  extension-qa  extensions/qa-lab/src/scenario-catalog-model-switch-tool-continuity-proof.test.ts (13 tests) 42ms

 Test Files  2 passed (2)
      Tests  24 passed (24)
   Start at  20:52:49
   Duration  26.80s (transform 22.93s, setup 2.20s, import 25.75s, tests 1.12s, environment 0ms)

[test] passed 1 Vitest shard in 32.86s
runner@runnervm76f27:/tmp/clawsweeper-live-proof-127281-nAeoW7/target$ pnpm test extensions/qa-lab/src/scenario-catalog-model-switch-follow-up-proof.test.ts ext
ensions/qa-lab/src/scenario-catalog-model-switch-tool-continuity-proof.test.ts
$ node --import tsx scripts/test-projects.mts extensions/qa-lab/src/scenario-catalog-model-switch-follow-up-proof.test.ts extensions/qa-lab/src/scenario-catalog
-model-switch-tool-continuity-proof.test.ts

























Assertions:

  • PASS expect_output: scenario-catalog-model-switch-follow-up-proof.test.ts
  • PASS expect_output: scenario-catalog-model-switch-tool-continuity-proof.test.ts

How this fits together

QA Lab model-switch scenarios run an agent twice and validate its terminal receipt, reply, and delivery evidence. The receipt is produced by the embedded agent runtime and passed into YAML scenario evaluation as model-switch proof.

flowchart LR
A[Configured primary and alternate models] --> B[Agent runs]
B --> C[Terminal receipt]
C --> D[QA scenario evaluator]
D --> E[Model-switch evidence]
E --> F[Pass or failure report]
Loading

Before merge

  • Complete next step (P2) - This MEMBER-authored, maintainer-labeled PR already contains the focused repair; it needs normal exact-head CI completion and maintainer landing review, not a replacement repair job.
Agent review details

Security

None.

PR surface

Tests +39, Other 0. Total +39 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 42 3 +39
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 3 3 0
Total 4 45 6 +39

Review metrics

Metric Value Why it matters
Production versus QA coverage production +0/-0; QA scenario support +3/-3; tests +42/-3 The patch changes no runtime behavior and adds evaluator-level coverage for both the follow-up and tool-continuity scenario contracts.

Technical review

Best possible solution:

Land the receipt-contract-aligned QA assertions once exact-head CI completes, retaining the evaluator-level reroute cases as regression coverage.

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

Yes—source reproducible: current main rejects a receipt whose independently recorded response model differs, and the new evaluator fixtures exercise that exact shape. The read-only review did not execute the test command.

Is this the best way to solve the issue?

Yes. Updating the QA consumer to validate the producer’s recorded reroute invariant is narrower and more accurate than changing the terminal-receipt producer or suppressing served-model evidence.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • 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 MEMBER-authored QA-only PR is exempt from the external-contributor real-behavior-proof gate; its focused evaluator cases are the relevant validation.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded QA correctness repair with limited user-facing blast radius.
  • 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 MEMBER-authored QA-only PR is exempt from the external-contributor real-behavior-proof gate; its focused evaluator cases are the relevant validation.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Current-main blame attributes both the independent terminal-receipt fields and the conflicting QA assertions to the same commit. (role: introduced current receipt and assertion surface; confidence: high; commits: 17ecb9db67a0; files: src/agents/embedded-agent-runner/run/terminal-preparation.ts, qa/scenarios/models/model-switch-follow-up.yaml, qa/scenarios/models/model-switch-tool-continuity.yaml)
  • vincentkoc: Authored the current-head follow-up commit that addresses the prior tool-continuity review finding. (role: recent QA follow-up contributor; confidence: high; commits: e2ef0e0d879c; files: extensions/qa-lab/src/scenario-catalog-model-switch-tool-continuity-proof.test.ts, qa/scenarios/models/model-switch-tool-continuity.yaml)

Rank-up moves

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

  • Let the focused exact-head QA CI complete 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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-21T16:59:54.761Z sha 73b1d42 :: found issues before merge. :: [P2] Align the sibling tool-continuity proof
  • reviewed 2026-08-22T21:48:25.058Z sha 73b1d42 :: needs changes before merge. :: [P2] Align the tool-continuity receipt assertion
  • reviewed 2026-08-22T22:02:02.818Z sha 73b1d42 :: found issues before merge. :: [P2] Align the tool-continuity receipt assertion
  • reviewed 2026-08-23T19:40:46.824Z sha 73b1d42 :: found issues before merge. :: [P2] Align the tool-continuity receipt assertion

@vincentkoc
vincentkoc force-pushed the codex/model-switch-proof branch from 73b1d42 to e2ef0e0 Compare August 23, 2026 20:45
@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. and removed 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 Aug 23, 2026
@vincentkoc vincentkoc self-assigned this Aug 23, 2026
@vincentkoc
vincentkoc merged commit 8a3afa8 into main Aug 23, 2026
242 checks passed
@vincentkoc
vincentkoc deleted the codex/model-switch-proof branch August 23, 2026 21:17
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

2 participants