Skip to content

fix(tests): reorder initializer arguments so the shared-kit test module compiles#101372

Merged
steipete merged 1 commit into
mainfrom
fix/shared-kit-test-arg-order-nash
Jul 7, 2026
Merged

fix(tests): reorder initializer arguments so the shared-kit test module compiles#101372
steipete merged 1 commit into
mainfrom
fix/shared-kit-test-arg-order-nash

Conversation

@steipete

@steipete steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

swift test --package-path apps/shared/OpenClawKit fails to compile on current main with three "argument X must precede argument Y" errors in ChatContextUsageTests.swift (2) and ChatViewModelSessionDeletionTests.swift (1), blocking every local shared-kit test run.

Why This Change Was Made

Two recently landed test files call labeled initializers with arguments out of declaration order (totalTokensFresh after contextTokens on OpenClawChatSessionEntry; transport after activeAgentId on OpenClawChatViewModel), which Swift rejects. Hosted CI does not compile the shared-kit test module on macOS, so it slipped through — the same gap as #100903 earlier today. The fix reorders the arguments at the three call sites; no behavior change.

User Impact

None at runtime — test-only compile fix restoring local swift test for the shared package.

Evidence

  • Before: three compile errors on clean origin/main (exact messages in the diff context).
  • After: swift test --package-path apps/shared/OpenClawKit --filter "ChatContextUsageTests|ChatViewModelSessionDeletionTests" — 11/11 pass in 2 suites; module compiles.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Jul 7, 2026
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 7, 2026, 1:22 AM ET / 05:22 UTC.

Summary
The PR reorders labeled Swift initializer arguments at three shared OpenClawKit test call sites so they match the current constructor declarations.

PR surface: Other 0. Total 0 across 2 files.

Reproducibility: yes. by source inspection: Swift requires labeled arguments in declaration order, and current main passes totalTokensFresh after contextTokens plus activeAgentId before transport. I did not run swift test in this read-only review.

Review metrics: none identified.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • none.

Risk before merge

  • [P1] The PR branch is behind current main, so final landing should rely on fresh exact-head or merge-ref checks.

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrow test-only reorder after normal exact-head or merge-ref checks; no product, config, or API change is needed.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No ClawSweeper repair lane is needed; the patch is already a narrow test-only fix awaiting normal maintainer merge handling.

Security
Cleared: The diff only reorders Swift test initializer arguments and does not touch dependencies, workflows, secrets, or executable supply-chain surfaces.

Review details

Best possible solution:

Land the narrow test-only reorder after normal exact-head or merge-ref checks; no product, config, or API change is needed.

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

Yes by source inspection: Swift requires labeled arguments in declaration order, and current main passes totalTokensFresh after contextTokens plus activeAgentId before transport. I did not run swift test in this read-only review.

Is this the best way to solve the issue?

Yes. Reordering the three test call sites is the narrowest maintainable fix because the current constructor declarations are internally consistent and no overload or API change is needed.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 01d6ea1f0e87.

Label changes

Label changes:

  • add P2: This fixes a concrete shared-kit test-module compile break with limited blast radius and no runtime user impact.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix live output for the focused swift test command with 11/11 passing, which is adequate for this test-only compile repair.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix live output for the focused swift test command with 11/11 passing, which is adequate for this test-only compile repair.

Label justifications:

  • P2: This fixes a concrete shared-kit test-module compile break with limited blast radius and no runtime user impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix live output for the focused swift test command with 11/11 passing, which is adequate for this test-only compile repair.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix live output for the focused swift test command with 11/11 passing, which is adequate for this test-only compile repair.
Evidence reviewed

PR surface:

Other 0. Total 0 across 2 files.

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

What I checked:

Likely related people:

  • steipete: Recent GitHub path history for the changed shared OpenClawKit tests and adjacent chat model/session files points to Peter's merged native chat shell, context usage, and session work, including the PR that introduced these test files. (role: recent Apple chat surface contributor and affected-test introducer; confidence: high; commits: bb658d0a6d98, 91d4e8ed8e66, 4babbb2f6f3e; files: apps/shared/OpenClawKit/Tests/OpenClawKitTests/ChatContextUsageTests.swift, apps/shared/OpenClawKit/Tests/OpenClawKitTests/ChatViewModelSessionDeletionTests.swift, apps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatViewModel.swift)
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.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P2 Normal backlog priority with limited blast radius. labels Jul 7, 2026
@steipete
steipete merged commit 5d7a451 into main Jul 7, 2026
91 of 99 checks passed
@steipete
steipete deleted the fix/shared-kit-test-arg-order-nash branch July 7, 2026 05:25
@steipete

steipete commented Jul 7, 2026

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: 🐚 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