Repository navigation
test(ui,security,providers): remove low-value tests (batch d631) - #185043
Conversation
Share menu sizing setup across preset pinning and both height-mode directions. Preserve operation payload and checkbox assertions for each branch. The retained tall-document case covers the raised auto-height cap; short-card and chrome-height assertions cover card padding. Remove the duplicate menu re-enable check covered by board-view.test.ts: allows only one snapshot-derived board mutation at a time. Consolidate the shared text assertion loop without changing its checks.
Share clipboard retirement setup across resolve, reject, and disposal; retain completed-feedback retirement in the replacement flow. Keep keyed reorder coverage in the first Tabs test. HubTabs preserves an intentional no-selection state and moves focus without activating routes cover duplicate null-selection and Enter behavior in ui/src/components/hub-tabs.test.ts.
Consolidate workspace fixtures, directory symlinks and warning assertions. Preserve all security cases, including linked-root cycles, dangling roots, malformed-roster fallback, unverifiable realpaths, scan caps and unreadable directories. CI-only validation: plain oxlint, oxfmt and diff checks.
Keep file-symlink escape proof in the malformed-defaults test and use the realpath-failure test's initial audit for in-workspace acceptance. Retain linked-root cycles, dangling roots, both explicit workspaces, scan-cap boundaries and unreadable-directory cases. Reduce the shard from 207 original lines to 165; CI-only validation uses plain oxlint, oxfmt and diff checks.
Share account-binding and persisted-auth fixtures while preserving distinct policy and credential assertions. Cover enabled-only and empty channel configurations through the retained public presence test instead of a separate predicate test.
Reuse the strict directory walker instead of maintaining a second recursive inventory in the hosted Doctor preservation test. Preserve all four cases and every assertion, including file modes, symlink targets, bytes, and modification times. The 20% line target is not safely achievable in these already compact authority and lifecycle tests.
Keep the real config_unset proposal/approval and persistence path, but drop schema inventory and intermediate proposal-shape assertions. The generic handoff is covered by system-agent-tool.test.ts: defers an approved mutation to the host after the full proposal handshake. Use the existing effect guard to expire authority after admission instead of wrapping the CLI. Keep exact unchanged-file and no-audit checks. Minimize sibling config fixtures and move Doctor PID/cwd assertions into the child fixture, eliminating the JSON reporting layer. The retained host responsiveness case proves subprocess execution without a duplicate doctorCommand mock. All four cases remain; total shard lines decrease from 181 to 144. Validation: plain oxlint, oxfmt, and diff-check; no tests run under CI-only mode.
Remove unused project/worktree RPC fixtures, inline the sole suite-setup caller, and reuse the canonical source-config snapshot fixture. Keep all consumer cases and assertions, including access revocation, recovery fencing, and async lifecycle coverage. Reduction is 16 of 210 helper lines; remaining helpers serve distinct fixture, mounting, cleanup, and assertion behavior.
Consolidate the cloud-worker mount and fixture helpers behind their existing imports. Replace the custom disposer stack with Vitest onTestFinished; the shared UI dom.setup owns Solid unmounts, and config-test-harness owns timer restoration. Remove unused worker-id and initial-scope overrides without changing consumer cases or assertions. Combined shard size is 210 to 168 lines (20%).
Reuse the catalog fixture and compact typed partial mocks and reply assertions. Retain all marketplace identity/policy and queued node authority cases; these tight suites have no redundant behavior layer to remove safely.
Drop parser success replays covered by preserves authorized workspace catalogs and deduplicates a trusted source with restrictive policy. Keep invalid identifier boundaries and every queued-node authority outcome, while removing argument-shape assertions and irrelevant fixture scaffolding.
Consolidate repeated failure-copy fixtures and session-row tables without deleting cases or weakening assertions. Preserve all diagnostic recovery regressions from 1939549 and permission-error coverage from 2a8b77f. CI-only validation: formatting, diff checks, and plain oxlint pass; test execution deferred to hosted CI. Reduction is below target because the remaining paths protect distinct recovery, persistence, and error-presentation behavior.
Keep diagnostic rekey, retained-cleanup ordering, and both queued-input branches with shared local fixtures. Keep typed storage and permission copy checks plus legacy session-row classification; remove legacy append replays of that classifier. The ordinary append fallback and common report flags remain covered by session-lifecycle-run-failure.test.ts: records a run-timeout kill delivered as an aborted phase event; retains same-account context after phase outside the CLI stack. Preserve an assertion guard for the append callback. Shard total: 202 to 161 lines (20.3%). Static formatting, diff, and oxlint gates only; no test execution in CI-only mode.
Reuse createGatewayCloseRace from server-close.race.test-support for the abort handshake, held replies, close tracking and cleanup already used by server-close.lifecycle-read and server-close.placement tests. Preserve both cron commits and persisted rows, initial/deferred recovery failures, and both synthetic request gates. Wrong-target error resolution proves the throwing custody check was not called; the exact-target case retains its rejection assertion.
Share carrier and builtin assertion setup, sudo flag fixtures, and shell/segment argv fixtures. Preserve all existing input variants and exact outcomes for command and approval security boundaries. CI-only validation: oxlint, oxfmt, and diff check; 198 to 164 lines.
Remove the duplicate focus-handoff case: sessions-hub-tabs.test.ts covers retiring-route focus transfer and hub-tabs.test.ts covers keyboard selection. Keep browser geometry checks and all sidebar lifecycle assertions. Reuse mountSolid container ownership instead of a separate root cleanup helper.
Share the crowded HubTabs fixture across layout checks. Keep pending-to-ready router, replacement, scroll and detach behavior while removing repeated identity checks: sidebar-context-state.test.ts covers data forwarding and snapshot equality, and app-sidebar.projection-memo.test.ts covers owner preservation across view recreation. Keep the final detached-navigation assertion rather than repeat it before navigation.
Compact route metadata and scope discovery fixtures to the family under test. Retain all four protocol round trips, saved-route normalization, proxy preservation, and offline fallbacks from the API-migration regression (e6d28fe).
Remove duplicate listing URL bookkeeping: index.test.ts already proves that endpoint in joins account-listed chat models with metadata and excludes retired models. Minimize discovery metadata and retain presence checks with assertions. Preserve all protocol, saved-route, proxy, and offline fallback checks.
Remove duplicate MP3 and lowercase RIFF mapping inputs; ogg-mp3 and uppercase RIFF retain their branches. Sibling speech-provider tests uses native Ogg/Opus for voice-note output, honors voice and language overrides for telephony output, and routes synthesis with configured endpoints retain audio, credential, header, and routing proof. voices-timeout.test.ts retains real abort-signal proof. Preserve SSML escaping, catalog filters, audio caps, empty audio and malformed-response socket cleanup.
Shrink synthetic catalog records and the synthesis request builder while preserving filtering, metadata, SSML, overflow, and socket-cleanup assertions. Remove the Ogg metadata replay covered by speech-provider.test.ts: uses native Ogg/Opus for voice-note output. Flatten the redundant file-level suite wrapper. Shard now totals 150 lines, down from 188; CI-only static checks passed.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e1c952f00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export function setupSnapshotTests() { | ||
| const disposers: Array<() => void> = []; | ||
| afterEach(() => { | ||
| for (const dispose of disposers.splice(0).toReversed()) { | ||
| dispose(); | ||
| } | ||
| beforeEach(async () => { | ||
| vi.clearAllMocks(); | ||
| vi.mocked(showConfirmDialog).mockResolvedValue(true); | ||
| await i18n.setLocale("en"); | ||
| }); | ||
| dom.setupSnapshotsDomSuite(); | ||
| return (...args: Parameters<typeof dom.mountPage>) => { | ||
| const fixture = dom.mountPage(...args); | ||
| disposers.push(fixture.dispose); | ||
| return fixture; | ||
| }; | ||
| return mountPage; |
There was a problem hiding this comment.
Restore real timers after each snapshot test
The consolidated setup drops the previous afterEach(() => vi.useRealTimers()), but cloud-worker-snapshots.test.ts still enables fake timers in both the machine-save/capacity test and the automatic-preparation polling test. Consequently, subsequent cases inherit the fake clock and pending timers instead of running with their intended timer environment. The shared DOM setup only cleans up Solid roots, and the non-isolated runner restores timers between files, not between these cases. Retain the timer-reset hook in this setup so the snapshot tests remain independent.
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. What this changesThis PR consolidates test fixtures and overlapping assertions while retaining lifecycle, authorization, routing, cleanup, and UI interaction coverage. Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this is useful maintainer-authored test maintenance, with no actionable regression found in the introduced diff. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe changed test suites feed synthetic filesystem, provider, Gateway, and UI inputs through existing owners and assert their observable results and cleanup. flowchart LR
Fixtures[Synthetic fixtures] --> Suites[Test suites]
Suites --> Owners[Existing production owners]
Owners --> Results[Results and side effects]
Results --> Assertions[Behavior assertions]
CI[Hosted CI] --> Suites
Technical reviewBest possible solution: Retain the consolidated fixtures and distinct boundary assertions, then land through the existing current-head CI gate. Do we have a high-confidence way to reproduce the issue? There is no product bug to reproduce; this read-only review compared the introduced test changes with their prior assertions, retained sibling coverage, and current-head CI results. Is this the best way to solve the issue? Fixture consolidation within existing suites is appropriate, and the simplification review found no definite unnecessary machinery or lost distinct contract requiring repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 183f52b9cd7b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -666, Other -1. Total -667 across 27 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 26, 2026, 6:16 PM ET / 22:16 UTC. |
…nclaw#185043) * test(ui): consolidate o0655 sizing scenarios Share menu sizing setup across preset pinning and both height-mode directions. Preserve operation payload and checkbox assertions for each branch. The retained tall-document case covers the raised auto-height cap; short-card and chrome-height assertions cover card padding. Remove the duplicate menu re-enable check covered by board-view.test.ts: allows only one snapshot-derived board mutation at a time. Consolidate the shared text assertion loop without changing its checks. * test(ui): deslop o0656 tests * test(ui): consolidate o0656 lifecycle coverage Share clipboard retirement setup across resolve, reject, and disposal; retain completed-feedback retirement in the replacement flow. Keep keyed reorder coverage in the first Tabs test. HubTabs preserves an intentional no-selection state and moves focus without activating routes cover duplicate null-selection and Enter behavior in ui/src/components/hub-tabs.test.ts. * test(security): deslop o0659 tests Consolidate workspace fixtures, directory symlinks and warning assertions. Preserve all security cases, including linked-root cycles, dangling roots, malformed-roster fallback, unverifiable realpaths, scan caps and unreadable directories. CI-only validation: plain oxlint, oxfmt and diff checks. * test(security): consolidate o0659 audit fixtures Keep file-symlink escape proof in the malformed-defaults test and use the realpath-failure test's initial audit for in-workspace acceptance. Retain linked-root cycles, dangling roots, both explicit workspaces, scan-cap boundaries and unreadable-directory cases. Reduce the shard from 207 original lines to 165; CI-only validation uses plain oxlint, oxfmt and diff checks. * test(channels): deslop o0660 tests Share account-binding and persisted-auth fixtures while preserving distinct policy and credential assertions. Cover enabled-only and empty channel configurations through the retained public presence test instead of a separate predicate test. * test(system-agent): deslop o0658 tests Reuse the strict directory walker instead of maintaining a second recursive inventory in the hosted Doctor preservation test. Preserve all four cases and every assertion, including file modes, symlink targets, bytes, and modification times. The 20% line target is not safely achievable in these already compact authority and lifecycle tests. * test(system-agent): consolidate o0658 boundary fixtures Keep the real config_unset proposal/approval and persistence path, but drop schema inventory and intermediate proposal-shape assertions. The generic handoff is covered by system-agent-tool.test.ts: defers an approved mutation to the host after the full proposal handshake. Use the existing effect guard to expire authority after admission instead of wrapping the CLI. Keep exact unchanged-file and no-audit checks. Minimize sibling config fixtures and move Doctor PID/cwd assertions into the child fixture, eliminating the JSON reporting layer. The retained host responsiveness case proves subprocess execution without a duplicate doctorCommand mock. All four cases remain; total shard lines decrease from 181 to 144. Validation: plain oxlint, oxfmt, and diff-check; no tests run under CI-only mode. * test(ui): deslop o0657 tests Remove unused project/worktree RPC fixtures, inline the sole suite-setup caller, and reuse the canonical source-config snapshot fixture. Keep all consumer cases and assertions, including access revocation, recovery fencing, and async lifecycle coverage. Reduction is 16 of 210 helper lines; remaining helpers serve distinct fixture, mounting, cleanup, and assertion behavior. * test(ui): consolidate o0657 fixture lifecycle Consolidate the cloud-worker mount and fixture helpers behind their existing imports. Replace the custom disposer stack with Vitest onTestFinished; the shared UI dom.setup owns Solid unmounts, and config-test-harness owns timer restoration. Remove unused worker-id and initial-scope overrides without changing consumer cases or assertions. Combined shard size is 210 to 168 lines (20%). * test(agents): deslop o0662 tests * test(codex): deslop o0661 tests Reuse the catalog fixture and compact typed partial mocks and reply assertions. Retain all marketplace identity/policy and queued node authority cases; these tight suites have no redundant behavior layer to remove safely. * test(codex): finish structural cuts for o0661 Drop parser success replays covered by preserves authorized workspace catalogs and deduplicates a trusted source with restrictive policy. Keep invalid identifier boundaries and every queued-node authority outcome, while removing argument-shape assertions and irrelevant fixture scaffolding. * test(media-generation): deslop o0665 tests * test(sessions): deslop o0664 tests Consolidate repeated failure-copy fixtures and session-row tables without deleting cases or weakening assertions. Preserve all diagnostic recovery regressions from 7a348ed and permission-error coverage from 1dbe439. CI-only validation: formatting, diff checks, and plain oxlint pass; test execution deferred to hosted CI. Reduction is below target because the remaining paths protect distinct recovery, persistence, and error-presentation behavior. * test(sessions): consolidate o0664 boundary coverage Keep diagnostic rekey, retained-cleanup ordering, and both queued-input branches with shared local fixtures. Keep typed storage and permission copy checks plus legacy session-row classification; remove legacy append replays of that classifier. The ordinary append fallback and common report flags remain covered by session-lifecycle-run-failure.test.ts: records a run-timeout kill delivered as an aborted phase event; retains same-account context after phase outside the CLI stack. Preserve an assertion guard for the append callback. Shard total: 202 to 161 lines (20.3%). Static formatting, diff, and oxlint gates only; no test execution in CI-only mode. * test(gateway): deslop o0663 tests * test(gateway): consolidate o0663 lifecycle fixtures Reuse createGatewayCloseRace from server-close.race.test-support for the abort handshake, held replies, close tracking and cleanup already used by server-close.lifecycle-read and server-close.placement tests. Preserve both cron commits and persisted rows, initial/deferred recovery failures, and both synthetic request gates. Wrong-target error resolution proves the throwing custody check was not called; the exact-target case retains its rejection assertion. * test(byteplus): deslop o0668 tests * test(infra): deslop o0667 tests Share carrier and builtin assertion setup, sudo flag fixtures, and shell/segment argv fixtures. Preserve all existing input variants and exact outcomes for command and approval security boundaries. CI-only validation: oxlint, oxfmt, and diff check; 198 to 164 lines. * test(ui): deslop o0666 tests Remove the duplicate focus-handoff case: sessions-hub-tabs.test.ts covers retiring-route focus transfer and hub-tabs.test.ts covers keyboard selection. Keep browser geometry checks and all sidebar lifecycle assertions. Reuse mountSolid container ownership instead of a separate root cleanup helper. * test(ui): consolidate o0666 layout fixtures Share the crowded HubTabs fixture across layout checks. Keep pending-to-ready router, replacement, scroll and detach behavior while removing repeated identity checks: sidebar-context-state.test.ts covers data forwarding and snapshot equality, and app-sidebar.projection-memo.test.ts covers owner preservation across view recreation. Keep the final detached-navigation assertion rather than repeat it before navigation. * test(auto-reply): deslop o0671 tests * test(clawrouter): deslop o0669 tests * test(clawrouter): consolidate o0669 pool fixtures * test(opencode-go): deslop o0670 tests Compact route metadata and scope discovery fixtures to the family under test. Retain all four protocol round trips, saved-route normalization, proxy preservation, and offline fallbacks from the API-migration regression (89daa68). * test(opencode-go): trim redundant routing setup Remove duplicate listing URL bookkeeping: index.test.ts already proves that endpoint in joins account-listed chat models with metadata and excludes retired models. Minimize discovery metadata and retain presence checks with assertions. Preserve all protocol, saved-route, proxy, and offline fallback checks. * test(oc-path): deslop o0673 tests * test(azure-speech): deslop o0672 tests Remove duplicate MP3 and lowercase RIFF mapping inputs; ogg-mp3 and uppercase RIFF retain their branches. Sibling speech-provider tests uses native Ogg/Opus for voice-note output, honors voice and language overrides for telephony output, and routes synthesis with configured endpoints retain audio, credential, header, and routing proof. voices-timeout.test.ts retains real abort-signal proof. Preserve SSML escaping, catalog filters, audio caps, empty audio and malformed-response socket cleanup. * test(azure-speech): compact o0672 fixtures Shrink synthetic catalog records and the synthesis request builder while preserving filtering, metadata, SSML, overflow, and socket-cleanup assertions. Remove the Ogg metadata replay covered by speech-provider.test.ts: uses native Ogg/Opus for voice-note output. Flatten the redundant file-level suite wrapper. Shard now totals 150 lines, down from 188; CI-only static checks passed. * test: preserve boundary contracts in fixture consolidation * test: preserve table typing and mock isolation * test: prune explained channel mock baseline
What Problem This Solves
Consolidate repeated test fixtures and remove redundant assertions in batch d631. Retained tests continue to cover authorization, lifecycle retirement, cleanup, request policy, routing, and UI interaction boundaries. This changes tests and test support only; no production behavior or public API changes.
All 30 supplied commits were replayed onto pinned main
ec34584e091264fc64f1b4a38bc68beb072b637e. Two commits were partially applied: the board-sizing hunk from5e24cec5dfdaand config-unset hunk from57dfcc2efabawere dropped in favor of main's newer tests and fixtures. Their independent board helper and Doctor process changes remain. No complete commit was skipped. The only baseline change removes the exact obsolete channel-mock entry identified by CI after its isolation rationale was documented.Evidence
27 files: +1,074 / -1,741 lines, net -667. Production: +0/-0. Test files: +969/-1,600 (net -631). Test support: +105/-140 (net -35). Shrink-only baseline: +0/-1.
Local checks passed: frozen-lockfile installation;
node_modules/.bin/oxfmt --writeon all 26 changed files; plainnode_modules/.bin/oxlint -c .oxlintrc.jsonon all changed files (exit 0);git diff --checkagainst the pinned main base. Under the operator's CI-only rule, Vitest, check-changed, typechecks, coverage, and Testbox were not run locally. Hostedopenclaw/ci-gateis the test gate. No runtime or coverage result is inferred from static checks.Independent autoreview found six actionable issues, all accepted and repaired in
2776ca8e743f: restored cloud-worker project/worktree replies and timer cleanup; retained exact native-node resume arguments; restored transcript display/type/context-exclusion assertions; retained Azure request URL/method/headers/signal assertions; and tightened model-discovery URL verification. The follow-up review was scoped-clean through P2. The original metadata check rejected nonstandard section headings; these headings were corrected without changing source.CI on
2776ca8e743fthen found a Vitest table tuple-inference error and a moved partial channel mock requiring its isolation rationale.c6c0401a5210preserves readonly tuple rows and documents synthetic-channel isolation; no cases or assertions changed. Formatting, plain lint, diff-check, and another P2 review passed. Fresh-head CI is required; neither red check is treated as pre-existing.CI on
c6c0401a5210passed the type checks and then required removal of the now-obsolete exact mock-baseline row. That single-row shrink passed independent P2 review; no exception was added and no assertions were changed.The source shard reports explicitly say coverage was not run under CI-only instructions; there is no measured coverage totals line to reproduce. Each row below records that gap. Counts are replayed-tree physical lines and static
it/testdeclarations (not expanded table cases), relative to the pinned main. Source reports precede some follow-up consolidation commits, so their earlier counts are not presented as final counts.No changed path matches the current CODEOWNERS rules.
Shard inventory
ui/src/components/board/board-view.test-support.tsui/src/components/solid/tabs.test.tsxui/src/components/solid/copy-button.test.tsxui/src/pages/cloud-workers/cloud-worker-snapshots-dom.test-support.tsui/src/pages/cloud-workers/cloud-workers.test-support.tssrc/system-agent/operations.doctor.process.test.tssrc/skills/security/workspace-audit.test.tssrc/channels/config-presence.test.tssrc/channels/thread-bindings-policy.test.tsextensions/codex/src/conversation-binding-node.test.tsextensions/codex/src/plugin-marketplace-discovery.test.tssrc/agents/tools/tts-tool.test.tssrc/gateway/agent-input-recovery.test.tssrc/gateway/server-close.cron.test.tssrc/sessions/session-controller.diagnostic-state.test.tssrc/sessions/session-run-error.test.tssrc/media-generation/provider-assets.test.tsui/src/components/hub-tabs.browser.test.tsxui/src/components/sidebar-context-controller.test.tssrc/infra/command-analysis/risks.test.tsextensions/byteplus/video-generation-request-policy.test.tsextensions/clawrouter/browser/pool.test.tsextensions/opencode-go/routing.test.tssrc/auto-reply/reply/commands-subagents/action-agents.test.tsextensions/azure-speech/tts.test.tsextensions/oc-path/src/oc-path/tests/yaml/yaml-kind.test.ts