Skip to content

fix(qa): follow durable finals after streamed previews - #119378

Merged
steipete merged 11 commits into
mainfrom
codex/qa-memory-evidence-isolation
Aug 5, 2026
Merged

steipete merged 11 commits into
mainfrom
codex/qa-memory-evidence-isolation

Conversation

@steipete

@steipete steipete commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #119368

What Problem This Solves

Fixes an issue where maintainers running concurrent QA scenarios would see false failures when a tool-backed final reply correctly replaced its streamed preview with a new durable message ID.

Why This Change Was Made

The channel-memory and progress-evidence scenarios now wait until the event log proves a strict preview-send -> same-preview-delete -> distinct-final-send cursor order, then evaluate the sole non-deleted final reply. Their request-chain, artifact-ordering, reply-target, content, retired-preview, and exactly-once assertions remain intact.

The lifecycle waits preserve the scenarios' existing policy-aware delivery budgets: 30 seconds for the memory scenario and 60 seconds for progress evidence. No retry, product runtime, provider, channel, or memory behavior changed.

User Impact

There is no user-visible product behavior change. Maintainers and contributors get reliable QA verdicts for the channel's documented tool-backed preview replacement flow.

Production LOC delta: 0. QA tests/scenarios: +185 / -28.

Evidence

AI-assisted: yes. I understand the changes and verified the affected owner paths and pressure behavior directly.

@steipete
steipete marked this pull request as ready for review August 4, 2026 23:29
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 1:22 AM ET / 05:22 UTC.

ClawSweeper review

What this changes

The PR changes two QA scenarios to prove that a streamed preview was deleted before selecting the distinct durable final reply.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The patch correctly repairs the QA-only false verdict and resolves the prior direct-conversation identity finding. It remains open because the protected maintainer label requires explicit human handling, not because a code blocker remains.

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

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong exact-head QA evidence and executable identity-isolation coverage support this focused repair.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body provides exact-head Testbox and hosted-run evidence for both affected QA scenarios, including the recorded preview-delete-final lifecycle.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body provides exact-head Testbox and hosted-run evidence for both affected QA scenarios, including the recorded preview-delete-final lifecycle.
Evidence reviewed 5 items Current-main defect: The current scenarios bind later final assertions to the first matching live outbound reply, which can be a streamed preview rather than the durable final.
Channel lifecycle contract: QA Channel clears an active tool-backed preview before it sends the distinct durable completion, so the final message ID is intentionally different.
Exact-head repair: The branch selects one non-deleted reply only after proving preview-send, same-preview-delete, and distinct-final-send cursor order.
Findings None None.
Security None None.

How this fits together

QA Lab runs mock-provider scenarios through an ephemeral Gateway and QA Channel, then evaluates the QA bus event log as verdict evidence. This change makes two scenario verdicts follow the channel’s preview-replacement lifecycle rather than retain the first transient reply.

flowchart LR
  A[QA scenario] --> B[QA Channel preview]
  B --> C[QA bus event log]
  C --> D[Preview deletion check]
  D --> E[Durable final selection]
  E --> F[Scenario verdict]
Loading

Decision needed

Question Recommendation
Should this protected maintainer-labelled QA reliability repair be landed at head 86b3c12? Land exact head: Accept the QA-only lifecycle repair with its supplied Testbox and focused regression evidence.

Why: The patch has no remaining actionable defect, but the maintainer label requires explicit human handling before merge automation may proceed.

Before merge

  • Complete next step (P2) - No repair dispatch is needed: the exact head resolves the prior review blocker, while the protected label leaves the remaining handling to a maintainer.
Agent review details

Security

None.

PR surface

Tests +121, Other +36. Total +157 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 124 3 +121
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 61 25 +36
Total 3 185 28 +157

Review metrics

Metric Value Why it matters
Production versus QA LOC production +0/-0; QA tests/scenarios +185/-28 The branch changes only QA evidence and regression coverage, with no runtime, configuration, or upgrade surface.

Stored data model

Persistent data-model change detected: unknown-data-model-change: qa/scenarios/memory/memory-tools-channel-context.yaml, vector/embedding metadata: qa/scenarios/memory/memory-tools-channel-context.yaml. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #119368
Summary: This PR is the candidate fix for the reported transient-preview versus durable-final QA verdict defect.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Land the exact-head QA-only repair after the protected-label maintainer confirms it; retain the strict account, conversation-kind, conversation-ID, and cursor-order predicates.

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

Yes — current source shows the first-live-preview binding, and the supplied Testbox runs reproduce the false verdict before the exact-head repair passes both affected scenarios.

Is this the best way to solve the issue?

