Skip to content

fix(qa): count Code Mode nested tool activity as transcript tool evidence - #155976

Merged
steipete merged 1 commit into
mainfrom
fix/runtime-tool-transcript-evidence
Sep 22, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/runtime-tool-transcript-evidence

Conversation

@steipete

@steipete steipete commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Unblocks the 2026.9.6 Full Release Validation runtime-pair core lane: runtime-tool-{web-fetch,web-search,session-status,sessions-spawn} failed in the OpenClaw cell with timed out after 5000ms waiting for persisted <tool> transcript evidence (runs 35742760135, 35760444831, 35775979903, and locally).

Root cause

Not a product regression; transcripts are persisted. #155614 made an absent tools.codeMode behave as "auto", so openai/gpt-5.6-luna (catalog codeMode: "preferred") now runs these fixtures through Code Mode in the OpenClaw runtime. The mock provider correctly wraps the planned web_fetch call in a guest exec (qa-code-mode-target: marker), the product executes it, and the session transcript records:

  • the assistant exec tool call and its toolResult ({"status":"completed", "value": {...web_fetch result...}}), and
  • a custom row openclaw.nested-tool.v1 whose details name the nested web_fetch call (toolCallId, toolName, input, result, isError).

summarizeSessionTranscriptEvents (qa-lab) only counted toolResult rows correlated with assistant tool calls by name, so completedToolCallCounts.web_fetch stayed 0 and waitForPersistedTranscriptToolEvidence timed out even though the product had done the work. The Codex cell still calls web_fetch directly and passed, which is why the scenario read as "OpenClaw lost the transcript".

Same family as #155811 (compaction-retry terminal evidence keyed on the exec surface).

Fix

  • extensions/qa-lab/src/suite-runtime-agent-session.ts: Code Mode nested tool activity rows feed the same planned/completed/successful accounting as direct tool results, keyed on the nested toolCallId/toolName/isError/timestamp.
  • Unit test: nested web_fetch activity under an exec call counts one completed success and one completed failure, alongside the exec result itself.

Proof

  • Repro on origin/main (8e185919954): qa suite --provider-mode mock-openai --runtime-pair openclaw,codex --scenario runtime-tool-web-fetch fails the openclaw cell with the 5s transcript-evidence timeout; the preserved agent DB shows 11 persisted transcript rows for the happy session including the nested web_fetch activity with a 200 result.
  • With this change: qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6-luna --alt-model openai/gpt-5.6-luna-alt --runtime-pair openclaw,codex --scenario runtime-tool-web-fetch --scenario runtime-tool-web-search --scenario runtime-tool-session-status --scenario runtime-tool-sessions-spawn passes 4/4 (openclaw cells: toolCalls=4/4/4/6, codex cells: toolCalls=2; drift step pass).
  • Unit: suite-runtime-agent-session.test.ts (new nested-tool case + existing), suite-runtime-agent-process.test.ts + runtime-tool-fixture.test.ts (100 passed).

…ence

Since #155614 made an absent tools.codeMode behave as "auto", preferred
models run the runtime-tool fixtures through Code Mode in the OpenClaw
runtime. The product persists the nested target call as an
openclaw.nested-tool.v1 transcript row, but the QA transcript summary only
counted direct toolResult rows, so waitForPersistedTranscriptToolEvidence
timed out for web_fetch, web_search, session_status and sessions_spawn even
though the work was done and persisted.
@clawsweeper

clawsweeper Bot commented Sep 22, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed September 22, 2026, 6:04 PM ET / 22:04 UTC.

ClawSweeper review

What this changes

Updates QA Lab’s transcript reader to count completed nested Code Mode tools and adds regression coverage for successful and failed calls.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This remains a useful QA repair: current main still misses the persisted evidence, and the related merged fix addresses a different assertion. No introduced correctness defect was found; the maintainer-authored PR remains protected from cleanup.

Priority: P2
Reviewed head: b7639c8ba8ac16d47293c0e18fd27369f89cfa6c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-consistent repair with meaningful regression coverage and no blocking code findings; the promised scenario validation remains pending.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its QA reader change has source-backed regression coverage, but the captured body still marks after-fix runtime scenarios pending; related settings screenshots do not cover this path. No persisted format changes require migration proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its QA reader change has source-backed regression coverage, but the captured body still marks after-fix runtime scenarios pending; related settings screenshots do not cover this path. No persisted format changes require migration proof.
Evidence reviewed 9 items Introduced patch: The pinned merge-base-to-head diff changes only QA transcript accounting and its regression test; unrelated endpoint drift was excluded.
Current main still needs the repair: The affected reader is unchanged between the merge base and fetched main. It processes direct toolResult messages but skips custom nested-tool activity, leaving the target tool's completed count at zero. No shipped fix is established; the supplied latest-release object was unavailable for local inspection.
Canonical nested activity contract: OpenClaw's terminal nested-tool producer records toolCallId, toolName, isError, and completion timestamp in details. The patch reads those fields and retains completion deduplication, error exclusion, and bounded event history. This consumes existing persisted data without changing its format.
Findings None None.
Security None None.

How this fits together

QA Lab reads persisted agent transcripts to verify that scenario tools actually completed. Its summary feeds the checks that decide whether runtime validation passes or times out.

flowchart LR
  A[Agent executes tools] --> B[Persisted transcript]
  B --> C[Direct tool results]
  B --> D[Nested tool activity]
  C --> E[QA transcript summary]
  D --> E
  E --> F[Completion and success checks]
  F --> G[Scenario passes or times out]
Loading

Before merge

  • Complete next step (P2) - Complete the four runtime-tool validations marked pending in the captured PR body and record their results plus the focused regression-test runtime.
Agent review details

Security

None.

PR surface

Source +22, Tests +60. Total +82 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 28 6 +22
Tests 1 60 0 +60
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 88 6 +82

Review metrics

None.

Technical review

Best possible solution:

Keep one QA transcript summary that recognizes both direct results and OpenClaw’s existing nested terminal activity while preserving failure and duplicate-result checks.

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

Yes, from source: a persisted custom nested-tool result is skipped by current main, so the runtime scenario's target-tool completion check cannot succeed. The body reports this failure, but no runtime reproduction was executed during this review.

Is this the best way to solve the issue?

Yes. Adapting the existing QA reader to the canonical terminal activity format fixes the observation error without changing product execution, transcript storage, or scenario timeouts.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2299989bf447.

Labels

Label changes:

  • add P2: Repairs false transcript-evidence failures in release QA without changing user-facing runtime behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its QA reader change has source-backed regression coverage, but the captured body still marks after-fix runtime scenarios pending; related settings screenshots do not cover this path. No persisted format changes require migration proof.

Label justifications:

  • P2: Repairs false transcript-evidence failures in release QA without changing user-facing runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate. Its QA reader change has source-backed regression coverage, but the captured body still marks after-fix runtime scenarios pending; related settings screenshots do not cover this path. No persisted format changes require migration proof.

Evidence

