Skip to content

fix(qa): complete images when generation tool is unavailable - #116234

Merged
steipete merged 1 commit into
mainfrom
fix/main-qa-image-latest-turn
Jul 30, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/main-qa-image-latest-turn

Conversation

@steipete

@steipete steipete commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where the QA mock provider could miss a completed background image generation when the runtime delivered that completion in its internal context carrier. The mock would then fall back to the earlier user prompt and try to call image_generate again even though that tool was unavailable on the completion turn.

Why This Change Was Made

Completion recognition now reads only the latest raw user turn, which includes the internal runtime carrier, while ordinary prompt selection continues to skip that carrier. This keeps completion handling current-turn scoped and preserves the existing protection against replaying historical completion events.

User Impact

No production runtime behavior changes. Release and QA image-generation scenarios now finish reliably after an asynchronous completion instead of attempting an unavailable duplicate tool call.

Evidence

  • Blacksmith Testbox tbx_01kyrnjx0n2yt3fjgxekkcxmw1: pnpm test extensions/qa-lab/src/providers/mock-openai/server.test.ts — 159/159 tests passed.

  • Regression models the initial image tool call, its async-started output, the internal completion carrier, and a completion turn where only the message tool is available.

  • The after-fix mock-server completion turn produced no image_generate function call and returned exactly:

    Protocol note: generated the QA lighthouse image successfully.
    MEDIA:/tmp/qa-lighthouse.png
    
  • Existing historical-completion regression remains in the same focused suite.

  • Maintainer contract review confirmed extractAllUserTexts(input).at(-1) includes the current internal carrier, while extractLastUserText(input) deliberately retains the prior non-carrier prompt. Inspecting only the latest raw turn preserves the historical non-replay invariant.

  • Autoreview: clean, no accepted or actionable findings.

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

clawsweeper Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 12:53 AM ET / 04:53 UTC.

ClawSweeper review

What this changes

The PR makes the QA mock provider inspect the latest raw user turn for an internal completed-image carrier while preserving carrier-free prompt selection, with a regression test for an unavailable image-generation tool on the completion turn.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

Keep this PR open for the normal protected-label maintainer review path. The supplied diff is narrowly targeted at QA mock completion handling and includes a focused regression, but a read-only shell failure prevented the required current-main, scoped-policy, history, and maintainer-note inspection needed for a high-confidence merge verdict.

Priority: P3
Reviewed head: 887b6d46373f5b816029c224423018c18c7a0ad9
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is small and plausibly targeted, but the available proof is mock/test-only and direct contract review was unavailable.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR reports a focused Testbox test run and a synthetic mock-server regression, but no independently inspectable after-fix runtime transcript, terminal output, or artifact was supplied; redact private details before posting any added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports a focused Testbox test run and a synthetic mock-server regression, but no independently inspectable after-fix runtime transcript, terminal output, or artifact was supplied; redact private details before posting any added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 4 items Narrow changed decision point: The PR changes the completion detector to read the last raw user text while retaining the existing carrier-filtered prompt extraction; the supplied patch anchors this behavior at the assistant-text construction path.
Regression scenario: The supplied PR patch extends the mock-server test through an initial image tool call, asynchronous completion output, an internal completion carrier, and a completion turn exposing only the message tool.
Provided focused validation: The PR body reports Blacksmith Testbox focused coverage for the mock OpenAI server suite with 159 passing tests, but this is mock/test evidence rather than independently inspected after-fix runtime output.
Findings None None.
Security None None.

How this fits together

QA Lab's mock OpenAI provider turns synthetic Responses API inputs into deterministic assistant output for release and channel scenarios. It must distinguish the visible user prompt used to choose a response from internal runtime completion events that tell the mock to return generated media instead of requesting another tool call.

flowchart TD
  A[QA scenario input] --> B[Mock OpenAI provider]
  B --> C[Visible prompt selection]
  B --> D[Latest raw user turn]
  D --> E[Internal image completion detection]
  E -->|completed media found| F[Return media completion]
  E -->|no completion| G[Normal tool or message response]
  F --> H[QA scenario result]
  G --> H
Loading

Decision needed

Question Recommendation
Does the protected maintainer review path approve this narrowly scoped QA mock-provider regression fix after confirming the raw-user-text helper preserves the existing historical-completion invariant? Approve after focused contract check: Confirm the helper's raw-turn semantics and the regression path, then accept the focused QA-only fix.