Yes — the channel intentionally replaces a tool-backed preview, so repairing the QA scenario to consume its recorded send/delete/final lifecycle is the correct owner boundary rather than changing channel delivery.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides exact-head Testbox and hosted-run evidence for both affected QA scenarios, including the recorded preview-delete-final lifecycle.
  • 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.
  • remove merge-risk: 🚨 other: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: The patch repairs false QA verdicts that affect maintainer confidence but does not alter user-facing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body provides exact-head Testbox and hosted-run evidence for both affected QA scenarios, including the recorded preview-delete-final lifecycle.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact-head Testbox and hosted-run evidence for both affected QA scenarios, including the recorded preview-delete-final lifecycle.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Recent merged QA scenario and catalog work covers the same memory/progress scenario neighborhood. (role: recent QA scenario contributor; confidence: high; commits: 6a8e11e63cee, fd1cce282679, 52c9448cb505; files: qa/scenarios/memory/memory-tools-channel-context.yaml, qa/scenarios/runtime/agent-progress-evidence.yaml, extensions/qa-lab/src/scenario-catalog-causality.test.ts)
  • Dallin Romney: Earlier channel-flow and scenario-catalog commits establish the surrounding QA architecture. (role: earlier QA flow contributor; confidence: medium; commits: bf32414a4a26, 132d91e42756, 24ce672e06a8; files: qa/scenarios/memory/memory-tools-channel-context.yaml, qa/scenarios/runtime/agent-progress-evidence.yaml)

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-05T01:06:27.697Z sha b9878cc :: needs real behavior proof before merge. :: [P2] Wait for the replacement final before treating it as durable
  • reviewed 2026-08-05T01:18:50.187Z sha 1b3e28c :: needs real behavior proof before merge. :: [P2] Require preview retirement before accepting the final
  • reviewed 2026-08-05T02:04:33.710Z sha 7425aad :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-05T02:17:24.428Z sha 6e4dde3 :: needs real behavior proof before merge. :: [P2] Update the causality test for the durable outbound wait
  • reviewed 2026-08-05T03:06:04.549Z sha 60cfd83 :: needs changes before merge. :: [P2] Keep the scenario-specific delivery timeout
  • reviewed 2026-08-05T03:24:25.793Z sha f8fda63 :: found issues before merge. :: [P2] Scope lifecycle evidence to the active QA account
  • reviewed 2026-08-05T04:20:47.528Z sha da2fdfb :: found issues before merge. :: [P2] Scope final snapshot checks to the active account
  • reviewed 2026-08-05T04:36:50.454Z sha 0da7ee8 :: needs changes before merge. :: [P2] Keep durable progress evidence in the direct conversation

@steipete steipete changed the title fix(qa): isolate memory scenario evidence from background churn fix(qa): follow durable finals after streamed previews Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 5, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the prior P2 at exact head 1b3e28c7826278:

  • Both scenarios now wait for event-log proof of a matching preview deletion and a distinct durable final send before selecting the sole live reply.
  • The lifecycle-aware patch passed 20/20 on Testbox tbx_01kz7q0e4313vs4cvgm6f8dd7j.
  • The committed exact head then passed another 10/10 on Testbox tbx_01kz7qqs3aq2n21prvf9m1kdp9.
  • Final integrated branch AutoReview is clean with no accepted/actionable findings.

The PR body now contains the full before/after and exact-head proof.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the ordering P2 at exact head 7425aad2f84e6d:

  • Both scenarios now require strict event-cursor order: preview sent, that same preview deleted, then a distinct durable final sent.
  • The ordered patch passed 10/10 on Testbox tbx_01kz7rn31fxazt9k9eejtjva9v.
  • The committed exact head then passed 2/2 with inspectable verdict details on Testbox tbx_01kz7s2cxejs1m05zkbsj4vhw7.
  • Final integrated branch AutoReview is clean with no accepted/actionable findings.

The PR body now contains the full before/after and exact-head proof.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 5, 2026
@steipete
steipete force-pushed the codex/qa-memory-evidence-isolation branch from 7425aad to 6e4dde3 Compare August 5, 2026 02:10
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the ordering P2 at rebased exact head 6e4dde3587a325:

  • Both scenarios now require strict event-cursor order: preview sent, that same preview deleted, then a distinct durable final sent.
  • The ordered patch passed 10/10 on Testbox tbx_01kz7rn31fxazt9k9eejtjva9v.
  • The pre-rebase committed head passed 2/2 with inspectable verdict details on Testbox tbx_01kz7s2cxejs1m05zkbsj4vhw7.
  • After preserving current main's request-trace-first flow during rebase, exact head 6e4dde3587a325 passed another 2/2 on Testbox tbx_01kz7tsj80jrr1677nx0ph2xax.
  • Final integrated branch AutoReview is clean with no accepted/actionable findings.

The PR body now contains the full before/after and exact-head proof.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. label Aug 5, 2026
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the causality/evidence findings at exact head 60cfd836149566:

  • Both scenarios now require strict event-cursor order: preview sent, that same preview deleted, then a distinct durable final sent.
  • The ordered patch passed 10/10 on Testbox tbx_01kz7rn31fxazt9k9eejtjva9v.
  • The pre-rebase committed head passed 2/2 with inspectable verdict details on Testbox tbx_01kz7s2cxejs1m05zkbsj4vhw7.
  • After preserving current main's request-trace-first flow during rebase, exact head 6e4dde3587a325 passed another 2/2 on Testbox tbx_01kz7tsj80jrr1677nx0ph2xax.
  • Updated scenario-catalog-causality.test.ts for the durable lifecycle wait; the causality/catalog suite passed 66/66.
  • Added inspectable scenario details. Testbox tbx_01kz7w30rq8yh1se11hevryr8r recorded both preview IDs at cursor 2, matching deletions at cursor 3, and distinct final IDs at cursor 4 while both scenarios passed.
  • Committed exact head 60cfd836149566 passed both scenarios again on Testbox tbx_01kz7wbx7jrsxcebgk9ba17pcg, with the same 2 -> 3 -> 4 lifecycle trace in both verdicts.
  • Final integrated branch AutoReview is clean with no accepted/actionable findings.

The PR body now contains the full before/after and exact-head proof.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete

steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 86b3c128956c58a14f768b6c4b3ae77271f6a7c4:

  • Root cause: both QA scenarios bound the durable verdict to the first matching streamed preview ID, while QA Channel intentionally deletes a tool-backed preview and sends a different durable final carrying the completed tool-call snapshot.
  • Canonical fix: require fully identity-scoped bus facts (account, conversation kind, conversation id) in strict cursor order preview sent -> same preview deleted -> distinct final sent, then carry that identity through every downstream snapshot/event selector before the exactly-one and artifact assertions.
  • Removed paths: the first-preview ID binding and fixed sleep are gone. The scenarios retain their established policy-aware 30s/60s delivery budgets; no retry or product runtime behavior changed.
  • Changed surface: memory-tools-channel-context.yaml, agent-progress-evidence.yaml, and their catalog causality contract. Production LOC delta: 0; QA tests/scenarios: +185/-28.
  • Focused proof: causality/catalog 70/70, including foreign-account and same-account foreign-kind lifecycles executed through both real YAML waiters and their downstream cardinality assertions.
  • Behavior proof: prior exact traces recorded preview cursor 2, deletion cursor 3, and distinct final cursor 4 for both scenarios. Final identity-scoped head passed both scenarios 2/2 on Testbox tbx_01kz85d41ms5xp50nb99hwbw6r (https://github.com/openclaw/openclaw/actions/runs/30977424824).
  • Hosted CI: exact-head run https://github.com/openclaw/openclaw/actions/runs/30977409966 is green.
  • AutoReview: final exact-head branch review clean, no accepted/actionable findings.
  • Repo-native review artifacts: validated with recommendation READY FOR /prepare-pr, zero findings.
  • Proof gaps: none for this test-only PR. The Active Memory doctor timeout and provider-global heartbeat trace race remain separate work in [Bug]: Active Memory QA doctor migration times out under catalog concurrency #119385 and [Bug]: Active Memory QA trace counts unrelated heartbeat requests #119386.

@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the causality/evidence findings at exact head 60cfd836149566:

  • Both scenarios now require strict event-cursor order: preview sent, that same preview deleted, then a distinct durable final sent.
  • The ordered patch passed 10/10 on Testbox tbx_01kz7rn31fxazt9k9eejtjva9v.
  • The pre-rebase committed head passed 2/2 with inspectable verdict details on Testbox tbx_01kz7s2cxejs1m05zkbsj4vhw7.
  • After preserving current main's request-trace-first flow during rebase, exact head 6e4dde3587a325 passed another 2/2 on Testbox tbx_01kz7tsj80jrr1677nx0ph2xax.
  • Updated scenario-catalog-causality.test.ts for the durable lifecycle wait; the causality/catalog suite passed 66/66.
  • Added inspectable scenario details. Testbox tbx_01kz7w30rq8yh1se11hevryr8r recorded both preview IDs at cursor 2, matching deletions at cursor 3, and distinct final IDs at cursor 4 while both scenarios passed.
  • Committed exact head 60cfd836149566 passed both scenarios again on Testbox tbx_01kz7wbx7jrsxcebgk9ba17pcg, with the same 2 -> 3 -> 4 lifecycle trace in both verdicts.
  • Final integrated branch AutoReview is clean with no accepted/actionable findings.

The PR body now contains the full before/after and exact-head proof.

@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. and removed 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. labels Aug 5, 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. 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. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. labels Aug 5, 2026
@steipete
steipete merged commit dc93ea6 into main Aug 5, 2026
134 of 140 checks passed
@steipete
steipete deleted the codex/qa-memory-evidence-isolation branch August 5, 2026 05:29
@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 5, 2026
* test(qa): isolate memory scenario evidence

* test(qa): follow durable progress completion

* test(qa): run doctor migration noninteractively

* test(qa): split active memory follow-up

* test(qa): wait for preview retirement

* test(qa): require ordered preview retirement

* test(qa): record ordered durable reply evidence

* test(qa): preserve durable delivery budgets

* test(qa): isolate durable lifecycle by account

* test(qa): scope durable reply assertions by account

* test(qa): preserve durable conversation identity
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

[Bug]: QA scenarios compare transient preview IDs with durable final replies

1 participant