Repository navigation
refactor(tests): split compact command lifecycle coverage - #123765
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 14, 2026, 1:33 PM ET / 17:33 UTC. ClawSweeper reviewWhat this changesThe PR moves compact-command lifecycle tests into a focused suite and extracts their shared Vitest mocks and fixtures into a test-support module. Merge readinessKeep open for maintainer scope review: current main already clears the original max-lines blocker, but this maintainer PR may still be worthwhile after rebasing and consolidating the newly parallel test fixture. Priority: P3 Review scores
Verification
How this fits togetherCompact commands enter the command-handler registry, validate session authority across awaited lifecycle steps, and then invoke session compaction. The changed tests cover those lifecycle safeguards without modifying the production command path. flowchart LR
A[Compact command] --> B[Command handler]
B --> C[Session authority checks]
C --> D[Compaction runtime]
E[Lifecycle test suite] --> B
F[Shared test fixtures] --> E
G[Context-budget test suite] --> B
Decision needed
Why: The original CI-unblock outcome is present on current main, while the remaining lifecycle split is optional maintenance scope that should be weighed against the added shared-fixture migration. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +104, Tests -61. Total +43 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use one compact-command test-support module for the general, lifecycle, and context-budget suites, leaving each suite focused while preserving a single mock baseline. Do we have a high-confidence way to reproduce the issue? Not applicable as a product-bug reproduction: current main's compact-command test has 925 effective lines, below the configured 1,000-line cap. Is this the best way to solve the issue? No for the original CI unblock, because current main already resolves it; the lifecycle split is best only if it also consolidates the current context-budget fixture. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e03d1a42f808. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Related: #123705
What Problem This Solves
Resolves a CI failure where the compact-command test suite exceeded the 1,000-line oxlint budget after concurrent compaction changes landed on
main. The file reached 1,049 effective lines, which blocked unrelated pull requests such as #123705 in the core lint shard.Why This Change Was Made
The session-authority tests now live in a focused lifecycle suite, while both suites share one mock and fixture module. This preserves all existing cases, gives each suite clear growth headroom, and fixes the max-lines violation without changing or suppressing the ratchet.
Production delta: +0/-0. Tests/support: +328/-285 (net +43).
User Impact
No product behavior changes. Maintainers get the same 38 compact-command regression cases in smaller, independently focused files, and unrelated pull requests are no longer blocked by this max-lines failure.
Evidence
src/auto-reply/reply/commands-compact.test.tswas 1,141 physical / 1,049 effective lines on currentmain; fix(ui): prevent duplicate Skills preload requests #123705'scheck-lint-core-4failed on run 31821117620.[email protected]and[email protected]pass all three touched files.check:changedpassed the core-test plan, including max-lines ratchet, formatting, dependency/boundary guards, dead-export scans, test typecheck, and changed-file lint.