Why: The maintainer label prevents automated cleanup, and the unavailable read-only inspection prevents a reliable independent determination of the helper contract and current-main ownership boundary.

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports a focused Testbox test run and a synthetic mock-server regression, but no independently inspectable after-fix runtime transcript, terminal output, or artifact was supplied; redact private details before posting any added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The focused test claim does not itself provide independently inspectable after-fix runtime output, and the required current-main/caller/history review could not be completed from the read-only environment.
  • Complete next step (P2) - The protected maintainer label and incomplete direct contract inspection require normal human review rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Source +1, Tests +26. Total +27 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 36 10 +26
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 38 11 +27

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/qa-lab/src/providers/mock-openai/server.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the narrow raw-turn completion check, confirm its helper contract against sibling input parsing and historical-completion tests, then merge only after a maintainer accepts the proof and remaining CI for this exact head.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the narrow raw-turn completion check, confirm its helper contract against sibling input parsing and historical-completion tests, then merge only after a maintainer accepts the proof and remaining CI for this exact head.

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

Unclear for a live runtime reproduction; the supplied regression test models the reported path, so the QA mock behavior is source-reproducible but was not independently exercised in this review.

Is this the best way to solve the issue?

Unclear; separating latest raw completion-carrier detection from carrier-filtered prompt selection appears appropriately narrow, but the helper's full caller and sibling contract still needs direct inspection before calling it the best fix.

AGENTS.md: unclear because the file could not be read completely.

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

Labels

Label changes:

  • add P3: This is a narrowly scoped QA/release-scenario reliability repair with no claimed production-runtime behavior change.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports a focused Testbox test run and a synthetic mock-server regression, but no independently inspectable after-fix runtime transcript, terminal output, or artifact was supplied; redact private details before posting any added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P3: This is a narrowly scoped QA/release-scenario reliability repair with no claimed production-runtime behavior change.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports a focused Testbox test run and a synthetic mock-server regression, but no independently inspectable after-fix runtime transcript, terminal output, or artifact was supplied; redact private details before posting any added proof. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: The provided context identifies steipete as author of the current focused QA mock-provider commit, and the PR carries the maintainer review label; current-main feature-history ownership could not be independently traced in this review. (role: likely follow-up owner; confidence: low; commits: 887b6d46373f; files: extensions/qa-lab/src/providers/mock-openai/mock-openai-assistant-text.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.

  • Add redacted after-fix mock-server output or a harness transcript showing media completion on the message-only turn.
  • Have the protected maintainer review confirm the raw-user-text helper contract and remaining CI on the current head.

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.

@steipete
steipete merged commit 353c05d into main Jul 30, 2026
205 of 213 checks passed
@steipete
steipete deleted the fix/main-qa-image-latest-turn branch July 30, 2026 05:09
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 30, 2026
vincentkoc added a commit to Hackerismydream/openclaw that referenced this pull request Jul 30, 2026
* origin/main: (24 commits)
  fix(e2e): apply default service identity per flow (openclaw#116265)
  chore(android): record 2026.7.4 Play metadata
  fix(ci): accept one verified Telegram SUT launch (openclaw#116267)
  chore(android): prepare 2026.7.4 Play release
  fix(e2e): align service account state (openclaw#116254)
  refactor(qa): remove live-channel scenario registries and wrappers (openclaw#115752)
  fix(ci): let trusted Telegram QA stage runtime (openclaw#116252)
  fix(plugins): plugin install survives pnpm-only overrides (openclaw#116245)
  test(qa): recognize internal image completions (openclaw#116234)
  fix(test): review Codex runtime scan chunks (openclaw#116212)
  fix(systemd): clear start-limit latch before gateway start (openclaw#116178)
  fix(security): expose every executable call in plugin scans (openclaw#116222)
  chore(sdk): repin the API baseline after the resolver signature change
  test(e2e): delay the draft-proof final answer past the start gate
  fix(channels): resolve tool progress against the caller's stream mode
  fix(ci): satisfy docs formatting, lint, and the SDK API baseline
  test(e2e): add a progress-draft scenario to the mock provider
  docs(telegram): call out the changed default preview on upgrade
  refactor(channels): render the progress label as a block, not a line
  fix(channels): show tool lines under the progress status headline
  ...
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant