Repository navigation
refactor(cron): reuse isolated run suite hooks - #137341
Conversation
Use the existing suite helper for auth cold-path and diagnostic tests. Keep suite-specific resets and every case and assertion unchanged. Validation: 16 paired cases, scoped formatting, the LOCAL changed gate, and independent Codex P2 review passed. Production delta 0; tests -16.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 3, 2026, 10:23 AM ET / 14:23 UTC. ClawSweeper reviewWhat this changesThe PR replaces duplicated isolated-cron test suite setup and teardown hooks in two tests with the established shared suite helper. Merge readiness✅ Ready for maintainer review Keep open. This is a unique, test-only cleanup that current main does not yet contain; the shared helper preserves the removed environment reset, harness reset, default-session setup, and restoration lifecycle. No correctness or security defect was found, and the maintainer label rules out automated closure. Priority: P3 Review scores
Verification
How this fits togetherIsolated cron tests invoke the agent-turn runtime through a shared harness. The suite helper resets environment and mock state for each test, then each suite applies its own mocks and assertions. flowchart LR
A[Vitest suite] --> B[Shared suite helper]
B --> C[Environment and harness reset]
C --> D[Suite-specific mock reset]
D --> E[Isolated cron turn]
E --> F[Assertions and cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -16. Total -16 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the shared suite helper for common lifecycle state while retaining suite-specific mock and diagnostic cleanup in each test file. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors test-suite lifecycle setup rather than repairing a reported runtime defect. Is this the best way to solve the issue? Yes. The helper is already the established isolated-cron suite pattern and preserves the prior shared reset/restore ordering while avoiding duplicate plumbing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 79f0df31c8eb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refs/remotes/origin/main: fix(plugins): reject unverifiable pinned npm installs (#136725) improve(ui): lift sidebar section headers on hover and mark online owners (#136985) test(cron): reuse isolated run suite hooks (#137341) test(channels): reuse shared indexed call guards (#137350) fix(ui): sidebar header controls read misaligned after the + button lost its border (#137317) fix(qa-channel): preserve conversation kind for implicit actions (#137343) fix: target the source checkout in Control UI repair commands (#137354) chore: reduce CI job count and database test overhead (#137352) fix(ios): preserve chat live edge across keyboard transitions (#136660) refactor(control-ui): consolidate mention inbox requests (#137375) fix(openai): preserve ChatGPT HTTP status for retry pacing (#137146) fix(mcp): hide policy-denied plugin tools from ACP sessions [AI] (#136546) test(queue): reuse shared deferred fixtures (#137338) fix(gateway): repair the Gateway E2E shard (browser suite project, skill resource argv, Codex diagnostic) (#137358)
Use the existing suite helper for auth cold-path and diagnostic tests. Keep suite-specific resets and every case and assertion unchanged. Validation: 16 paired cases, scoped formatting, the LOCAL changed gate, and independent Codex P2 review passed. Production delta 0; tests -16.
What Problem This Solves
The auth cold-path and diagnostic-event suites repeat environment restoration and harness reset plumbing already owned by the shared isolated-cron suite helper.
Why This Change Was Made
Use the existing helper before each suite's local resets. Keep the strict job fixtures, every test body and assertion, per-case overrides, and diagnostic listener cleanup unchanged. This removes 16 test lines with no production or shared-harness changes.
User Impact
No product behavior changes. Auth cold-path, configured-profile propagation, diagnostic lifecycle/disablement/session attribution, and usage-accounting coverage remain intact.
Evidence
finallycleanup remains unchanged.de2382a754063b2625fe1190ef6ccab2f98889e8base with the frozen dependency graph reconciled.