Skip to content

refactor(tests): remove duplicate Mistral cache-cost test - #143172

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/test-audit-mistral-cache-cost-20260909
Sep 9, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/test-audit-mistral-cache-cost-20260909

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

Related: #139428

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

This maintainer-requested test cleanup removes a redundant Mistral cache-cost
arithmetic case. It repeats pricing already checked through the actual model
builder and arithmetic covered by the shared usage-cost tests.

Why This Change Was Made

Remove only the cached-token arithmetic case and its separator. Retain the model
builder's full pricing contract, including cacheRead: 0.05, the catalog ratio
test, the curated catalog test, and every import and helper.

The shared calculator tests retain ten-decimal cached-token bucket and tier
assertions, including the one-hour cache-write subset. The default-precision
flat-cost case is not the basis for this removal.

User Impact

No runtime or user-visible behavior changes. One test case and nine lines are
removed; production code, pricing, timeouts, and workflows are unchanged.

Evidence

  • The complete Mistral model-definition and shared usage-cost test files passed
    through the normal Vitest wrapper: 3 Mistral tests plus 24 cost tests, 27 actual
    passes and no skips.
  • Targeted formatting and git diff --check passed.
  • The selected changed-check plan completed across 18 initially passing steps
    and one successful normal retry of the final lint step. The initial aggregate
    command failed when its declaration-input guard detected a changed input; that
    original failure is preserved, not relabeled as a passing command.
  • The final lint retry completed declaration sealing and the named-file lint
    command with exit 0. A separate evidence collector's missing-banner assertion
    was reconciled from the wrapper and CLI execution/exit propagation; it was not
    another lint failure. The original input-change cause remains unresolved.
  • Fresh scanned P2 autoreview was scoped-clean with no findings.

This is focused local proof, not a full-suite or live-provider claim. Exact-head
hosted CI remains a separate landing requirement.

@vincentkoc vincentkoc self-assigned this Sep 9, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 9, 2026 14:28
@clawsweeper

clawsweeper Bot commented Sep 9, 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.

@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 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 10:34 AM ET / 14:34 UTC.

ClawSweeper review

What this changes

Removes a redundant Mistral cached-token cost test while retaining the model pricing and catalog checks.

Merge readiness

✅ Ready for maintainer review

Keep open as a sound, maintainer-requested cleanup. The retained pricing assertion subsumes the removed case, and shared tests exercise real cost arithmetic. No actionable defect was found; the cleanup is still absent from current main.

Priority: P3
Reviewed head: 778a6098a262a119b7a91ca1dcada5ad780b25c9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, justified cleanup that preserves stronger coverage and has no actionable review findings.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored PR changes no production behavior, so the external-contributor runtime-proof gate does not apply; reported focused tests supplement the inspected coverage argument.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR changes no production behavior, so the external-contributor runtime-proof gate does not apply; reported focused tests supplement the inspected coverage argument.
Evidence reviewed 8 items Verified introduced change: The pinned merge-base-to-head diff removes only the test-local arithmetic case. It changes no production code, imports, helpers, configuration, or workflows. The read-only diff whitespace check also passed.
Stronger retained pricing contract: The remaining default-model test asserts the complete cost object, including cacheRead: 0.05. This catches price changes more strictly than multiplying that same field by a constant inside the deleted test. Catalog-wide cache-read ratio coverage also remains.
Real calculator coverage remains: Shared tests call estimateUsageCost for cached prompt buckets, tier boundaries, and the one-hour cache-write subset with ten-decimal assertions. The wrapper calls calculateUsageCost in packages/llm-core/src/usage-cost.ts; the deleted test never exercised that calculator.
Findings None None.
Security None None.

How this fits together

The Mistral plugin supplies model definitions and prices to OpenClaw. Its tests verify those prices, while shared usage-cost tests verify conversion of token counts into estimated costs.

flowchart LR
  A[Mistral catalog metadata] --> B[Model definition builder]
  B --> C[Retained pricing assertions]
  B --> D[Model prices]
  E[Token usage] --> F[Shared cost calculator]
  D --> F
  F --> G[Estimated usage cost]
  F --> H[Shared arithmetic tests]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -9. Total -9 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 0 9 -9
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 0 9 -9

Review metrics

None.

Root-cause cluster

Relationship: partial_overlap
Canonical: #139428
Summary: This PR contributes one bounded cleanup to the broader test-audit campaign without claiming to complete its aggregate targets.

Members:

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

Technical review

Best possible solution:

Keep exact provider-price contracts in the Mistral tests and arithmetic coverage at the shared calculator boundary.

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

Not applicable: this removes redundant test coverage rather than fixing a runtime defect; source inspection establishes the overlap.

Is this the best way to solve the issue?

Yes. Removing the test-local calculation preserves the stricter model-price assertion and the shared calculator's behavioral coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5cc68a7a345b.

Labels

Label justifications:

  • P3: This is a low-risk test-maintenance cleanup with no runtime behavior change.
  • 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: This MEMBER-authored PR changes no production behavior, so the external-contributor runtime-proof gate does not apply; reported focused tests supplement the inspected coverage argument.

Evidence

What I checked:

  • Verified introduced change: The pinned merge-base-to-head diff removes only the test-local arithmetic case. It changes no production code, imports, helpers, configuration, or workflows. The read-only diff whitespace check also passed. (extensions/mistral/model-definitions.test.ts:42, 778a6098a262)
  • Stronger retained pricing contract: The remaining default-model test asserts the complete cost object, including cacheRead: 0.05. This catches price changes more strictly than multiplying that same field by a constant inside the deleted test. Catalog-wide cache-read ratio coverage also remains. (extensions/mistral/model-definitions.test.ts:25, 778a6098a262)
  • Real calculator coverage remains: Shared tests call estimateUsageCost for cached prompt buckets, tier boundaries, and the one-hour cache-write subset with ten-decimal assertions. The wrapper calls calculateUsageCost in packages/llm-core/src/usage-cost.ts; the deleted test never exercised that calculator. (src/utils/usage-format.cost.test.ts:111, 778a6098a262)
  • Cleanup still needed on main: Fetched current main still contains the exact cached-token arithmetic case proposed for removal. (extensions/mistral/model-definitions.test.ts:42, 5cc68a7a345b)
  • Latest release comparison: The supplied v2026.9.3 release revision also retains the redundant case; this cleanup is not already shipped there. (extensions/mistral/model-definitions.test.ts:42, 1391f7cd2d40)
  • Campaign context and reported validation: The captured PR body links Test audit: reduce redundant test code and full-suite runtime #139428, whose acceptance explicitly permits coherent redundant-test removals with stronger remaining coverage. The PR reports 27 focused passes and distinguishes its initial changed-check failure from the successful lint retry. These are contributor-reported results; this review did not execute tests. Captured sourceRevision: 61376ff4593ff96f05c179bc11cc063f3e107f9cd4aa58d5f9a99635a3ea0040. (778a6098a262)

Likely related people:

  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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.

@vincentkoc
vincentkoc merged commit 301c34f into main Sep 9, 2026
164 checks passed
@vincentkoc
vincentkoc deleted the refactor/test-audit-mistral-cache-cost-20260909 branch September 9, 2026 14:56
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 9, 2026
…er-ownership-20260909

* origin/main: (147 commits)
  fix(cli): reject blank account selectors before command startup (#143088)
  fix(update): repair young runs after recorded drivers exit (#143136)
  test(telegram): close model callback fixture connections (#143197)
  improve(test): reduce Telegram policy fixture startup overhead (#143192)
  test(ci): stabilize systemd manager shim timing (#143134)
  fix(test): retire chat preview Escape listeners during teardown (#143191)
  test(memory-wiki): share visibility test callbacks (#143181)
  fix(ci): accept native iOS keychain filenames (#142968)
  fix(ci): show publication observations in FRV status (#143171)
  fix(github): point the stuck-FAQ auto-response at a live anchor (#143194)
  docs: correct verified accuracy defects in CLI, tools, and automation pages (#143179)
  refactor(tests): remove duplicate Mistral cache-cost test (#143172)
  fix(doctor): complete canonical model-reference migration (#142284)
  fix(ci): reject stale and empty timing sample cohorts (#143182)
  fix(ui): remove first-reply confetti from chat (#143167)
  docs: split help/faq into 13 topic pages (#143150)
  refactor(docs): require caller-owned route indexes (#143164)
  fix(android): distinguish connection status from chat readiness (#143128)
  refactor: share agent-turn execution test defaults (#143166)
  fix(cli): print immutable-config refusals without crash framing (#143140)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: mistral 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: 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