Skip to content

refactor(test): reuse explicit fallback config fixtures - #146948

Merged
steipete merged 1 commit into
mainfrom
codex/test-fallback-config-fixtures-97
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-fallback-config-fixtures-97

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #139428

What Problem This Solves

Model-fallback tests still repeat complete primary/fallback configuration objects already provided by their shared fixture owner.

User Impact

No user-visible behavior changes. All fallback, cooldown, session override, and generation-scoping scenarios remain covered.

Why This Change Was Made

Twelve remaining inputs now use the existing createModelFallbackConfig factory, removing 97 test lines without changing the helper. It creates fresh nested objects while preserving the supplied fallback array, its order, and omitted fields. The generation suite adds one runtime fixture-module import; that module has only a type-only dependency.

Evidence

All three complete suites passed before and after: 210 cases with identical per-file order and outcomes. The full-source inverse, 36 actual constructor controls, changed-file gate, and fresh independent review passed. The controls checked values, property descriptors, ordered keys, absent fields, fresh objects, and fallback-array identity.

No runtime-speed improvement is claimed; the local runs reused a warm cache and shared host capacity.

@clawsweeper

clawsweeper Bot commented Sep 13, 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 agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 10:50
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 6:56 AM ET / 10:56 UTC.

ClawSweeper review

What this changes

Reuses the existing model-fallback configuration fixture in twelve test inputs while preserving their scenarios and assertions.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a useful, behavior-preserving cleanup within the maintainer-requested test audit. Current main still contains the repeated configurations, and no actionable defect was found.

Priority: P3
Reviewed head: 4374ad158d64ea10dbb8d1c30d2106773f25e8bf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused cleanup with equivalent inputs, retained assertions, and proportional reported validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a member-authored PR with no changed production behavior; the external-contributor runtime-proof gate does not apply. Reported suite parity and constructor controls support the fixture equivalence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a member-authored PR with no changed production behavior; the external-contributor runtime-proof gate does not apply. Reported suite parity and constructor controls support the fixture equivalence.
Evidence reviewed 6 items Introduced change: The complete pinned merge-base-to-head patch replaces twelve configuration constructions and adds one fixture import; it changes no assertions, production code, dependencies, or workflows. The host-verified test merge also changes only these test files.
Fixture equivalence: makeModelFallbackCfg spreads overrides at the top level, so each replaced agents object completely replaces its default agents object. createModelFallbackConfig produces that same nested shape, preserves primary/fallback property order and the supplied array reference, and allocates fresh objects. Its only dependency is type-only.
Current-main and release comparison: Comparison with fetched main retains the same twelve cleanup opportunities. The fixture already exists unchanged in the supplied latest release, v2026.9.4; its existence does not supersede migrating these remaining callers.
Findings None None.
Security None None.

How this fits together

Model fallback chooses alternate models when an agent request cannot complete. These tests supply primary and fallback configurations to verify selection order, cooldown recovery, and generation-specific model selection.

flowchart LR
  A[Test primary and fallback inputs] --> B[Shared configuration fixture]
  B --> C[Model fallback tests]
  D[Simulated failures and provider generations] --> C
  C --> E[Fallback selection and retry owners]
  E --> F[Existing result and ordering assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -97. Total -97 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 28 125 -97
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 28 125 -97

Review metrics

None.

Root-cause cluster

Relationship: partial_overlap
Canonical: #139428
Summary: This PR addresses one bounded fixture-reuse batch within the broader test-audit campaign; it does not complete the campaign.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep explicit test inputs with the shared fixture owner while preserving every existing fallback scenario and assertion.

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

Not applicable: this is test-fixture cleanup, not a reported runtime defect; equivalence is supported by the inspected constructors and introduced hunks.

Is this the best way to solve the issue?

Yes: reusing the existing pure fixture removes repetition without introducing another owner or weakening assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4d48e9c1e026.

Labels

Label changes:

  • add P3: This reduces duplicated test setup without changing product behavior or regression assertions.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a member-authored PR with no changed production behavior; the external-contributor runtime-proof gate does not apply. Reported suite parity and constructor controls support the fixture equivalence.

Label justifications:

  • P3: This reduces duplicated test setup without changing product behavior or regression assertions.
  • 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 supplied repository state identifies a member-authored PR with no changed production behavior; the external-contributor runtime-proof gate does not apply. Reported suite parity and constructor controls support the fixture equivalence.

Evidence

What I checked:

  • Introduced change: The complete pinned merge-base-to-head patch replaces twelve configuration constructions and adds one fixture import; it changes no assertions, production code, dependencies, or workflows. The host-verified test merge also changes only these test files. (src/agents/model-fallback.test.ts:954, 4374ad158d64)
  • Fixture equivalence: makeModelFallbackCfg spreads overrides at the top level, so each replaced agents object completely replaces its default agents object. createModelFallbackConfig produces that same nested shape, preserves primary/fallback property order and the supplied array reference, and allocates fresh objects. Its only dependency is type-only. (src/agents/test-helpers/model-fallback-config-fixture.ts:22, 4374ad158d64)
  • Current-main and release comparison: Comparison with fetched main retains the same twelve cleanup opportunities. The fixture already exists unchanged in the supplied latest release, v2026.9.4; its existence does not supersede migrating these remaining callers. (src/agents/test-helpers/model-fallback-config-fixture.ts:22, 3a9d69db306c)
  • Prior fixture work: Current-main history records earlier explicit fallback-fixture work by Peter Steinberger and adjacent type-boundary work by Vincent Koc. Deeper blame and parent-patch inspection encountered unavailable objects, so no source-line introduction attribution is claimed. (src/agents/test-helpers/model-fallback-config-fixture.ts:22, b3d67aa9b80b)
  • Campaign context and reported validation: The supplied PR body and Test audit: reduce redundant test code and full-suite runtime #139428 identify this as a bounded campaign batch and report 210 cases passing before/after with identical order and outcomes, plus 36 constructor controls. These are author-reported results; this read-only review did not execute tests. The supplied checks include successful changed-node tests and test types. (4374ad158d64)
  • Policy and scope checks: Read the complete root and src/agents AGENTS.md policies and applied their fixture-reuse and lightweight-import guidance. No maintainer-notes directory was present. git diff --check passed and the checkout remained clean. The replacement fixture has no Codex dependency contract; existing synthetic harness labels do not change that boundary. (src/agents/AGENTS.md:1, 4374ad158d64)

Likely related people:

  • steipete: 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.

@steipete
steipete merged commit abd7a44 into main Sep 13, 2026
167 checks passed
@steipete
steipete deleted the codex/test-fallback-config-fixtures-97 branch September 13, 2026 11:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to zachisfine/openclaw that referenced this pull request Sep 13, 2026
* temp/pr-146799: (70 commits)
  test: reuse explicit fallback config fixtures (openclaw#146948)
  fix(computer): return fresh window observations after actions (openclaw#146822)
  refactor(feishu): remove unreachable requester topic selection (openclaw#146904)
  improve(gateway): reduce CPU spent listing agent-owned sessions (openclaw#137745)
  fix(ui): avoid recapturing chat drafts during UI updates (openclaw#146884)
  fix(ui): show system uptime in the debug overlay (openclaw#146960)
  fix(retry): honor waits beyond the native timer limit (openclaw#145718)
  fix(ui): keep chat history idle when run status changes (openclaw#146802)
  fix(ui): reuse persisted text during chat streaming (openclaw#146831)
  refactor(qa): share harness drift result construction (openclaw#146903)
  test(agents): coordinate settings lock contention (openclaw#146949)
  fix(worker): avoid repeatedly serializing screenshot history (openclaw#146907)
  fix(secrets): stop buffered upload writes after cancellation (openclaw#146840)
  perf(doctor): avoid unnecessary state runtime imports (openclaw#146926)
  improve: reduce compaction request estimation work (openclaw#146961)
  fix(ci): wait for forwarded avatar imports before assertions (openclaw#146729)
  perf(workers): skip configured Git author lookups (openclaw#146833)
  fix: admit borrowed memory writes through the agent database owner (openclaw#146760)
  fix(discord): prevent voice playback gaps and stale turn controls (openclaw#146798)
  improve: reduce worktree filesystem stalls and archive syncs (openclaw#146906)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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