Skip to content

fix(qa): cache stability validation rejects native Codex truncation - #158454

Merged
RomneyDa merged 1 commit into
mainfrom
fix/frv-codex-current-20260925
Sep 26, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
fix/frv-codex-current-20260925

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes: the large-tool-result cache stability QA scenario rejects valid Codex tool-history truncation when its output has no warning header.

Maintainer-authorized follow-up to Full Release Validation run 36073359097 and its runtime-pair soak failure. Publication for hosted CI and review was explicitly requested after the local review connection failure; this is not a request to merge or restart release validation.

User Impact

No production behavior changes. Release validation recognizes genuinely capped Codex results while retaining positive truncation counts, read-call/tool/path correlation, fixture-content checks, and later prompt-retention evidence. No schema, timeout, budget, or migration changes; no user action.

Why This Change Was Made

Native Codex history truncation emits …N tokens truncated… or …N chars truncated… without the separate formatted-output warning header. Accept that positive-count marker only in the correlated tool output. Existing OpenClaw cap markers remain supported. The regression executes the actual YAML assertion actions through the scenario flow runner instead of copying the predicate.

Directly inspected sibling Codex source at d47e5cc0e2bbd35774dff15c83570519735d2ac4: codex-rs/core/src/tools/handlers/dynamic.rs:156-168, codex-rs/core/src/context_manager/history.rs:570-581, codex-rs/utils/output-truncation/src/lib.rs:12-29,89-134, and codex-rs/utils/string/src/truncate.rs:131-136. The dynamic handler returns content items; history truncation calls truncate_function_output_items_with_policy and truncate_text, not the formatted wrapper.

Evidence

  • Red: the unchanged scenario rejected both headerless native markers with large capped read cache evidence was not observed; the other 11 original cases passed. The scenario, runner, catalog, and test support remain unchanged between branch base 0e56c40dcf6d96c0ca5acb30b98ed835e31da2f5 and inspected main b74bd07a2fb. No matching existing repair PR was found.
  • Green: 120 tests across the cache regression, scenario-flow runner, and scenario catalog passed before the final TypeScript narrowing fix. Final-source focused replay passed 16/16, 11.71 seconds wrapper wall (9.99 seconds Vitest duration); the 16 displayed case timings total 617 ms (first case 584 ms, remaining cases 2–3 ms). Vitest attributes 75% to transform, 13% to imports, 7% to tests; compiler-cache preparation alone took 5.266 seconds. This is not an 11.71-second assertion body. Cases cover native token/character and formatted markers, existing caps, absent/malformed/zero counts, markers outside tool output, mismatched call/tool/path, absent fixture content, and missing later prompt evidence.
  • Formatting, git diff --check, and import-cycle checks passed. The broader changed-scope run passed its guards and core typecheck, then found TS18046 in the new test; final source narrows the unknown action before reading set. Final-source extension typecheck replay (node scripts/run-tsgo.mjs -b tsconfig.extensions.projects.json) passed; the full changed-scope run is not claimed green.
  • Review: ClawSweeper reviewed this exact head on September 26 at 00:01 UTC: no actionable code findings, platinum patch quality, gold proof/overall because an actual runtime-pair result is absent. Final local autoreview remains blocked by proxy CONNECT 403; no local clean verdict is claimed.
  • Hosted CI: run 36202775211 completed success on exact head 34f3da3746f79304d60ef3ea72b30d5d62ff4829; the PR openclaw/ci-gate is SUCCESS. The changed-extension shard passed; its individual test timing cannot be retrieved because the Actions log download is Forbidden.
  • Runtime proof attempt, September 26: built this clean exact-head checkout with OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build qaRuntime successfully (44.5 s build phases), then ran the canonical single-scenario command below against actual built Gateway processes. The lockfile-managed released Codex binary is 0.155.1 (version probe passed). Blocked before scenario execution / before the Codex cell: QA channel polling received HTTP 502, body Secret egress proxy refused the request.; its channel log reports qa-bus /v1/poll: malformed JSON response. A same-route native Node HTTP POST reproduced that exact response. No proxy, credential, allowlist, provider route, or assertion was changed. The blocked suite and its isolated Gateway were stopped.
  • Other permitted proof routes checked: the configured Crabbox backend is Blacksmith Testbox; its read-only list request returned Forbidden, so no lease or workflow was started. The existing Release Checks and QA Profile Evidence workflow schemas, inspected at trusted-main 770a8d48871591e77c86df70cadbe34e7c6299b7, do not expose a single runtime-pair scenario selector (release QA parity selects complete core/soak lanes; profile evidence selects whole profiles). No broad FRV/QA replacement was dispatched and no release priority was changed.
  • Remaining external prerequisite: restore the sanctioned QA loopback transport or configured Testbox access, then execute this same exact-head scenario. This attempt is not a passing runtime-pair result, live-provider soak, or release qualification; the requested platinum/diamond proof level is not claimed.
OPENCLAW_BUILD_PRIVATE_QA=1 OPENCLAW_ENABLE_PRIVATE_QA_CLI=1 \
  pnpm openclaw qa suite --provider-mode mock-openai --concurrency 1 \
  --runtime-pair openclaw,codex \
  --scenario runtime-long-context-cache-stability \
  --output-dir .artifacts/qa-e2e/pr-158454-native-runtime-pair

This canonical mock-provider lane executes real runtimes and would exercise the changed correlated request/output assertion; it is distinct from both the synthetic 16-case replay and live-provider inference. No code change or test-case deletion was needed for this evidence update.

Contributor credit: @RomneyDa.

Recognize positive-count native history truncation markers in the correlated tool output while retaining read and follow-up evidence checks.

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

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review September 25, 2026 23:53
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 25, 2026, 8:19 PM ET / September 26, 2026, 00:19 UTC (Revision 2).

ClawSweeper review

What this changes

QA Lab's long-context cache scenario accepts positive-count native Codex truncation markers in correlated read output, with a new test covering its evidence checks.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open. Current main and the latest release still reject headerless native Codex truncation evidence. The patch has no actionable code finding, but the exact-head runtime-pair attempt stopped before the scenario ran, leaving proof sufficiency for the QA owner to decide.

Priority: P2
Reviewed head: 34f3da3746f79304d60ef3ea72b30d5d62ff4829
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused boundary checks and small source-aligned patch are strong; a completed native runtime-pair result would settle the remaining QA uncertainty.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The bot/member contributor proof gate does not apply. The changed YAML assertion was replayed through loaded scenario actions with synthetic debug requests, while the exact-head runtime-pair attempt stopped at QA-bus HTTP 502 before the Codex cell; no after-fix native runtime outcome was observed. No stored-data contract changed.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The bot/member contributor proof gate does not apply. The changed YAML assertion was replayed through loaded scenario actions with synthetic debug requests, while the exact-head runtime-pair attempt stopped at QA-bus HTTP 502 before the Codex cell; no after-fix native runtime outcome was observed. No stored-data contract changed.
Evidence reviewed 10 items Introduced assertion change: The PR accepts a positive native marker only in the correlated tool output while retaining the fixture line and later-prompt checks.
Assertion-boundary regression: Six accepted examples and ten rejected examples execute the loaded YAML evidence actions through the scenario flow runner, including call, tool, path, fixture, and follow-up checks.
Debug trace boundary: The mock provider extracts the current function-call output and its call ID for the debug request inspected by this scenario.
Findings None None.
Security None None.

How this fits together

QA Lab runs repository-defined scenarios against OpenClaw and Codex runtimes. This scenario reads a large fixture, inspects mock-provider tool and prompt traces, and reports whether capped output remains available on a later turn.

flowchart LR
A[Large fixture] --> B[Runtime pair]
B --> C[Tool read output]
C --> D[Mock provider trace]
D --> E[Truncation and call check]
E --> F[Follow-up prompt check]
F --> G[QA pass or fail]
Loading

Decision needed

Question Recommendation
Is the loaded-scenario assertion replay and inspected Codex contract sufficient to merge this QA-only repair without a completed exact-head runtime-pair result? Wait for runtime-pair evidence: Restore sanctioned QA transport or Testbox access and run the single exact-head scenario before merge.

Why: The patch is narrow and focused checks pass, but the recorded transport failure prevented observation of its intended runtime-pair outcome; the acceptable release-validation proof threshold is an owner judgment.

Before merge

  • Resolve merge risk (P1) - The exact-head runtime-pair attempt stopped at QA transport readiness with HTTP 502, so it has not shown that a real Codex read produces the expected marker in the mock provider's correlated tool-output trace.
  • Complete next step (P2) - The QA owner should explicitly accept the focused proof or obtain a passing exact-head single-scenario runtime-pair result before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Tests +104, Other 0. Total +104 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 104 0 +104
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 2 105 1 +104

Review metrics

Metric Value Why it matters
Focused assertion cases 16 cases; 617 ms summed case timings reported The cases cover accepted markers and rejection controls without a per-case runtime boot.

Merge-risk options

Maintainer options:

  1. Prove the runtime-pair result (recommended)
    Run the single scenario on this head after sanctioned QA transport returns and check the Codex debug trace and final assertion result.
  2. Accept focused proof
    Merge with the recorded assertion replay and Codex source evidence while explicitly owning the absent end-to-end QA result.

Technical review

Best possible solution:

Keep the correction in the existing QA scenario and verify its native Codex read and follow-up prompt through the single runtime-pair scenario when sanctioned transport access works.

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

Yes at the assertion boundary: current-main source requires a warning header that native Codex truncation need not supply, and the reported baseline replay rejected headerless markers. A full runtime-pair run has not completed.

Is this the best way to solve the issue?

Yes for the identified assertion defect: the change stays with the existing scenario and its test executes loaded assertion actions. The real runtime trace remains the useful final check.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 automation: The PR changes a QA pass/fail decision whose actual Codex runtime-pair path has not completed after the change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: The defect causes a false failure in a release-validation scenario without changing production runtime behavior.
  • merge-risk: 🚨 automation: The PR changes a QA pass/fail decision whose actual Codex runtime-pair path has not completed after the change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The bot/member contributor proof gate does not apply. The changed YAML assertion was replayed through loaded scenario actions with synthetic debug requests, while the exact-head runtime-pair attempt stopped at QA-bus HTTP 502 before the Codex cell; no after-fix native runtime outcome was observed. No stored-data contract changed.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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.

  • Capture the exact-head single-scenario runtime-pair result when sanctioned QA transport is available.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-26T00:01:46.947Z sha 34f3da3 :: needs maintainer review before merge. :: none

@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Addressed the proof-confidence feedback with an exact-head runtime attempt and updated the PR evidence. Head remains 34f3da3746f79304d60ef3ea72b30d5d62ff4829; hosted CI 36202775211 completed successfully and the required ci-gate is SUCCESS.

The canonical single-scenario runtime-pair build passed, but execution stopped at QA transport readiness: native Node HTTP POST to the isolated QA bus returned HTTP 502, Secret egress proxy refused the request. The configured Blacksmith Testbox read-only preflight also returned Forbidden. Existing hosted QA dispatch schemas do not offer this single-scenario selection; I did not replace it with broad release validation or bypass the denied transport. Owned processes were stopped. This is a concrete external proof blocker, not a passing Codex cell or live-provider result.

Timing clarification from the original log: 11.71 s is wrapper wall time; the 16 displayed test cases total 617 ms, including the 584 ms first case. Compiler-cache preparation was 5.266 s; Vitest attributed 75% to transform, 13% to imports, and 7% to tests. No test cases or assertions were weakened. The overall gold proof limitation remains accurately documented; no rating upgrade is claimed.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 26, 2026
@RomneyDa
RomneyDa enabled auto-merge (squash) September 26, 2026 05:37
@RomneyDa
RomneyDa merged commit a0710b4 into main Sep 26, 2026
321 of 329 checks passed
@RomneyDa
RomneyDa deleted the fix/frv-codex-current-20260925 branch September 26, 2026 05:37
vincentkoc added a commit that referenced this pull request Sep 26, 2026
* 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
  ...
vincentkoc added a commit that referenced this pull request Sep 26, 2026
* 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]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
…58454)

Recognize positive-count native history truncation markers in the correlated tool output while retaining read and follow-up evidence checks.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
* 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]>
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: 🐚 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.

2 participants