Skip to content

fix(tests): make catalog fixtures independent of runner speed - #205137

Merged
RomneyDa merged 2 commits into
mainfrom
openclaw/fp1110-catalog-clocks
Nov 25, 2026
Merged

RomneyDa merged 2 commits into
mainfrom
openclaw/fp1110-catalog-clocks

Conversation

@tideclaw-bot

Copy link
Copy Markdown
Collaborator

What Problem This Solves

A slow worker can exhaust ClawRouter's discovery budget before a mocked response, or let a legitimate background catalog retry add a request during the Gateway's failed-renewal retention assertions. Neither failure means the behavior under test is broken.

User Impact

More reliable catalog checks without loosening what they verify. No runtime behavior, retry interval, discovery timeout, or migration changes.

Why This Change Was Made

  • Forward-port 70a36ea510ab75ba40ef0234281fd8a1a9cf3f7d from 2026.11.10 unchanged: stub only performance.now() for the ClawRouter mapping suite. The cache TTL test still controls Date.now() independently, and the existing cleanup restores the spy.
  • Forward-port 90074187f1022f0be29f776615f82273ea429d8d: freeze only Date from just before worker termination through the assertion window, and restore it in finally. Gateway I/O, RPC timeouts, the worker, and the retry timer remain real. Main already imports vi from the worker observer refactor. All existing assertions remain intact.

Evidence

  • Release failures: ClawRouter's prefetched budget expired before its mocked fetch; Gateway worker recovery observed four requests instead of three, more than 30 seconds after failed preparation.
  • On the forward-port, standalone Vitest ran all eight ClawRouter fixture tests with one worker: 8/8 passed (59 s wall including startup). The standard base run stopped while compiling subprocess fixtures before executing tests.
  • Gateway integration proof is pending on this head: the local runner refused runtime preparation because it could not verify separation from managed Gateway artifacts; the isolated Podman runner is unavailable. This is a setup refusal, not a test result. Exact-head CI should cover that integration.
  • Targeted Oxlint for both files, the Gateway methods test typecheck, the extension test typecheck, formatting, and git diff --check passed. Author self-review confirmed six inserted test lines, no production changes, and no assertion changes.

Worked on by

tideclaw-bot and others added 2 commits November 25, 2026 06:26
Forward-port 70a36ea and 9007418. Freeze only the clock driving each unrelated deadline; retain the cache TTL check, real Gateway I/O, and every request-count assertion.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: jalehman <[email protected]>
Worked on by:
- @jalehman
- @RomneyDa

Co-authored-by: jalehman <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 26291ae5-8a2f-417c-9e31-c4d3c6ba30de
@clawsweeper

clawsweeper Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@tideclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime extensions: clawrouter Extension: clawrouter size: XS labels Nov 25, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR freezes the unrelated clock in each catalog fixture so runner stalls do not invalidate its assertions.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused, source-supported fixture repair with no findings; validation is limited to reported unit/static checks while Gateway integration CI remains pending.
Proof confidence 🦐 gold shrimp (3/6) No shipped behavior changes, so shipped-entry-point proof is unnecessary; the author reports passing ClawRouter tests, while Gateway integration validation remains pending in exact-head CI.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Catalog checks can fail on loaded runners even when the behavior under test is correct.
Reason: The maintainer-authored direction addresses concrete fixture failures without altering runtime policy or reducing assertions.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes catalog fixtures deterministic without changing production behavior or weakening assertions; no introduced defect was found.

Reviewed head: 702a9579bef0333f81031329c9396c426e70c8db

Before merge

None.

Findings

None.

Agent review details

How this fits together

The fixtures exercise ClawRouter catalog mapping and Gateway catalog-worker recovery, checking model rows, retained failure status, request counts, and explicit recovery.

flowchart LR
  A[Catalog fixtures] --> B[ClawRouter mapping]
  A --> C[Gateway model requests]
  B --> D[Mock catalog response]
  C --> E[Catalog worker and retry owner]
  E --> F[Local HTTP fixture]
  D --> G[Existing assertions]
  F --> G
Loading

Technical review

Best possible solution:

Retain the narrow fixture clock controls and existing cleanup and assertions, then land after required CI succeeds.

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

Source confirms both elapsed-clock dependencies behind the reported runner-sensitive failures; no tests were executed during this read-only review.

Is this the best way to solve the issue?

This is the smallest complete fixture repair: control the unrelated clocks while preserving cache-expiry coverage, real worker termination, Gateway I/O, explicit refresh, and request-count assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 04f1b890be7f.

Provenance checked

  • ClawRouter mapping and cache fixtures keeps the original intent (4a354f7: Exercise credential-scoped catalog mapping and supported native transports, as documented in feat(providers): add ClawRouter routing and quotas #99658.)
  • Gateway worker-recovery retention fixture keeps the original intent (d56279c: Prove retained models and refresh-failure status after worker recovery; subsequent fixture repairs preserved real failure injection and inference.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 4a354f7 adds extensions/clawrouter/provider-catalog.test.ts:142 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4a354f76c1bf; files: extensions/clawrouter/provider-catalog.test.ts)
  • Vincent Koc: Raw commit 29e5360 adds extensions/clawrouter/provider-catalog.test.ts:234 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 29e5360e9578; files: extensions/clawrouter/provider-catalog.test.ts)
  • Ayaan Zaidi: Raw commit d56279c adds src/gateway/server-methods/models-list.worker-recovery.integration.test.ts:188 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d56279cdc227; files: src/gateway/server-methods/models-list.worker-recovery.integration.test.ts)

PR surface

Tests +6. Total +6 across 2 files. Added test files: 0.

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

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 25, 2026, 1:34 AM ET / 06:34 UTC.

@RomneyDa
RomneyDa merged commit ced9f75 into main Nov 25, 2026
112 checks passed
@RomneyDa
RomneyDa deleted the openclaw/fp1110-catalog-clocks branch November 25, 2026 07:00
tideclaw-bot added a commit that referenced this pull request Nov 25, 2026
* test: isolate catalog fixtures from elapsed clocks

Forward-port 70a36ea and 9007418. Freeze only the clock driving each unrelated deadline; retain the cache TTL check, real Gateway I/O, and every request-count assertion.

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

* fix(tests): make catalog fixtures independent of runner speed

Worked on by:
- @jalehman
- @RomneyDa

Co-authored-by: jalehman <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 26291ae5-8a2f-417c-9e31-c4d3c6ba30de

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: jalehman <[email protected]>
(cherry picked from commit ced9f75)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 26, 2026
…aw#205137)

* test: isolate catalog fixtures from elapsed clocks

Forward-port 70a36ea and 9007418. Freeze only the clock driving each unrelated deadline; retain the cache TTL check, real Gateway I/O, and every request-count assertion.

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

* fix(tests): make catalog fixtures independent of runner speed

Worked on by:
- @jalehman
- @RomneyDa

Co-authored-by: jalehman <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
OpenClaw-Publication: 26291ae5-8a2f-417c-9e31-c4d3c6ba30de

---------

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: jalehman <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
When neither the selected endpoint nor the model row declares input,
ClawRouter's fallback classified gpt-6.2-sol and gpt-6.2-astra as
text-only. Add both upstream IDs and cover them in the fallback test.

(cherry picked from commit 3bc20e2)

Release adaptation: Cite the original PR’s November 18, 2026 live ClawRouter image proof in the legacy fallback; exact upstream IDs, explicit modality precedence, and text-only behavior for unrecognized models are unchanged.

Follow-up audit: #205137’s catalog clock fixture is already equivalent (70a36ea), and #203898 is already integrated (fec6728). #207768 classifies catalog misses and #192450 adds Bedrock routing; neither is required by the exact-ID fallback. #201434 and #201415 mention the donor SHA as an unrelated verification baseline. Original #200878 has no additional follow-up reference at the pinned scan end.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: clawrouter Extension: clawrouter gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS 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