Skip to content

fix(qa): keep Anthropic mock tool ids replay-stable - #123153

Merged
steipete merged 1 commit into
mainfrom
fix/qa-anthropic-replay-stable-ids
Aug 16, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/qa-anthropic-replay-stable-ids

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where Anthropic QA scenarios could report false tool-call causality failures when generated mock IDs were normalized differently during replay.

Why This Change Was Made

Generated mock Anthropic tool IDs now use the replay-stable canonical toolu plus 35-character SHA-256 form. Native toolu_* IDs remain unchanged.

User Impact

No production user-visible behavior changes. Anthropic QA compaction and thread-memory scenarios now evaluate the intended runtime behavior instead of failing on mock-only ID formatting.

Evidence

  • node scripts/run-vitest.mjs extensions/qa-lab/src/providers/mock-openai/server.test.ts: 267/267 passed.
  • Exact two-scenario QA proof on diff-identical predecessor eb7a9ab16e5290398a6e7467707e3c5121c9fec3 (current head changes only the Punchcard trailer): compaction-retry-mutating-tool and thread-memory-isolation both passed.
  • Evidence recorded provider anthropic, model anthropic/claude-opus-4-8, live=false, fixture mock-openai, and the exact tested SHA.
  • Runtime artifacts synchronized through the isolated @openclaw/ai overlay; no TypeScript or bundled-plugin rebuild occurred.
  • node scripts/run-oxlint.mjs for both changed files, oxfmt --check, and git diff --check: passed.

Punchcard-Session: frost-orchard-lantern-ze

@vincentkoc vincentkoc self-assigned this Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Aug 13, 2026
@clawsweeper

clawsweeper Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 11:57 PM ET / August 16, 2026, 03:57 UTC.

ClawSweeper review

What this changes

The PR replaces generated Anthropic mock tool IDs with a deterministic 40-character alphanumeric form and updates mock-provider assertions for repeated and distinct IDs.

Regression provenance

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

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

No blocking code finding. This remains open because it is maintainer-labeled and the exact-head build-artifacts check is still running; the focused QA-only repair otherwise follows the mock-provider owner boundary.

Priority: P3
Reviewed head: 72b9f71e86f8c34a582839da6013022cd8d4f275
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-neutral mock-provider repair with targeted assertions and no supported correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored QA-only PR is exempt from the external-contributor proof gate; its body still records targeted mock-provider scenario results.
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 proof gate; its body still records targeted mock-provider scenario results.
Evidence reviewed 7 items Current main still has the old generated format: Current main generates non-native mock IDs as toolu_ plus 48 SHA-256 hex characters, so the requested behavior is not already implemented.
PR fixes the producer boundary: The proposed adapter maps each generated source ID once and applies the same mapped value to added, completed, and delta response events before the mock server constructs Anthropic response payloads.
Caller applies the adapter on the Anthropic route: The mock server adapts response events only for the Anthropic Messages route, before it records the planned tool identity and builds the wire response.
Findings None None.
Security None None.

How this fits together

QA Lab converts shared response events into Anthropic Messages-compatible mock responses. Its scenarios then replay those responses through OpenClaw’s transcript handling to validate compaction and memory causality without production provider traffic.

flowchart LR
  A[QA scenario events] --> B[Mock provider]
  B --> C[Anthropic response adapter]
  C --> D[Stable generated tool IDs]
  D --> E[Transcript replay]
  E --> F[Scenario causality checks]
Loading

Decision needed

Question Recommendation
Should this maintainer-labeled QA-only repair be merged once the current-head build-artifacts check completes successfully and GitHub reports it mergeable? Merge after exact-head checks: Merge once build-artifacts is successful and the current head is cleanly mergeable.

Why: The patch has no supported correctness blocker, but the protected maintainer label requires explicit human landing handling.

Before merge

  • Resolve merge risk (P1) - The supplied current-head check rollup still has build-artifacts in progress, so merge should wait for that result and GitHub mergeability.
  • Complete next step (P2) - No repair work is indicated; the protected maintainer label and incomplete exact-head build check require routine human landing review.
Agent review details

Security

None.

PR surface

Source 0, Tests +6. Total +6 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 11 5 +6
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 12 6 +6

Review metrics

Metric Value Why it matters
Production versus test LOC production +1/-1 (net 0); tests +11/-5 (net +6) The repair changes one existing mock normalizer without production growth and adds focused coverage for deterministic repeated and distinct mappings.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the deterministic conversion at the QA mock producer, retain the repeated-versus-distinct ID regression coverage, and merge only after exact-head CI completes.
  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 deterministic conversion at the QA mock producer, retain the repeated-versus-distinct ID regression coverage, and merge only after exact-head CI completes.

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

Unclear: the PR records two targeted mock-provider scenario passes, but this read-only review did not execute the current head.

Is this the best way to solve the issue?

Yes: normalizing at the mock response producer gives every downstream Anthropic response representation the same deterministic ID, and the replay sanitizer preserves the new alphanumeric 40-character shape.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is an internal QA mock replay correction with no claimed production user-visible 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 MEMBER-authored QA-only PR is exempt from the external-contributor proof gate; its body still records targeted mock-provider scenario results.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Authored the current repair and prior merged QA mock-provider work, including the release-validation scenario repair. (role: recent QA area contributor; confidence: high; commits: 72b9f71e86f8, 6a8e11e63cee; files: extensions/qa-lab/src/providers/mock-openai/mock-anthropic-wire.ts, extensions/qa-lab/src/providers/mock-openai/server.test.ts)
  • steipete: History attributes the surrounding mock-wire lineage to Peter Steinberger, who also performed the latest branch force-push. (role: adjacent QA architecture owner; confidence: medium; commits: dd42e8048055, 1d5321192485; files: extensions/qa-lab/src/providers/mock-openai/mock-anthropic-wire.ts, extensions/qa-lab/src/providers/mock-openai/server.test.ts)

Rank-up moves

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

  • Let the current-head build-artifacts check complete successfully 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 (2 earlier review cycles)
  • reviewed 2026-08-13T11:30:44.961Z sha 7a510b4 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-13T14:17:53.860Z sha 7a510b4 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as ready for review August 13, 2026 11:33
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 13, 2026
Punchcard-Session: frost-orchard-lantern-ze
@steipete
steipete force-pushed the fix/qa-anthropic-replay-stable-ids branch from 7a510b4 to 72b9f71 Compare August 16, 2026 03:51
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 16, 2026
@steipete
steipete merged commit 3f32569 into main Aug 16, 2026
118 checks passed
@steipete

steipete commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Merged via squash.

  • Prepared head SHA: 72b9f71e86f8c34a582839da6013022cd8d4f275
  • Landed commit: 3f3256906690165773410bc72de629f141c1ff4a
  • Focused proof: node scripts/run-vitest.mjs extensions/qa-lab/src/providers/mock-openai/server.test.ts passed 267/267; QA scenarios compaction-retry-mutating-tool and thread-memory-isolation passed; the changed-surface gate was clean.
  • Exact-head CI: run 31925257809 completed green, including build-artifacts and openclaw/ci-gate.
  • Review: the full-diff Codex autoreview reported no accepted/actionable findings (patch-correct confidence 0.99). Native review artifacts validated READY FOR /prepare-pr with zero findings.
  • ClawSweeper: its only Rank-up move was to wait for build-artifacts; satisfied before landing.
  • Scope and security: zero product-production LOC; QA tooling +1/-1 and tests +11/-5. The patch changes no release provenance, Telegram signature/provenance enforcement, version, or tag path.
  • Contributor credit: squash author remains Vincent Koc [email protected]; @vincentkoc remains assigned.

@steipete
steipete deleted the fix/qa-anthropic-replay-stable-ids branch August 16, 2026 04:17
steipete pushed a commit that referenced this pull request Aug 16, 2026
Punchcard-Session: frost-orchard-lantern-ze
(cherry picked from commit 3f32569)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 17, 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: 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.

2 participants