What I checked:

  • Introduced patch: The pinned merge-base-to-head diff changes only QA transcript accounting and its regression test; unrelated endpoint drift was excluded. (extensions/qa-lab/src/suite-runtime-agent-session.ts:197, b7639c8ba8ac)
  • Current main still needs the repair: The affected reader is unchanged between the merge base and fetched main. It processes direct toolResult messages but skips custom nested-tool activity, leaving the target tool's completed count at zero. No shipped fix is established; the supplied latest-release object was unavailable for local inspection. (extensions/qa-lab/src/suite-runtime-agent-session.ts:182, 2299989bf447)
  • Canonical nested activity contract: OpenClaw's terminal nested-tool producer records toolCallId, toolName, isError, and completion timestamp in details. The patch reads those fields and retains completion deduplication, error exclusion, and bounded event history. This consumes existing persisted data without changing its format. (src/agents/embedded-agent-runner/run/attempt-tool-search-executor.ts:66, b7639c8ba8ac)
  • Actual failing consumer: The runtime scenario waits for completedToolCallCounts and optionally successfulToolCallCounts for the requested tool. Recognizing nested terminal activity repairs this existing check without increasing its timeout or weakening its success condition. (extensions/qa-lab/src/suite-runtime-agent-process.ts:358, b7639c8ba8ac)
  • Regression coverage: The new test writes nested success and failure records through the existing transcript storage helper, then checks the public QA summary alongside the outer exec result. Existing tests cover direct-result correlation, duplicate results, finite timestamps, event bounds, and cursors. Tests were inspected, not executed, under the read-only review constraint; diff whitespace validation passed. (extensions/qa-lab/src/suite-runtime-agent-session.test.ts:645, b7639c8ba8ac)
  • Implementation boundary: The documentation identifies nested activity persistence as an OpenClaw runtime responsibility and excludes reuse of Codex Code Mode internals. The introduced patch reads that OpenClaw format; the body mentions Codex only as the unchanged comparison cell, so sibling Codex inspection is not required. Public docs: docs/tools/code-mode/internals.md. (docs/tools/code-mode/internals.md:62, b7639c8ba8ac)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the pending runtime-tool scenario results and focused regression-test timing in the PR body.

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 self-assigned this Sep 22, 2026
@steipete
steipete merged commit 188b8cc into main Sep 22, 2026
119 checks passed
@steipete
steipete deleted the fix/runtime-tool-transcript-evidence branch September 22, 2026 22:13
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 22, 2026
* commit '7d7f977ccfc1ac177526232e4f4960febd010015': (91 commits)
  test: avoid unused target setup in package profile fixtures (#155972)
  fix(worktrees): batch snapshot metadata reads
  test(plugin-state): distinguish borrowed and foreign lifecycle owners
  refactor(agents): share external harness session and attempt machinery (#152181)
  chore(i18n): refresh native locales (#156006)
  chore(test): retain Doctor fixture settlement diagnostics (#155944)
  perf(codex): reuse unchanged inference request bytes (#155987)
  perf(test): prepare snapshot ownership subprocess imports (#155973)
  perf(test): consolidate channel registry coverage (#155014)
  fix(runtime): preserve Node worker dependencies and cleanup diagnostics (#155292)
  perf(test): prepare worktree GC child runtime (#155928)
  fix(ui): open browser cards after delayed panel renders (#153253)
  fix(update): retain the running updater by hard link instead of copying the package (#155977)
  feat(decisions): add explicit evaluation and Labs opt-in foundation (#155134)
  fix(state): preserve lifecycle custody across worker dispatch
  improve: reuse shared tooling fixtures and defer legacy updater proof (#155731)
  improve(ui): reduce real-Gateway test preparation (#155979)
  perf(state): move session RPC SQL off the Gateway main thread (#155740)
  docs(freebsd): explain native Codex runtime limits (#155980)
  fix(qa): count Code Mode nested tool activity as transcript tool evidence (#155976)
  ...
steipete added a commit that referenced this pull request Sep 23, 2026
…ence (#155976)

## Summary

Unblocks the 2026.9.6 Full Release Validation runtime-pair core lane: `runtime-tool-{web-fetch,web-search,session-status,sessions-spawn}` failed in the OpenClaw cell with `timed out after 5000ms waiting for persisted <tool> transcript evidence` (runs 35742760135, 35760444831, 35775979903, and locally).

## Root cause

Not a product regression; transcripts are persisted. #155614 made an absent `tools.codeMode` behave as `"auto"`, so `openai/gpt-5.6-luna` (catalog `codeMode: "preferred"`) now runs these fixtures through Code Mode in the OpenClaw runtime. The mock provider correctly wraps the planned `web_fetch` call in a guest `exec` (`qa-code-mode-target:` marker), the product executes it, and the session transcript records:

- the assistant `exec` tool call and its `toolResult` (`{"status":"completed", "value": {...web_fetch result...}}`), and
- a `custom` row `openclaw.nested-tool.v1` whose `details` name the nested `web_fetch` call (`toolCallId`, `toolName`, `input`, `result`, `isError`).

`summarizeSessionTranscriptEvents` (qa-lab) only counted `toolResult` rows correlated with assistant tool calls by name, so `completedToolCallCounts.web_fetch` stayed 0 and `waitForPersistedTranscriptToolEvidence` timed out even though the product had done the work. The Codex cell still calls `web_fetch` directly and passed, which is why the scenario read as "OpenClaw lost the transcript".

Same family as #155811 (compaction-retry terminal evidence keyed on the exec surface).

## Fix

- `extensions/qa-lab/src/suite-runtime-agent-session.ts`: Code Mode nested tool activity rows feed the same planned/completed/successful accounting as direct tool results, keyed on the nested `toolCallId`/`toolName`/`isError`/`timestamp`.
- Unit test: nested `web_fetch` activity under an `exec` call counts one completed success and one completed failure, alongside the `exec` result itself.

## Proof

- Repro on origin/main (`8e185919954`): `qa suite --provider-mode mock-openai --runtime-pair openclaw,codex --scenario runtime-tool-web-fetch` fails the openclaw cell with the 5s transcript-evidence timeout; the preserved agent DB shows 11 persisted transcript rows for the happy session including the nested `web_fetch` activity with a 200 result.
- With this change: `qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6-luna --alt-model openai/gpt-5.6-luna-alt --runtime-pair openclaw,codex --scenario runtime-tool-web-fetch --scenario runtime-tool-web-search --scenario runtime-tool-session-status --scenario runtime-tool-sessions-spawn` passes 4/4 (openclaw cells: toolCalls=4/4/4/6, codex cells: toolCalls=2; drift step pass).
- Unit: `suite-runtime-agent-session.test.ts` (new nested-tool case + existing), `suite-runtime-agent-process.test.ts` + `runtime-tool-fixture.test.ts` (100 passed).
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…ence (openclaw#155976)

## Summary

Unblocks the 2026.9.6 Full Release Validation runtime-pair core lane: `runtime-tool-{web-fetch,web-search,session-status,sessions-spawn}` failed in the OpenClaw cell with `timed out after 5000ms waiting for persisted <tool> transcript evidence` (runs 35742760135, 35760444831, 35775979903, and locally).

## Root cause

Not a product regression; transcripts are persisted. openclaw#155614 made an absent `tools.codeMode` behave as `"auto"`, so `openai/gpt-5.6-luna` (catalog `codeMode: "preferred"`) now runs these fixtures through Code Mode in the OpenClaw runtime. The mock provider correctly wraps the planned `web_fetch` call in a guest `exec` (`qa-code-mode-target:` marker), the product executes it, and the session transcript records:

- the assistant `exec` tool call and its `toolResult` (`{"status":"completed", "value": {...web_fetch result...}}`), and
- a `custom` row `openclaw.nested-tool.v1` whose `details` name the nested `web_fetch` call (`toolCallId`, `toolName`, `input`, `result`, `isError`).

`summarizeSessionTranscriptEvents` (qa-lab) only counted `toolResult` rows correlated with assistant tool calls by name, so `completedToolCallCounts.web_fetch` stayed 0 and `waitForPersistedTranscriptToolEvidence` timed out even though the product had done the work. The Codex cell still calls `web_fetch` directly and passed, which is why the scenario read as "OpenClaw lost the transcript".

Same family as openclaw#155811 (compaction-retry terminal evidence keyed on the exec surface).

## Fix

- `extensions/qa-lab/src/suite-runtime-agent-session.ts`: Code Mode nested tool activity rows feed the same planned/completed/successful accounting as direct tool results, keyed on the nested `toolCallId`/`toolName`/`isError`/`timestamp`.
- Unit test: nested `web_fetch` activity under an `exec` call counts one completed success and one completed failure, alongside the `exec` result itself.

## Proof

- Repro on origin/main (`9b0fb911a05`): `qa suite --provider-mode mock-openai --runtime-pair openclaw,codex --scenario runtime-tool-web-fetch` fails the openclaw cell with the 5s transcript-evidence timeout; the preserved agent DB shows 11 persisted transcript rows for the happy session including the nested `web_fetch` activity with a 200 result.
- With this change: `qa suite --provider-mode mock-openai --concurrency 1 --model openai/gpt-5.6-luna --alt-model openai/gpt-5.6-luna-alt --runtime-pair openclaw,codex --scenario runtime-tool-web-fetch --scenario runtime-tool-web-search --scenario runtime-tool-session-status --scenario runtime-tool-sessions-spawn` passes 4/4 (openclaw cells: toolCalls=4/4/4/6, codex cells: toolCalls=2; drift step pass).
- Unit: `suite-runtime-agent-session.test.ts` (new nested-tool case + existing), `suite-runtime-agent-process.test.ts` + `runtime-tool-fixture.test.ts` (100 passed).
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
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. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant