Skip to content

refactor: keep sticky fallback reset in test support - #183580

Merged
shakkernerd merged 1 commit into
mainfrom
sticky-fallback-test-reset-owner-389
Oct 25, 2026
Merged

shakkernerd merged 1 commit into
mainfrom
sticky-fallback-test-reset-owner-389

Conversation

@shakkernerd

Copy link
Copy Markdown
Contributor

What Problem This Solves

The sticky model-fallback reset is test infrastructure, but it is currently exported from the production cache owner solely so test cleanup can reach it.

User Impact

There is no user-visible behavior change. Sticky fallback selection, expiration, capacity limits, recording, and close/restart cleanup remain unchanged, while tests keep the same per-test and same-session isolation.

Why This Change Was Made

This moves the reset into a narrow test-support module. The helper observes the existing process-global map through its established symbol key and clears that map only when it already exists, so it neither creates another cache nor registers another lifecycle owner.

Both existing consumers now import the test-support owner. Their reset calls and ordering are unchanged, including the fallback transcript suite's explicit mid-test reset and the global runtime cleanup hook.

Evidence

  • Changed-file formatting and selected lint checks passed with oxfmt/Bun parity.
  • All affected type-check groups passed, including production core, core tests, UI, extensions, scripts, and root-test consumers.
  • run-entry.fallback-transcript.test.ts: 15/15 tests passed; the explicit reset still makes the next same-session run start from the primary model.
  • setup-openclaw-runtime.plugin-cache.test.ts: 2/2 cleanup-owner tests passed.
  • The canonical unused-export scan no longer reports the production reset export or the new consumed test-support module. The scan still reports unrelated existing exports, so no whole-scan-green claim is made.
  • Hosted CI and independent review are pending on this initial PR head.

@clawsweeper

clawsweeper Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@shakkernerd shakkernerd self-assigned this Oct 25, 2026
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Oct 25, 2026
@shakkernerd
shakkernerd merged commit b7149c0 into main Oct 25, 2026
117 of 119 checks passed
@shakkernerd
shakkernerd deleted the sticky-fallback-test-reset-owner-389 branch October 25, 2026 12:09
@shakkernerd

Copy link
Copy Markdown
Contributor Author

Simplified: the sticky fallback reset now lives in test support while preserving the existing cache and reset behavior.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 26, 2026
Keeps sticky fallback test cleanup in test support while preserving the process-global cache and its lifecycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant