Repository navigation
fix(qa): recognize canonical nested tool receipts - #158641
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 26, 2026, 1:19 AM ET / 05:19 UTC (Revision 3). ClawSweeper reviewWhat this changesQA Lab now recognizes correlated nested tool receipts in persisted transcripts and public chat history for runtime-tool, redaction, and memory-ranking checks. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. Current main still lacks this QA reader coverage; the earlier merged fix addressed session-summary accounting only. The current branch has focused tests, reported live proof, and no actionable patch finding. Priority: P2 Review scores
Verification
How this fits togetherQA Lab runs scenarios against an isolated OpenClaw Gateway. It reads session transcripts and chat history to decide whether tool activity satisfies runtime and safety assertions. flowchart LR
A[Code Mode tool execution] --> B[Persisted nested receipt]
B --> D[QA receipt reader]
C[Gateway chat history] --> D
D --> E[Correlated tool call and result]
E --> F[Runtime and safety checks]
F --> G[QA pass or failure]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +141, Tests +265, Other +3. Total +409 across 15 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep QA's runtime, redaction, and ranking gates keyed to validated call/result correlation across persisted receipts and published history. Do we have a high-confidence way to reproduce the issue? Yes. Current main's runtime reader only extracts direct tool calls and results, while OpenClaw persists nested execution as a custom receipt; this review did not execute the scenario. Is this the best way to solve the issue? Yes. A QA-owned reader at the evidence boundary serves the affected checks while retaining their direct-tool path and correlation requirements. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0d7a4e817abc. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
77e9109 to
7759a94
Compare
|
@clawsweeper re-review Please review final head All eight requested live-frontier scenarios passed with source-owned defaults and isolated Gateway/state, zero skips, CLI exit 0. The final focused suite passed 179 tests, and all 35 affected tests passed again after lint-only fixes. The PR body records pre-fix failures, checks, costs, and exact source contracts. The data-model warning is a path-based false positive: the ranking YAML only projects existing chat history before unchanged assertions. This PR changes no stored schema, embeddings, retention, or migration contract. Review only; this lane stops Ready and has no merge, queue, or automerge authority. |
|
🦞👀 Re-review progress:
|
7759a94 to
1211615
Compare
What Problem This Solves
Fixes false QA failures when code mode persists a completed tool invocation as canonical nested activity.
User Impact
QA runtime-tool, redaction, and memory-ranking scenarios recognize correlated nested success and error receipts. Product behavior, provider defaults, and scenario expectations stay unchanged.
There are no stored schema, embedding metadata, retention, or migration changes. The ranking YAML change only projects existing chat history before its unchanged assertions; no data-model compatibility migration is needed.
Why This Change Was Made
One QA-owned reader validates the persisted receipt contract and projects it into the call/result view consumed by existing assertions. The session summary reuses that reader. No core-internal imports, tool/provider branches, synthetic persisted turns, timeout increases, or model overrides are introduced.
The runtime evidence reader and existing transcript test writers are extracted into their owning modules to keep the existing files within repository size gates. The previous nested-aware summary work in #155976 did not cover these other QA readers.
Evidence
37259b7cab6b1816211d381200848048a05f197d.1211615329dfa69d9c900621342c2193a9ce85b4; its only difference from the live-tested head is the two-line missing-field fixture correction. The complete selected changed-file gate passed after that correction.src,ui,packages, configuration, and runner sources are unchanged from the frozen base. A process sample and increasing CPU time showed active evaluation; bounded investigation did not identify a deadlock or a source defect. No timeout was raised or failure hidden. The public-history correction then passed its selected guards, production/test typechecks, dead-export scans, formatting, and changed-file lint after fixing two convention violations; all 35 affected tests passed again. Exact-head CI passed both core lint shard 1 and core lint shard 2, all six extension lint shards, and the remaining lint job.7759a9410cfa4b97d04858d90295652a9155c820: 8 passed / 0 failed / 0 skipped, CLI exit 0. Exact scenarios:runtime-tool-apply-patch,runtime-tool-sessions-spawn,runtime-tool-web-fetch,runtime-tool-session-status,runtime-tool-web-search,secret-redaction-tool-logs,personal-redaction-no-secret-leak, andsession-memory-ranking. Source-owned defaults, isolated Gateway/config/state, and narrowly injected provider auth were used. The first run was 5/8; its three failures exposed the sanitized-history fixture gap, which was fixed and re-proven before this full rerun.compact-small-42failed one suppression-inventory assertion; four other core shards were canceled. Its checkout was merge73fe1d4bof this head into mainb458b9f1c6b. Main's progress-snapshot change addedno-implicit-coercionwithout updating the inventory, producing 78 entries versus 77 expected. Both affected files and the scanner are unchanged by this PR, and the suppression is absent at its frozen base and head. The exact inventory test passes all four cases at this PR head (4.71 seconds Vitest, 5.89 seconds runner); that passing isolation is attribution evidence, not a claim to repair main. The original CI shard had 48 passing files and one failing file. No same-order full-shard replay was attempted because the assertion directly scans the checkout's source bytes; no shared-state cause is indicated. The bounded history/GitHub search found no owning fix, and current main9f6554c164c4still carries the mismatch. CI remains blocked by that upstream defect; no expectations were weakened, and no CI retry or refresh was requested.36219236698: all four QA shards passed, including all five corrected nested-receipt cases. The final core tooling shard repeated the same upstream suppression-inventory failure described above: merge76c00d84includes main5da1262bc896, where the extra suppression remains. It had 48 passing files and one failing file; seven other core shards were canceled, leavingopenclaw/ci-gateblocked. This run was triggered by the verified fixture correction, not a retry for green.2026-09-26T05:02:22.608Z, found no actionable correctness or security findings and marked the proof sufficient and ready for maintainer look. Its residual path-based data-model checklist is a false positive: the changed ranking YAML only projects existing history in memory; there are no stored-data writes, schema, embedding metadata, retention, or migration changes, as the technical review itself confirms. Both earlier substantive findings are fixed and proven above.scripts/prreview validation andprepare-runcompleted at final head, preserving the frozen base and recordinggithub_pendingwithout a successful gate stamp. The lane stops Ready for maintainer review, with the upstream CI blocker disclosed. No merge, queue, or auto-merge action was requested. Isolated Gateway/state and completed live artifacts are removed; the open PR's source and native recovery state are retained.Contract inspection and test audit
Personally inspected sibling
../codexat39598ed17885970828acd42a6370131ed0190a98: dynamic request/response contract, lines 45–75, handler correlation and completed/failed result, lines 174–250, and app-server call/result contract, lines 1652–1679. These retain call/turn correlation, tool arguments, content, and success state. The OpenClaw canonical persisted shape is nested-tool-activity.ts, lines 7–31 and 51–86.Test-audit authoring answers:
Public history is a separate published representation: the Gateway creates correlated blocks and publishes run ownership, then removes private receipt details. The QA adapter validates that exact call/result pair against its envelope before using the same terminal metadata validator as persisted receipts.
No source-grep assertions, expected-value self-comparisons, provider-specific helper replays, new timers, polling, or per-test Gateway/model boots were added. The persisted runtime boundary uses the real session store because ignoring a persisted custom row is the defect.
Per-file cost measured with the supported
node scripts/run-vitest.mjs <file> --maxWorkers=1entry point (thepnpm testwrapper's runner), a lane-owned cache, and dependency reconciliation disabled:runtime-tool-fixture.nested.test.tsruntime-tool-fixture.test.tsscenario-flow-runner-redaction-proof.test.tsscenario-catalog-memory-ranking-proof.test.tsLocal wall measurements include runner, transform, and startup time and reuse lane-owned compiler outputs; the final fixture-only correction additionally passed its five-case run in 12.76 seconds through the runner. All four linked CI jobs passed at final head
1211615329dfa69d9c900621342c2193a9ce85b4. CI reports the containing shard rather than per-file aggregate runtime; total job durations were 196, 192, 182, and 183 seconds respectively.