Skip to content

fix(qa): fence old tool outputs at authored requests - #201244

Merged
RomneyDa merged 4 commits into
mainfrom
openclaw/land-frv11-lifecycle-ordering
Nov 18, 2026
Merged

RomneyDa merged 4 commits into
mainfrom
openclaw/land-frv11-lifecycle-ordering

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Problem

The QA mock provider treated any mention of retry, continuation, or compaction as a continuation. A fresh denied-input request such as “do not retry” could reuse an older result and omit the requested tool call.

Change

Classify the authored current request rather than quoted history or runtime guidance. Recognize explicit continuations, canonical [System]-wrapped recovery introductions, and the exact bare or inter-session-wrapped runtime-event wake. Arbitrary forwarded requests and quoted continuation text still fence old output. HTTP regressions preserve the invalid ls path and empty sessions_spawn task and prove completed calls are not reissued during stalled recovery.

Only the QA classifier and two tests change. No core recovery, lifecycle, startup, scenario prompts, timeouts, permissions, or CI changes. Landed lifecycle repair #201229 and the firstbirth fixture are unchanged.

Validation

  • Actual-main baseline 46ecb8046fb06f252aec6d7e3450e29f685ee99f: both HTTP denied-input cases fail with missing ls / sessions_spawn calls; 5 others pass.
  • Initial head f27fa522549dc3d5912ba99fd1e2e7c58c2c4b4e failed CI run 44318606431: image-generation lifecycle planned four calls instead of three. Its auto-merge intent was explicitly cancelled before replacement.
  • The CI regression and the same P2 review finding are addressed by narrowly preserving runtime-event wakes. Local real Gateway image lifecycle reproduced the four-call failure, then passed unchanged with the fix: three planned calls, one actual image request, one outbound image. Loopback NO_PROXY is required by this host's inherited proxy environment; no product config changed. Fixed run: 1/1, Vitest 39.55s; wrapper 139.47s including runtime rebuild.
  • New runtime-event unit cases fail on the initial head (2 failures / 32 passes), then pass with the fix. Final Node 26 scoped suite: 154/154 across mock-openai-input.test.ts, server.authored-turn.test.ts, server.test.ts, and server.fanout-continuation.test.ts; wrapper 33.06s.
  • Targeted standard typecheck, lint, format, and git diff --check pass after the final repair.
  • Fresh canonical independent review of the complete staged repair: scoped-clean, no actionable findings. Full classifier and unchanged producer/consumer context supplied; reviewer did not execute tests.
  • Earlier real isolated Gateway/agent QA message-tool-stranded-final-reply: 1/1, zero failures/skips, one stranded turn recovered with one delivery retry; 18.1s after private runtime build. This is wrapped recovery proof, not a full watchdog-expiry scenario. Real CLI used pinned Bun 1.4.4; focused suite used Node 26.
  • Exact published head: 0087bd46a12f349b4d9d3fc7e81b22b1c0ba26cb. Broad exact-head proof is current PR CI, not prior-head results.

Scope and risk

This fixes a demonstrated QA mechanism, not a claim about the sole cause of a historical qualification failure. Tested source matches the affected QA and recovery modules on the publication base; intervening main changes were disjoint.

Simplification retains one existing classifier, removes broad keyword matching, and adds no state, helper API, or retry machinery. Production +29/-6; tests +164/-0 protect distinct request/recovery boundaries and actual HTTP behavior. The real image lifecycle regression test remains unchanged.

RomneyDa and others added 2 commits November 18, 2026 13:53
Classify only explicit continuations and canonical wrapped recovery instructions, not incidental or negated retry wording. Preserve invalid tool arguments in HTTP regressions and retain completed results during stalled recovery.

Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 089979c7-ab39-4b8e-94c7-76578d8ed178
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review November 18, 2026 13:54
@RomneyDa
RomneyDa enabled auto-merge (squash) November 18, 2026 13:56
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@RomneyDa
RomneyDa disabled auto-merge November 18, 2026 14:07
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR prevents fresh QA requests that mention retry or compaction from reusing older tool results.

