Repository navigation
fix(test): align recovery and history fixtures with runtime contracts - #139733
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 1:53 AM ET / 05:53 UTC. ClawSweeper reviewWhat this changesUpdates 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 Review scores
Verification
How this fits togetherOpenClaw’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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +40. Total +40 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
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.
85cc7c3 to
47fbdb7
Compare
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.
|
Merged via squash.
|
…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.
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_foundto 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
assistantErrorPendingandassistantErrorRecoveryObserved, preserving theirfalsevalues 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, andgit diff --checkpass. 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.