Skip to content

fix(test): align recovery and history fixtures with runtime contracts - #139733

Merged
steipete merged 2 commits into
mainfrom
codex/fix-runtime-e2e-main
Sep 6, 2026
Merged

steipete merged 2 commits into
mainfrom
codex/fix-runtime-e2e-main

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139753, #139715

What Problem This Solves

Resolves false runtime-validation failures after bounded same-model recovery became the default. Provider-selection fixtures spend their deadlines retrying a temporary outage, Telegram settlement waits for an outage that has not become terminal, and the repeated-request test rejects a real timeout because its diagnostic duration starts later than the timeout clock.

Also repairs the Gateway history fixture interaction between #139715 and #139753: the paging fixture still supplied the two old projection-state field names after the projection contract renamed them, causing the required core test-type stripe to fail.

Why This Change Was Made

Use model_not_found to exercise selected-provider and fallback-provider hooks directly. The Telegram fixture still returns HTTP 500 and permits one real continuation, then supplies a provider retry hint beyond the existing recovery window. It preserves the exact detailed error reply and raw-error redaction, and verifies that continuation retains the request on the same model.

Recognize the repeated-request timeout from its explicit diagnostic classification, require a terminal error with endedAt, and classify continuation requests from their retained transcript. Keep the existing stall guard, no forced recovery, and exactly one successful queued followup. All timeout budgets remain unchanged.

Rename the history fixture's two obsolete keys to assistantErrorPending and assistantErrorRecoveryObserved, preserving their false values and every pagination assertion.

User Impact

No runtime behavior changes. Maintainer validation exercises the current continuation, settlement, and projection contracts. The separate intermittent port collision did not reproduce locally; port allocation remains unchanged and no repair is claimed for it.

Evidence

On the unchanged original base, both selected-provider cases exceeded their existing 45-second deadlines and Telegram made 18 provider requests without a settlement send. The hosted repeated-request failure recorded an explicit timeout at 89,950 ms; its duration was shorter than the request deadline because the clocks begin at different boundaries.

All five focused runtime E2E tests passed on reviewed head 85cc7c34e37, including the 429.9-second repeated-request run. The second rebase was patch-identical and retained the exercised retry, timeout, mock-provider, and Telegram delivery implementations. Nearby optional widget-authoring forwarding is unused by these fixtures; Telegram import changes only removed a re-export layer.

The Gateway-root typecheck reproduces TS2353 before the two-key correction and passes afterward. All 30 history tests pass before and after with unchanged assertions. The formerly failing suppression-inventory test passes 2/2 after incorporating main's correction from #139747.

Full check:changed, formatting, and git diff --check pass. Independent review of the recovery repairs and a fresh review of the two-key correction have no actionable findings through P2. Fresh CI on the final pushed head remains the merge gate.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 04:32
@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 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 1:53 AM ET / 05:53 UTC.

ClawSweeper review

What this changes

Updates recovery test fixtures and history projection fields to validate same-model continuation, terminal failure settlement, provider fallback, and pagination without increasing timeout budgets.

Merge readiness

✅ Ready for maintainer review

Keep open: the recovery fixture repairs remain useful on current main, and no introduced correctness defect was found. The history-field correction is already present on main. This maintainer-protected PR is not eligible for cleanup closure.

Priority: P2
Reviewed head: a4f43880f73d15167b1190a190b562177d82a3a5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, contract-supported test repair with preserved behavioral assertions and no actionable correctness findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored proof exemption applies. These test changes exercise Gateway recovery and Telegram settlement through controlled HTTP responses; the body reports focused passes, but no production behavior or authority boundary changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored proof exemption applies. These test changes exercise Gateway recovery and Telegram settlement through controlled HTTP responses; the body reports focused passes, but no production behavior or authority boundary changes.
Evidence reviewed 8 items Verified introduced scope: The pinned merge-base-to-head delta contains only the four supplied test files. Production code, dependencies, workflows, and persistent contracts are unchanged.
Recovery policy supports the fixtures: The retry controller admits rate-limit, overload, server-error, and timeout recovery, but not missing-model recovery. It parses retry hints from error text and rejects delays beyond the recovery window; the helper bounds that window at 90 seconds. This supports both the missing-model fallback fixture and the 120-second Telegram outage hint.
Independent documented contract: The model-failover documentation specifies bounded same-model recovery that continues the existing transcript before profile rotation or model fallback. It separately identifies eligible HTTP 404 responses as missing-model fallback failures.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Gateway tests send chat and scheduled requests through the agent runtime using controlled provider responses. They check recovery decisions, terminal results, queued replies, Telegram error delivery, and displayed session history.