Example: An earlier read result precedes a new request to call ls with path="runtime-tool-fixture-missing-directory" and not retry.

  • Before: The mock provider treats “retry” as continuation wording and omits the ls call.
  • After: The mock provider fences the earlier result and issues ls with the requested invalid path.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, focused repair with meaningful HTTP coverage, but a concrete runtime-continuation regression blocks merge.
Proof confidence 🦐 gold shrimp (3/6) This changes QA infrastructure; supplied HTTP regressions exercise the actual mock server, and the body separately reports an isolated Gateway stranded-reply run.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: QA denied-input scenarios can skip their requested tool call because an earlier result is mistaken for completion of the new request.
Reason: This maintainer-authored repair restores a demonstrated QA contract within its existing owner and adds no configuration or public API.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR fixes a real QA classification bug, but its narrower continuation matching drops a canonical runtime follow-up and can restart background image generation.

Priority: P2
Reviewed head: f27fa522549dc3d5912ba99fd1e2e7c58c2c4b4e

Before merge

  • Preserve the canonical runtime-event continuation (P2) - The new predicate rejects Continue the OpenClaw runtime event., which resolveRuntimeContextPromptParts emits for runtime-only events. For an image QA request followed by the image_generate “started” receipt and a failed background completion, this now fences out that receipt. The image completion formatter rejects the failed event, and server.ts then sees the historical image prompt with no completed tool output and issues image_generate again. The base predicate retained the receipt because it matched “Continue”. Recognize this canonical producer form explicitly and add an HTTP regression for the failed-completion case.

Findings

  • [P2] Preserve the canonical runtime-event continuation — extensions/qa-lab/src/providers/mock-openai/mock-openai-input.ts:307-309
Agent review details

How this fits together

QA Lab’s mock OpenAI provider consumes projected conversation messages and tool results, classifies the active turn, and emits scripted tool calls or replies for Gateway scenarios.

flowchart LR
  A[Gateway conversation] --> B[Provider request]
  B --> C[Current request extraction]
  C --> D[Continuation classifier]
  D --> E[Tool result selection]
  E --> F[QA scenario planner]
  F --> G[Tool call or reply]
Loading

Technical review

Best possible solution:

Keep the existing classifier and narrowly preserve canonical runtime-event continuations alongside the fresh-request fencing repair.

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

The base predicate demonstrably treats “do not retry” as a continuation, and the supplied HTTP regressions exercise the omitted-call path; no target code was executed during this review.

Is this the best way to solve the issue?

Narrowing the existing owner is the right approach, but its accepted forms must include the runtime’s canonical event prompt to avoid losing completed tool receipts.

Full review comments:

  • [P2] Preserve the canonical runtime-event continuation — extensions/qa-lab/src/providers/mock-openai/mock-openai-input.ts:307-309
    The new predicate rejects Continue the OpenClaw runtime event., which resolveRuntimeContextPromptParts emits for runtime-only events. For an image QA request followed by the image_generate “started” receipt and a failed background completion, this now fences out that receipt. The image completion formatter rejects the failed event, and server.ts then sees the historical image prompt with no completed tool output and issues image_generate again. The base predicate retained the receipt because it matched “Continue”. Recognize this canonical producer form explicitly and add an HTTP regression for the failed-completion case.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.95

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 096cf7cb6823.

Provenance checked

  • Continuation matching and authored-request boundaries changes intended behavior with a stated reason (improve(ci): avoid duplicate release source guard scans #200379: The earlier repair extracted the current request so runtime guidance and quoted history could not expose stale tool results; older history also deliberately retained real continuations.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test extensions/qa-lab/src/providers/mock-openai/mock-openai-input.test.ts extensions/qa-lab/src/providers/mock-openai/server.authored-turn.test.ts extensions/qa-lab/src/providers/mock-openai/server.test.ts extensions/qa-lab/src/providers/mock-openai/server.fanout-continuation.test.ts --maxWorkers=1
  • git diff --check

What I checked:

PR surface

Source +18, Tests +147. Total +165 across 3 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 1 24 6 +18
Tests 2 147 0 +147
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 171 6 +165

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The bug affects QA scenario correctness and qualification reliability with limited direct user impact.
  • add merge-risk: 🚨 automation: Misclassifying an internal completion can make the QA provider replay image generation and invalidate automated lifecycle scenarios.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The bug affects QA scenario correctness and qualification reliability with limited direct user impact.
  • merge-risk: 🚨 automation: Misclassifying an internal completion can make the QA provider replay image generation and invalidate automated lifecycle scenarios.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 18, 2026, 9:11 AM ET / 14:11 UTC.

RomneyDa and others added 2 commits November 18, 2026 14:16
OpenClaw-Publication: 1f1acf85-cdf7-434f-874f-e42680a73a88
@RomneyDa
RomneyDa merged commit 9b55dc8 into main Nov 18, 2026
138 checks passed
@RomneyDa
RomneyDa deleted the openclaw/land-frv11-lifecycle-ordering branch November 18, 2026 14:34
@RomneyDa

Copy link
Copy Markdown
Member Author

Merged via squash.

RomneyDa added a commit that referenced this pull request Nov 18, 2026
* fix(qa): fence old tool outputs at authored requests

Classify only explicit continuations and canonical wrapped recovery instructions, not incidental or negated retry wording. Preserve invalid tool arguments in HTTP regressions and retain completed results during stalled recovery.

Co-authored-by: RomneyDa <[email protected]>

* fix(qa): fence old tool outputs at authored requests

OpenClaw-Publication: 089979c7-ab39-4b8e-94c7-76578d8ed178

* fix(qa): retain tool output across runtime event wakes

Co-authored-by: RomneyDa <[email protected]>

* Publish openclaw/land-frv11-lifecycle-ordering

OpenClaw-Publication: 1f1acf85-cdf7-434f-874f-e42680a73a88

---------

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 9b55dc8)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
* fix(qa): fence old tool outputs at authored requests

Classify only explicit continuations and canonical wrapped recovery instructions, not incidental or negated retry wording. Preserve invalid tool arguments in HTTP regressions and retain completed results during stalled recovery.

Co-authored-by: RomneyDa <[email protected]>

* fix(qa): fence old tool outputs at authored requests

OpenClaw-Publication: 089979c7-ab39-4b8e-94c7-76578d8ed178

* fix(qa): retain tool output across runtime event wakes

Co-authored-by: RomneyDa <[email protected]>

* Publish openclaw/land-frv11-lifecycle-ordering

OpenClaw-Publication: 1f1acf85-cdf7-434f-874f-e42680a73a88

---------

Co-authored-by: RomneyDa <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
* improve(ci): avoid duplicate release source guard scans

* fix(ci): classify recovery browser test server ownership (#200402)

(cherry picked from commit a62e4e1)

* fix(ci): restore package harness startup

Copy the runtime process dependency manifest into the dependency-free packaging fixture so the CLI reaches argument validation. The existing startup assertion continues to reject missing modules.

(cherry picked from commit 84262af)

* test(facetime): preserve child process exports in audio fixture (#200419)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 36549cb)

* test(browser): align fixtures with navigation and CLI contracts (#200428)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit d0daf88)

* fix: restore Codex qualification fixture contracts (#200450)

* fix: restore Codex run-attempt qualification coverage

Use the complete typed transcript recorder fixtures and assert post-acceptance submission after prompt persistence, matching #199695. No production behavior or timeout changes.

Co-authored-by: RomneyDa <[email protected]>

* test: align Codex refresh callback fixtures

Co-authored-by: RomneyDa <[email protected]>

---------

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 8f0d03f)

* fix(crabbox): join heartbeat command cleanup before retirement (#200466)

(cherry picked from commit 6247dc4)

* fix(agents): retain ambiguous completed-answer receipts

* fix(qa): ignore workspace context when detecting continuation

---------

Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 60e0e21)
Release adaptation: Preserve baseline authored-request continuation classifier and extractToolOutput import; newer #201244 behavior already exists. Apply runtime-context split and regression without downgrading it.:
Backport review: #201130 selected by sibling; #201331 and #198760 are independent package script changes. #201244 classifier already present-equivalent on baseline.:
(cherry picked from commit ad2ae0e0e2bf242ab0df9f9ca29f4f848caf478c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant