Repository navigation
fix(qa): reject history-bearing utility requests without session affinity - #158496
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: needs maintainer review before merge. Reviewed September 25, 2026, 9:40 PM ET / September 26, 2026, 01:40 UTC (Revision 3). ClawSweeper reviewWhat this changesQA Lab's local mock model server limits sessionless utility completions to single-turn text requests across Responses and Anthropic, with HTTP regressions for history, continuation, and valid affinity. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Current main still admits history-bearing requests under the merged utility exception. This follow-up addresses that distinct QA isolation gap, and the reviewed head has convincing HTTP boundary proof with no actionable finding. Priority: P2 Review scores
Verification
How this fits togetherQA Lab's mock provider receives model requests from test runs. It resolves session affinity before choosing in-memory scenario state and returning a simulated model response. flowchart LR
A[QA test run] --> B[Model HTTP request]
B --> C[Wire normalization]
C --> D[Session affinity check]
D -->|accepted| E[Scenario state]
D -->|rejected| F[Missing identity error]
E --> G[Mock response and request record]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +26, Tests +96. Total +122 across 4 files. View PR surface stats
Review metrics
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 session admission in its existing resolver and retain boundary checks that distinguish genuine standalone utilities from conversation requests before scenario state is selected. Do we have a high-confidence way to reproduce the issue? Yes. After observing a QA session, current main's utility exception can admit a history-bearing HTTP request without affinity; the PR reports red registered-server cases for that path. This read-only review did not execute it. Is this the best way to solve the issue? Yes. The repair stays in the existing session resolver, uses dispatcher normalization, and checks raw Anthropic turns that normalization can discard. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 06da80236ed4. 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)
|
Require the host-prepared single-user text shape using dispatcher-owned normalization while preserving raw transport identity. Reject conversation history and retained continuation references without affinity; cover Responses and Anthropic at the registered HTTP boundary. Co-authored-by: RomneyDa <[email protected]>
Require a single raw user message before the standalone utility exception so discarded thinking and empty history cannot select anonymous scenario state. Cover rejected HTTP requests and valid-affinity admission. Co-authored-by: RomneyDa <[email protected]>
db75f5b to
2f2aa3f
Compare
|
The unrelated CI blocker has a landed owner fix: #158520, commit 5be36d3. It replaces the two remaining calls to the removed harness-local projector with the canonical task-content projection. Rebased this PR onto that exact fixed main commit. New head: 2f2aa3f. Both commits are equal in git range-diff, and every file in the affected QA mock-provider directory is byte-identical to reviewed head db75f5b7856a9d3956f6c9aefb8de4cedd5339c8. The existing platinum review / diamond boundary proof therefore remains relevant; no new behavior or review waiver is introduced. The formerly failing production type command now passes locally on the refreshed head. A new normal PR CI run is required; the failed run was not blindly rerun against its old broken merge input. No merge or validation-target refresh performed. |
* commit '66b812f26e725cd709e08860d2cb46ba496cd308': (70 commits) fix(gateway): preserve typed boxed-number coercion chore(ui): refresh control ui locales (#158689) fix(gateway): reset staged headers on authority errors (#158669) fix(workers): keep inbound staging stable during quota scans fix: preserve Telegram delivery after bot identity changes (#158612) fix(ui): keep automation starter prompts out of startup (#158482) fix(cli): distinguish configuration read failures from invalid input (#158671) test: remove retired progress coercion suppression allowance refactor(gateway): schedule worker placement maintenance (#158662) fix(daemon): keep native service checks within their timeout (#154565) fix(test): restore gateway steering fixture contracts (#158478) fix(acpx): use SDK filesystem publication boundary fix(agentsapi): load OpenClaw persona and workspace context (#158328) fix(gateway): drop progress snapshot coercion suppression fix(qa): accept native Codex truncation in cache evidence (#158454) fix(gateway): keep chat subscriptions stable during unrelated approvals (#158633) perf(gateway): release event payloads from live text guards (#158643) perf(sessions): reduce stalls when saving large chat messages (#158402) fix(qa): reject history-bearing utility requests without session affinity (#158496) test: allow intentional progress snapshot coercion ...
* fix(test): verify followup completion ordering Exercise the real presentation settlement helper with asynchronous cleanup, preserve continuation and admission semantics, and unconditionally release and join the held work. Remote proof covers the strengthened ordering contract and both missing-await faults. * fix(test): verify followup completion ordering * chore: retain followup test branch ancestry The current-main reconstruction preserves the original reviewed scope and supersedes its stale base. Keep the remotely qualified candidate tree unchanged while retaining the original PR ancestry for a non-force branch update. * commit 'ff35145de21cf6296bec05e86bee37b5ed53bcb8': fix(test): verify followup completion ordering * test(auto-reply): signal queued presentation entry * chore: refresh followup test on boundary fix * commit '66b812f26e725cd709e08860d2cb46ba496cd308': (70 commits) fix(gateway): preserve typed boxed-number coercion chore(ui): refresh control ui locales (#158689) fix(gateway): reset staged headers on authority errors (#158669) fix(workers): keep inbound staging stable during quota scans fix: preserve Telegram delivery after bot identity changes (#158612) fix(ui): keep automation starter prompts out of startup (#158482) fix(cli): distinguish configuration read failures from invalid input (#158671) test: remove retired progress coercion suppression allowance refactor(gateway): schedule worker placement maintenance (#158662) fix(daemon): keep native service checks within their timeout (#154565) fix(test): restore gateway steering fixture contracts (#158478) fix(acpx): use SDK filesystem publication boundary fix(agentsapi): load OpenClaw persona and workspace context (#158328) fix(gateway): drop progress snapshot coercion suppression fix(qa): accept native Codex truncation in cache evidence (#158454) fix(gateway): keep chat subscriptions stable during unrelated approvals (#158633) perf(gateway): release event payloads from live text guards (#158643) perf(sessions): reduce stalls when saving large chat messages (#158402) fix(qa): reject history-bearing utility requests without session affinity (#158496) test: allow intentional progress snapshot coercion ... Co-authored-by: Vincent Koc <[email protected]>
…nity (openclaw#158496) * fix(qa): keep utility completion admission history-free Require the host-prepared single-user text shape using dispatcher-owned normalization while preserving raw transport identity. Reject conversation history and retained continuation references without affinity; cover Responses and Anthropic at the registered HTTP boundary. Co-authored-by: RomneyDa <[email protected]> * fix(qa): reject Anthropic history before normalization Require a single raw user message before the standalone utility exception so discarded thinking and empty history cannot select anonymous scenario state. Cover rejected HTTP requests and valid-affinity admission. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: RomneyDa <[email protected]>
* fix(test): verify followup completion ordering Exercise the real presentation settlement helper with asynchronous cleanup, preserve continuation and admission semantics, and unconditionally release and join the held work. Remote proof covers the strengthened ordering contract and both missing-await faults. * fix(test): verify followup completion ordering * chore: retain followup test branch ancestry The current-main reconstruction preserves the original reviewed scope and supersedes its stale base. Keep the remotely qualified candidate tree unchanged while retaining the original PR ancestry for a non-force branch update. * commit 'ff35145de21cf6296bec05e86bee37b5ed53bcb8': fix(test): verify followup completion ordering * test(auto-reply): signal queued presentation entry * chore: refresh followup test on boundary fix * commit '622be54be3ffe0fce27d6a4b147c76d4b19c528c': (70 commits) fix(gateway): preserve typed boxed-number coercion chore(ui): refresh control ui locales (openclaw#158689) fix(gateway): reset staged headers on authority errors (openclaw#158669) fix(workers): keep inbound staging stable during quota scans fix: preserve Telegram delivery after bot identity changes (openclaw#158612) fix(ui): keep automation starter prompts out of startup (openclaw#158482) fix(cli): distinguish configuration read failures from invalid input (openclaw#158671) test: remove retired progress coercion suppression allowance refactor(gateway): schedule worker placement maintenance (openclaw#158662) fix(daemon): keep native service checks within their timeout (openclaw#154565) fix(test): restore gateway steering fixture contracts (openclaw#158478) fix(acpx): use SDK filesystem publication boundary fix(agentsapi): load OpenClaw persona and workspace context (openclaw#158328) fix(gateway): drop progress snapshot coercion suppression fix(qa): accept native Codex truncation in cache evidence (openclaw#158454) fix(gateway): keep chat subscriptions stable during unrelated approvals (openclaw#158633) perf(gateway): release event payloads from live text guards (openclaw#158643) perf(sessions): reduce stalls when saving large chat messages (openclaw#158402) fix(qa): reject history-bearing utility requests without session affinity (openclaw#158496) test: allow intentional progress snapshot coercion ... Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Fixes QA mock-provider requests with conversation history being accepted as standalone utility calls without session affinity.
Follow-up to #158452. That PR merged before its second review correction was published; this PR contains only the remaining history-isolation repair.
User Impact
No shipped user-facing behavior changes. Genuine standalone JSON and memory-dreaming completions remain supported, while history-bearing requests cannot select shared anonymous QA scenario state after a session has been observed. No stored-data or configuration migration.
Why This Change Was Made
Use the dispatcher's existing Responses/Anthropic normalization and admit only the actual host-prepared utility shape: leading system/developer text, exactly one final user-text turn, no tools, and no retained response or conversation reference. Transport identity remains authoritative on the original request. Anthropic requests must also contain exactly one raw user message: normalization may discard thinking-only or empty prior turns, so the normalized projection alone cannot authorize the utility exception. Assistant history, calls, reasoning, earlier user turns, and outputs do not gain authority from a utility prompt prefix.
Evidence
Initial publication head (superseded by the hosted-review correction below): 2d24e4d676ba41839d6d9e9216980375c8047ee7 on main b4d60fa. The exact-head rerun passed 35/35 tests across three files, 28.06 seconds Vitest / 30.33 seconds wrapper wall. This refreshed run selected Responses-input sibling tests; the earlier run selected input-extraction unit tests. Counts are not additive.
Hosted review correction: raw Anthropic history
ClawSweeper's exact-head finding on
2d24e4dwas reproduced and repaired indb75f5b7856a9d3956f6c9aefb8de4cedd5339c8. The resolver rejects prior raw Anthropic turns before selecting scenario state; it does not change the wire adapter or valid transport-affinity handling.Registered HTTP before/after observations (synthetic payloads; loopback host and port omitted):
Before: the three added HTTP cases failed on
2d24e4d(expected 500, received 200); four existing Anthropic history cases passed. After: 38/38 tests across three files passed, 24.29 seconds Vitest / 26.54 seconds wrapper wall. The session-identity file has 28 cases; new cases took 11, 8, and 8 ms. These are real requests through the registered local QA mock HTTP server, not live Anthropic or Codex model calls. This is an internal QA-only isolation correction, not a claim of a production user-data leak.Command:
NO_PROXY=127.0.0.1,localhost node scripts/run-vitest.mjs extensions/qa-lab/src/providers/mock-openai/server.session-identity.test.ts extensions/qa-lab/src/providers/mock-openai/server.responses-input.test.ts extensions/qa-lab/src/providers/mock-openai/server.anthropic-failure.test.ts --maxWorkers=1. The loopback exclusion was necessary because the inherited environment proxy returned 502 before reaching the server; that fixture failure is not counted as the red regression.All 26 selected changed-file check stages passed on the correction, including production/test types, lint (zero warnings/errors), dead exports, guards, formatting, and runtime cycles. A fresh bounded local independent review again ended
reviewer_unavailableafter 120 seconds without a report; no clean local-review claim. Publication continues under the previously authorized hosted-review path. The new-head ClawSweeper review completed: platinum hermit (4/6), proof diamond lobster (5/6), no actionable findings or security concerns. The security-sensitive review gate is green.Historical CI blocker, repaired on main
CI run 36207826841 on
db75f5b7856a9d3956f6c9aefb8de4cedd5339c8failed production types and extension-package-boundary compilation, then fail-fast cancelled remaining jobs. Its merge input waseacfde7d50a29c1bc32f655aef6938f766ba9865(main parent2a7b059f4ef38adf1a221320f6c48e61b4e0c728). A separate isolated checkout of that exact merge input reproduces only these core type errors after package-local dependencies were prepared:The QA branch itself passes the same core type command. The unresolved callers are in main-side commit
d16cdc55154796e421a87e124f70cb329d004092, which removed the old helper and migrated synchronous callers but left these asynchronous callers. This was true at the failed run; #158520 subsequently repaired both references as 5be36d3. No QA source change touches that file. Hosted detailed log downloads were unavailable (403); the exact-merge local reproduction supplies the concrete diagnostics, not a claim that both hosted failures have independently readable logs. No blind CI retry, unrelated source patch, merge, or direct-main write was performed. That failed attempt is historical. The patch-equivalent rebase below has a fresh CI run pending.CI recovery on repaired main
Current head: 2f2aa3f, rebased onto landed #158520 / 5be36d3. Both commits are equal in range-diff, and the entire affected QA mock-provider directory is byte-identical to the reviewed db75f5b head. Production core types pass locally on the refreshed head. Fresh normal PR CI run: 36208749280, in progress at the last read. No old broken merge-input retry or merge was performed.