Skip to content

test(crestodian): preserve model input exports in mocks - #103999

Merged
steipete merged 1 commit into
mainfrom
codex/fix-model-input-partial-mocks
Jul 11, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-model-input-partial-mocks

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #103996

What Problem This Solves

Resolves a current-main CI failure where Crestodian's full mock of config/model-input leaked into unrelated suites and hid newly added exports. Whole-suite shards then failed every caller of toAgentModelListLike, even though those callers and tests were otherwise correct.

Why This Change Was Made

Both Crestodian mocks now use Vitest's partial-mock pattern: retain every real module export and override only resolveAgentModelPrimaryValue, which is the behavior those tests intentionally isolate. This removes the brittle export allowlist without changing production code.

User Impact

No product behavior changes. CI once again tests model selection, inference onboarding, and subagent model resolution instead of failing during module mock resolution.

Evidence

  • Current-main CI run 29131114108 and fix(memory): preserve Unicode in QMD search snippets #103996 run 29131384934 both fail with the same missing toAgentModelListLike export from these mocks.
  • Blacksmith Testbox-through-Crabbox tbx_01kx76v3wggn4091s5shmsdan3: the two Crestodian suites and all three previously failing consumer suites pass together, 78/78 tests across two Vitest shards.
  • The same Testbox passed path-scoped check:changed, including core-test typechecking and lint.
  • Targeted oxfmt, git diff --check, and fresh Codex autoreview passed; autoreview reported no actionable findings with 0.99 correctness confidence.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 11, 2026
@steipete
steipete force-pushed the codex/fix-model-input-partial-mocks branch from c79b371 to 1046864 Compare July 11, 2026 00:05
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 11, 2026
@clawsweeper

clawsweeper Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 10, 2026, 8:14 PM ET / July 11, 2026, 00:14 UTC.

Summary
The PR changes two Crestodian test mocks to preserve all real config/model-input exports while overriding only resolveAgentModelPrimaryValue.

PR surface: Tests +2. Total +2 across 2 files.

Reproducibility: yes. Current-main CI logs show missing real exports after a Crestodian full mock is loaded, and source inspection identifies both mocks that replace the complete module namespace.

Review metrics: none identified.

Root-cause cluster
Relationship: canonical
Canonical: #103999
Summary: This PR is the focused repair for the Crestodian mock leak; the linked memory PR is a distinct product fix whose whole-suite CI run exposed the test defect.

Members:

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

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Next step before merge

  • [P2] No repair work is needed; the protected maintainer label leaves the technically clean PR for explicit maintainer review and landing after exact-head checks.

Security
Cleared: The patch changes only two test mocks and introduces no production code, dependency, workflow, permission, secret-handling, or supply-chain surface.

Review details

Best possible solution:

Land the typed partial mocks after exact-head checks complete, retaining the real module contract while isolating only primary-model resolution in these tests.

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

Yes. Current-main CI logs show missing real exports after a Crestodian full mock is loaded, and source inspection identifies both mocks that replace the complete module namespace.

Is this the best way to solve the issue?

Yes. Preserving the actual module and overriding only the function under test is the narrowest maintainable solution and matches Vitest’s runtime guidance and existing repository patterns.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5f7a67f18684.

Label changes

Label changes:

  • add P2: This is a bounded test-isolation repair for a current-main whole-suite CI failure, with no production behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports an after-fix Blacksmith Testbox run covering both Crestodian suites and all three affected consumer suites, with 78 of 78 tests passing, plus path-scoped checks.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body reports an after-fix Blacksmith Testbox run covering both Crestodian suites and all three affected consumer suites, with 78 of 78 tests passing, plus path-scoped checks.

Label justifications:

  • P2: This is a bounded test-isolation repair for a current-main whole-suite CI failure, with no production behavior change.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body reports an after-fix Blacksmith Testbox run covering both Crestodian suites and all three affected consumer suites, with 78 of 78 tests passing, plus path-scoped checks.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body reports an after-fix Blacksmith Testbox run covering both Crestodian suites and all three affected consumer suites, with 78 of 78 tests passing, plus path-scoped checks.
Evidence reviewed

PR surface:

Tests +2. Total +2 across 2 files.

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

What I checked:

Likely related people:

  • steipete: Peter Steinberger introduced both affected Crestodian mocks in merged commit 7a38f14 and subsequently carried major Crestodian/model-selection changes in the same area. (role: introduced behavior and recent area contributor; confidence: high; commits: 7a38f140a2cf, a0354e5243cd; files: src/crestodian/operations.test.ts, src/crestodian/rescue-message.test.ts, src/config/model-input.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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

Copy link
Copy Markdown
Contributor Author

Land-ready at exact head 104686460789574763c9bc2722d56c4a7370817c.

  • Current-main CI run 29131114108 and fix(memory): preserve Unicode in QMD search snippets #103996 run 29131384934 both reproduce the same incomplete config/model-input mock failure.
  • The fix retains every real module export with Vitest's partial-mock pattern and overrides only the one helper these Crestodian tests intentionally isolate.
  • Blacksmith Testbox-through-Crabbox tbx_01kx76v3wggn4091s5shmsdan3: both Crestodian suites and all three previously failing consumer suites passed together, 78/78 tests across two shards.
  • The same Testbox passed path-scoped check:changed, including core-test typechecking and lint.
  • Exact-head hosted CI run 29131863619 completed successfully with every selected job green.
  • Targeted oxfmt, git diff --check, and fresh final-head Codex autoreview passed; autoreview reported no actionable findings with 0.98 correctness confidence.
  • Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 103999 passed.

No production, configuration, docs, or changelog behavior changes.

@steipete
steipete merged commit 920b29b into main Jul 11, 2026
127 of 131 checks passed
@steipete
steipete deleted the codex/fix-model-input-partial-mocks branch July 11, 2026 00:19
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

1 participant