flowchart TD
  A[Chat and scheduled requests] --> B[Gateway test harness]
  B --> C[Agent runtime]
  D[Controlled provider failures] --> C
  C --> E[Continue or fall back]
  E --> F[Terminal result and queued reply]
  F --> G[Delivery and history assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +40. Total +40 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 58 18 +40
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 58 18 +40

Review metrics

None.

Technical review

Best possible solution:

Retain the focused fixture corrections so validation follows the existing recovery contract while continuing to enforce terminal settlement, redaction, and exactly one queued reply.

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

Yes, the focused fixtures provide a clear reproduction path, and source confirms their mismatch with bounded continuation recovery. Execution results are reported in the PR body; this review did not rerun them.

Is this the best way to solve the issue?

Yes. The patch adjusts failure inputs and assertions to the existing runtime contract while preserving timeout budgets and observable settlement checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5579546f18c8.

Labels

Label justifications:

  • P2: This is a bounded repair to recovery validation with no production behavior change.
  • 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 maintainer-authored proof exemption applies. These test changes exercise Gateway recovery and Telegram settlement through controlled HTTP responses; the body reports focused passes, but no production behavior or authority boundary changes.

Evidence

What I checked:

  • Verified introduced scope: The pinned merge-base-to-head delta contains only the four supplied test files. Production code, dependencies, workflows, and persistent contracts are unchanged. (a4f43880f73d)
  • Recovery policy supports the fixtures: The retry controller admits rate-limit, overload, server-error, and timeout recovery, but not missing-model recovery. It parses retry hints from error text and rejects delays beyond the recovery window; the helper bounds that window at 90 seconds. This supports both the missing-model fallback fixture and the 120-second Telegram outage hint. (src/agents/embedded-agent-runner/run/failover-retry-controller.ts:237, a4f43880f73d)
  • Independent documented contract: The model-failover documentation specifies bounded same-model recovery that continues the existing transcript before profile rotation or model fallback. It separately identifies eligible HTTP 404 responses as missing-model fallback failures. Public docs: docs/concepts/model-failover.md. (docs/concepts/model-failover.md:16, a4f43880f73d)
  • Continuation evidence has an independent producer: The mock provider records the latest user prompt separately from all retained input text, records the model, and derives the failure outcome from emitted response events. These records support the new continuation assertions without substituting a mocked transport client. (extensions/qa-lab/src/providers/mock-openai/server.ts:2753, a4f43880f73d)
  • Current-main necessity: Comparison with fetched main shows the recovery changes remain absent from all three E2E files, while the history fixture already matches this branch. This is an endpoint comparison used only to establish remaining usefulness, not PR ownership. (test/e2e/qa-lab/runtime/gateway-repeated-request-recovery.e2e.test.ts:379, 5579546f18c8)
  • Release comparison: The latest supplied release still contains the repeated-request assertion comparing diagnostic duration against the full provider deadline. The central recovery validation repair is therefore not already covered by that release. (test/e2e/qa-lab/runtime/gateway-repeated-request-recovery.e2e.test.ts:372, 3928bad9badf)

Likely related people:

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

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-06T04:37:32.643Z sha 85cc7c34e3732eb74e9b963719d10156ab235a80 :: needs maintainer review before merge. :: none

Use a missing-model response for selected-provider fallback proof. Preserve one same-model continuation before a provider-advertised outage exceeds the normal recovery window, while retaining exact HTTP 500 Telegram settlement and raw-error redaction.

Recognize provider timeouts from their diagnostic classification instead of comparing clocks with different start boundaries. Require terminal error evidence and retain exactly one successful queued followup.

Proof: five focused E2E tests pass, root test typecheck and scoped lint pass, and independent review is clean. The aggregate changed gate encounters the pre-existing services shard root-count limit (721 versus 720); no test roots are added.
@steipete
steipete force-pushed the codex/fix-runtime-e2e-main branch from 85cc7c3 to 47fbdb7 Compare September 6, 2026 05:24
Align the false-valued pagination fixture with the projection field names introduced in #139753 after #139715. Preserve all pagination assertions.

The Gateway-root typecheck reproduces TS2353 before the change and passes afterward. All 30 history tests pass before and after; the full changed-file gate and independent P2 review pass.
@steipete steipete changed the title fix(test): align runtime E2E failures with continuation recovery fix(test): align recovery and history fixtures with runtime contracts Sep 6, 2026
@steipete
steipete merged commit f3f1995 into main Sep 6, 2026
147 of 149 checks passed
@steipete
steipete deleted the codex/fix-runtime-e2e-main branch September 6, 2026 06:04
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
…openclaw#139733)

* fix(test): align runtime E2E failures with continuation recovery

Use a missing-model response for selected-provider fallback proof. Preserve one same-model continuation before a provider-advertised outage exceeds the normal recovery window, while retaining exact HTTP 500 Telegram settlement and raw-error redaction.

Recognize provider timeouts from their diagnostic classification instead of comparing clocks with different start boundaries. Require terminal error evidence and retain exactly one successful queued followup.

Proof: five focused E2E tests pass, root test typecheck and scoped lint pass, and independent review is clean. The aggregate changed gate encounters the pre-existing services shard root-count limit (721 versus 720); no test roots are added.

* fix(test): update history projection fixture fields

Align the false-valued pagination fixture with the projection field names introduced in openclaw#139753 after openclaw#139715. Preserve all pagination assertions.

The Gateway-root typecheck reproduces TS2353 before the change and passes afterward. All 30 history tests pass before and after; the full changed-file gate and independent P2 review pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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