Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test: increase test coverage across various modules

Steven Enamakel2837ac5dd50e
diff --git a/app/src/__tests__/shimmerUtility.test.ts b/app/src/__tests__/shimmerUtility.test.ts
index 496190d91a..d003674240 100644
--- a/app/src/__tests__/shimmerUtility.test.ts
+++ b/app/src/__tests__/shimmerUtility.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/chat/__tests__/promptInjectionGuard.test.ts b/app/src/chat/__tests__/promptInjectionGuard.test.ts
index b810d423df..10e7642850 100644
--- a/app/src/chat/__tests__/promptInjectionGuard.test.ts
+++ b/app/src/chat/__tests__/promptInjectionGuard.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { checkPromptInjection, promptGuardMessage } from '../promptInjectionGuard';
diff --git a/app/src/components/assistant-ui/elements/reasoningSteps.test.ts b/app/src/components/assistant-ui/elements/reasoningSteps.test.ts
index 71f35b65ee..5a6e8d4e10 100644
--- a/app/src/components/assistant-ui/elements/reasoningSteps.test.ts
+++ b/app/src/components/assistant-ui/elements/reasoningSteps.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import en from '../../../lib/i18n/en';
diff --git a/app/src/components/channels/mcp/registryAdd.test.ts b/app/src/components/channels/mcp/registryAdd.test.ts
index 52b91bc831..e5e056bac6 100644
--- a/app/src/components/channels/mcp/registryAdd.test.ts
+++ b/app/src/components/channels/mcp/registryAdd.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { declareServer, isAddCandidate, resolveHostedEntry } from './registryAdd';
diff --git a/app/src/components/composio/toolkitRequiredFields.test.ts b/app/src/components/composio/toolkitRequiredFields.test.ts
index a8b063e5b0..83a617b59d 100644
--- a/app/src/components/composio/toolkitRequiredFields.test.ts
+++ b/app/src/components/composio/toolkitRequiredFields.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/components/dashboard/formatCurrency.test.ts b/app/src/components/dashboard/formatCurrency.test.ts
index d48de8d86f..b04db6f972 100644
--- a/app/src/components/dashboard/formatCurrency.test.ts
+++ b/app/src/components/dashboard/formatCurrency.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/components/intelligence/__tests__/utils.test.ts b/app/src/components/intelligence/__tests__/utils.test.ts
index c9fea41708..9dd7b8a420 100644
--- a/app/src/components/intelligence/__tests__/utils.test.ts
+++ b/app/src/components/intelligence/__tests__/utils.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
import type { ActionableItem } from '../../../types/intelligence';
diff --git a/app/src/components/memory/memoryLifecycleLabels.test.ts b/app/src/components/memory/memoryLifecycleLabels.test.ts
index 984ca26a20..631f545ac3 100644
--- a/app/src/components/memory/memoryLifecycleLabels.test.ts
+++ b/app/src/components/memory/memoryLifecycleLabels.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { brainSourceLabel } from './memoryLifecycleLabels';
diff --git a/app/src/components/settings/__tests__/settingsRouteRegistry.test.ts b/app/src/components/settings/__tests__/settingsRouteRegistry.test.ts
index 306eeba2c7..c7f15e6f2f 100644
--- a/app/src/components/settings/__tests__/settingsRouteRegistry.test.ts
+++ b/app/src/components/settings/__tests__/settingsRouteRegistry.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for settingsRouteRegistry helpers.
*
diff --git a/app/src/components/settings/panels/__tests__/aiRouting.test.ts b/app/src/components/settings/panels/__tests__/aiRouting.test.ts
index a51b9e580a..047fd02583 100644
--- a/app/src/components/settings/panels/__tests__/aiRouting.test.ts
+++ b/app/src/components/settings/panels/__tests__/aiRouting.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { CloudProvider, ProviderRef, RoutingMap } from '../AIPanel';
diff --git a/app/src/components/settings/panels/__tests__/azureDeployment.test.ts b/app/src/components/settings/panels/__tests__/azureDeployment.test.ts
index b49a52eed5..5e8cd2a656 100644
--- a/app/src/components/settings/panels/__tests__/azureDeployment.test.ts
+++ b/app/src/components/settings/panels/__tests__/azureDeployment.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/components/settings/panels/__tests__/billingHelpers.test.ts b/app/src/components/settings/panels/__tests__/billingHelpers.test.ts
index 0fcb1c3a36..37b1e0bd78 100644
--- a/app/src/components/settings/panels/__tests__/billingHelpers.test.ts
+++ b/app/src/components/settings/panels/__tests__/billingHelpers.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { PlanTier } from '../../../../types/api';
diff --git a/app/src/components/settings/panels/__tests__/builtinCloudProviders.test.ts b/app/src/components/settings/panels/__tests__/builtinCloudProviders.test.ts
index 8e218e0a40..ec3f7dfe18 100644
--- a/app/src/components/settings/panels/__tests__/builtinCloudProviders.test.ts
+++ b/app/src/components/settings/panels/__tests__/builtinCloudProviders.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/components/settings/panels/ai/backgroundLoopPrimitives.test.ts b/app/src/components/settings/panels/ai/backgroundLoopPrimitives.test.ts
index fd22f783c8..fa40b9a1b0 100644
--- a/app/src/components/settings/panels/ai/backgroundLoopPrimitives.test.ts
+++ b/app/src/components/settings/panels/ai/backgroundLoopPrimitives.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { formatUsd } from './backgroundLoopPrimitives';
diff --git a/app/src/components/settings/panels/ai/deriveOllamaState.test.ts b/app/src/components/settings/panels/ai/deriveOllamaState.test.ts
index 95e0415a2c..386f5982d3 100644
--- a/app/src/components/settings/panels/ai/deriveOllamaState.test.ts
+++ b/app/src/components/settings/panels/ai/deriveOllamaState.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { LocalProviderSnapshot } from '../../../../services/api/aiSettingsApi';
diff --git a/app/src/components/settings/panels/persona/personaTemplates.test.ts b/app/src/components/settings/panels/persona/personaTemplates.test.ts
index 2dcb723dc8..6d50d45f98 100644
--- a/app/src/components/settings/panels/persona/personaTemplates.test.ts
+++ b/app/src/components/settings/panels/persona/personaTemplates.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { parsePersonaFields } from './personaSections';
diff --git a/app/src/config/__tests__/navConfig.test.ts b/app/src/config/__tests__/navConfig.test.ts
index 9e9fea86c5..23458596e3 100644
--- a/app/src/config/__tests__/navConfig.test.ts
+++ b/app/src/config/__tests__/navConfig.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { AVATAR_MENU_ITEMS, NAV_TABS } from '../navConfig';
diff --git a/app/src/features/conversations/aui/taskCardHistory.test.ts b/app/src/features/conversations/aui/taskCardHistory.test.ts
index c1a29472a3..68eabb928b 100644
--- a/app/src/features/conversations/aui/taskCardHistory.test.ts
+++ b/app/src/features/conversations/aui/taskCardHistory.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { taskState, type TurnTask, updateTaskHistory } from './taskCardHistory';
diff --git a/app/src/features/conversations/composerSendDecision.test.ts b/app/src/features/conversations/composerSendDecision.test.ts
index 9e7e1090a8..75872e23fa 100644
--- a/app/src/features/conversations/composerSendDecision.test.ts
+++ b/app/src/features/conversations/composerSendDecision.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/features/conversations/derived/mapDisplayItems.test.ts b/app/src/features/conversations/derived/mapDisplayItems.test.ts
index e553d2b033..3ddb8cbcce 100644
--- a/app/src/features/conversations/derived/mapDisplayItems.test.ts
+++ b/app/src/features/conversations/derived/mapDisplayItems.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { DerivedDisplayItem } from '../../../types/derivedTranscript';
diff --git a/app/src/features/conversations/threadList/groupThreads.test.ts b/app/src/features/conversations/threadList/groupThreads.test.ts
index 27b3efc6ec..bad2501893 100644
--- a/app/src/features/conversations/threadList/groupThreads.test.ts
+++ b/app/src/features/conversations/threadList/groupThreads.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { Thread } from '../../../types/thread';
diff --git a/app/src/features/conversations/tools/mcpUi/types.test.ts b/app/src/features/conversations/tools/mcpUi/types.test.ts
index 47b2e56504..750fd58b93 100644
--- a/app/src/features/conversations/tools/mcpUi/types.test.ts
+++ b/app/src/features/conversations/tools/mcpUi/types.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { hasWidget, isImageUrl, readMcpUiPresentation } from './types';
diff --git a/app/src/features/conversations/tools/mcpUi/widgetUrl.test.ts b/app/src/features/conversations/tools/mcpUi/widgetUrl.test.ts
index 2354fdfb91..e90d81e21a 100644
--- a/app/src/features/conversations/tools/mcpUi/widgetUrl.test.ts
+++ b/app/src/features/conversations/tools/mcpUi/widgetUrl.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { FILL_WIDTH } from './frameFit';
diff --git a/app/src/features/conversations/tools/parseWebSearchResult.test.ts b/app/src/features/conversations/tools/parseWebSearchResult.test.ts
index ae038d39b5..b7d4b59e55 100644
--- a/app/src/features/conversations/tools/parseWebSearchResult.test.ts
+++ b/app/src/features/conversations/tools/parseWebSearchResult.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { extractAgentSources } from '../../../utils/toolTimelineFormatting';
diff --git a/app/src/features/conversations/tools/toolPhrases.test.ts b/app/src/features/conversations/tools/toolPhrases.test.ts
index 72fe33e868..f3e9f00d22 100644
--- a/app/src/features/conversations/tools/toolPhrases.test.ts
+++ b/app/src/features/conversations/tools/toolPhrases.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import en from '../../../lib/i18n/en';
diff --git a/app/src/features/conversations/tools/toolPresentation.catalog.test.ts b/app/src/features/conversations/tools/toolPresentation.catalog.test.ts
index 5f990acbb6..743e2e5405 100644
--- a/app/src/features/conversations/tools/toolPresentation.catalog.test.ts
+++ b/app/src/features/conversations/tools/toolPresentation.catalog.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* The "never again" guard for tool labels.
*
diff --git a/app/src/features/conversations/utils/format.test.ts b/app/src/features/conversations/utils/format.test.ts
index 7faa72d898..787ba91da8 100644
--- a/app/src/features/conversations/utils/format.test.ts
+++ b/app/src/features/conversations/utils/format.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { classifyHref, isAllowedExternalHref, transformChatUrl } from './format';
diff --git a/app/src/features/conversations/utils/openTinyVoice.test.ts b/app/src/features/conversations/utils/openTinyVoice.test.ts
index 3faa0afc44..7a049beb65 100644
--- a/app/src/features/conversations/utils/openTinyVoice.test.ts
+++ b/app/src/features/conversations/utils/openTinyVoice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import { openTinyVoice } from './openTinyVoice';
diff --git a/app/src/features/conversations/utils/threadFilter.test.ts b/app/src/features/conversations/utils/threadFilter.test.ts
index ca2a799719..f977596544 100644
--- a/app/src/features/conversations/utils/threadFilter.test.ts
+++ b/app/src/features/conversations/utils/threadFilter.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { Thread } from '../../../types/thread';
diff --git a/app/src/features/conversations/utils/workerThreadRef.test.ts b/app/src/features/conversations/utils/workerThreadRef.test.ts
index d050768629..8a16aee073 100644
--- a/app/src/features/conversations/utils/workerThreadRef.test.ts
+++ b/app/src/features/conversations/utils/workerThreadRef.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { parseWorkerThreadRef } from './workerThreadRef';
diff --git a/app/src/features/human/Mascot/manifest/stateEngine.test.ts b/app/src/features/human/Mascot/manifest/stateEngine.test.ts
index c7a9e4dac6..72088fdfb1 100644
--- a/app/src/features/human/Mascot/manifest/stateEngine.test.ts
+++ b/app/src/features/human/Mascot/manifest/stateEngine.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/features/human/Mascot/mascotPalette.test.ts b/app/src/features/human/Mascot/mascotPalette.test.ts
index 3d3e827523..5b919e27f6 100644
--- a/app/src/features/human/Mascot/mascotPalette.test.ts
+++ b/app/src/features/human/Mascot/mascotPalette.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { getMascotPalette, shadeHex } from './mascotPalette';
diff --git a/app/src/features/human/Mascot/riveMaps.test.ts b/app/src/features/human/Mascot/riveMaps.test.ts
index 4f57a2c376..5476adb9f8 100644
--- a/app/src/features/human/Mascot/riveMaps.test.ts
+++ b/app/src/features/human/Mascot/riveMaps.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { MascotFace } from './Ghosty';
diff --git a/app/src/features/human/Mascot/visemes.test.ts b/app/src/features/human/Mascot/visemes.test.ts
index 5ee1fa7d44..6b0bc1f983 100644
--- a/app/src/features/human/Mascot/visemes.test.ts
+++ b/app/src/features/human/Mascot/visemes.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { lerpViseme, REST_SMILE_PATH, visemePath, VISEMES } from './visemes';
diff --git a/app/src/features/human/chatMascot/geometry.test.ts b/app/src/features/human/chatMascot/geometry.test.ts
index 8f1e36eeb7..3a3f489241 100644
--- a/app/src/features/human/chatMascot/geometry.test.ts
+++ b/app/src/features/human/chatMascot/geometry.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/features/human/chatMascot/sendBinding.test.ts b/app/src/features/human/chatMascot/sendBinding.test.ts
index dae5808994..5952629a19 100644
--- a/app/src/features/human/chatMascot/sendBinding.test.ts
+++ b/app/src/features/human/chatMascot/sendBinding.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import { ChatMascotSendStore } from './sendBinding';
diff --git a/app/src/features/human/voice/amplitudeLipsync.test.ts b/app/src/features/human/voice/amplitudeLipsync.test.ts
index 3b2abbe2d0..4f8d88a3c6 100644
--- a/app/src/features/human/voice/amplitudeLipsync.test.ts
+++ b/app/src/features/human/voice/amplitudeLipsync.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { amplitudeToVisemeCode, smoothAmplitude } from './amplitudeLipsync';
diff --git a/app/src/features/human/voice/live/liveVoiceSocket.test.ts b/app/src/features/human/voice/live/liveVoiceSocket.test.ts
index eb7fe35d1e..121577448b 100644
--- a/app/src/features/human/voice/live/liveVoiceSocket.test.ts
+++ b/app/src/features/human/voice/live/liveVoiceSocket.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { FakeWebSocket } from '../../../../test/liveVoiceFakes';
diff --git a/app/src/features/human/voice/readbackPrefix.contract.test.ts b/app/src/features/human/voice/readbackPrefix.contract.test.ts
index 09cc4a0ac0..fee11f257c 100644
--- a/app/src/features/human/voice/readbackPrefix.contract.test.ts
+++ b/app/src/features/human/voice/readbackPrefix.contract.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* The read-back prefix is a behavioural contract that spans two languages: the
* renderer wraps a deferred answer in it, and the Rust harness recognises it to
diff --git a/app/src/features/human/voice/ttsQueue.test.ts b/app/src/features/human/voice/ttsQueue.test.ts
index b7c2c17bb3..4a49403712 100644
--- a/app/src/features/human/voice/ttsQueue.test.ts
+++ b/app/src/features/human/voice/ttsQueue.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { VISEMES } from '../Mascot/visemes';
diff --git a/app/src/features/human/voice/visemeMap.test.ts b/app/src/features/human/voice/visemeMap.test.ts
index 43b7d2d967..cb90e23677 100644
--- a/app/src/features/human/voice/visemeMap.test.ts
+++ b/app/src/features/human/voice/visemeMap.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { VISEMES } from '../Mascot/visemes';
diff --git a/app/src/features/human/voiceEntry.test.ts b/app/src/features/human/voiceEntry.test.ts
index 8326ab5193..a07095177f 100644
--- a/app/src/features/human/voiceEntry.test.ts
+++ b/app/src/features/human/voiceEntry.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { resolveHumanVoiceEntry } from './voiceEntry';
diff --git a/app/src/features/wallet/__tests__/walletDisplay.test.ts b/app/src/features/wallet/__tests__/walletDisplay.test.ts
index cdbbfa88b4..22a064cb62 100644
--- a/app/src/features/wallet/__tests__/walletDisplay.test.ts
+++ b/app/src/features/wallet/__tests__/walletDisplay.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/features/wallet/setupLocalWalletFromMnemonic.test.ts b/app/src/features/wallet/setupLocalWalletFromMnemonic.test.ts
index 0dba8aaeae..2f2dd97396 100644
--- a/app/src/features/wallet/setupLocalWalletFromMnemonic.test.ts
+++ b/app/src/features/wallet/setupLocalWalletFromMnemonic.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import { persistLocalWalletFromMnemonic } from './setupLocalWalletFromMnemonic';
diff --git a/app/src/lib/ai/skillToolChainLatency.test.ts b/app/src/lib/ai/skillToolChainLatency.test.ts
index e389357ecd..dd96534df3 100644
--- a/app/src/lib/ai/skillToolChainLatency.test.ts
+++ b/app/src/lib/ai/skillToolChainLatency.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/lib/bootCheck/index.test.ts b/app/src/lib/bootCheck/index.test.ts
index 4aa7686d6c..b4c18e54b4 100644
--- a/app/src/lib/bootCheck/index.test.ts
+++ b/app/src/lib/bootCheck/index.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for the boot-check orchestrator.
*
diff --git a/app/src/lib/channels/__tests__/definitions.test.ts b/app/src/lib/channels/__tests__/definitions.test.ts
index 3f5afd5a23..8e8a3af529 100644
--- a/app/src/lib/channels/__tests__/definitions.test.ts
+++ b/app/src/lib/channels/__tests__/definitions.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { AUTH_MODE_LABELS, FALLBACK_DEFINITIONS, STATUS_STYLES } from '../definitions';
diff --git a/app/src/lib/chat/toolCallEnvelope.test.ts b/app/src/lib/chat/toolCallEnvelope.test.ts
index 4a23f5c284..0a45c0c8b3 100644
--- a/app/src/lib/chat/toolCallEnvelope.test.ts
+++ b/app/src/lib/chat/toolCallEnvelope.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { unwrapToolCallEnvelope } from './toolCallEnvelope';
diff --git a/app/src/lib/chatErrorCopy.test.ts b/app/src/lib/chatErrorCopy.test.ts
index c29a26aa4e..d98af93642 100644
--- a/app/src/lib/chatErrorCopy.test.ts
+++ b/app/src/lib/chatErrorCopy.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/lib/cn.test.ts b/app/src/lib/cn.test.ts
index 46cc437cf1..2d91367ce8 100644
--- a/app/src/lib/cn.test.ts
+++ b/app/src/lib/cn.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/lib/commands/__tests__/registry.test.ts b/app/src/lib/commands/__tests__/registry.test.ts
index a825bb4b7c..782b645cb1 100644
--- a/app/src/lib/commands/__tests__/registry.test.ts
+++ b/app/src/lib/commands/__tests__/registry.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { createRegistry } from '../registry';
diff --git a/app/src/lib/commands/useSlashCommands.test.ts b/app/src/lib/commands/useSlashCommands.test.ts
index ae89d7df1b..addefadba1 100644
--- a/app/src/lib/commands/useSlashCommands.test.ts
+++ b/app/src/lib/commands/useSlashCommands.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import { registry } from './registry';
diff --git a/app/src/lib/composio/oauthHandoff.test.ts b/app/src/lib/composio/oauthHandoff.test.ts
index 95f11d2cb1..99dbcca276 100644
--- a/app/src/lib/composio/oauthHandoff.test.ts
+++ b/app/src/lib/composio/oauthHandoff.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/lib/composio/types.test.ts b/app/src/lib/composio/types.test.ts
index 693ddfa211..7d393824da 100644
--- a/app/src/lib/composio/types.test.ts
+++ b/app/src/lib/composio/types.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { type ComposioConnection, deriveComposioState } from './types';
diff --git a/app/src/lib/configRecoveryNotice.test.ts b/app/src/lib/configRecoveryNotice.test.ts
index 695adb4086..fe63584c9e 100644
--- a/app/src/lib/configRecoveryNotice.test.ts
+++ b/app/src/lib/configRecoveryNotice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it } from 'vitest';
import { store } from '../store';
diff --git a/app/src/lib/coreState/__tests__/store.test.ts b/app/src/lib/coreState/__tests__/store.test.ts
index dbe4d52e8e..8a73d613f3 100644
--- a/app/src/lib/coreState/__tests__/store.test.ts
+++ b/app/src/lib/coreState/__tests__/store.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { type CoreAppSnapshot, getCoreStateSnapshot, isWelcomeLocked } from '../store';
diff --git a/app/src/lib/cron/cronToHuman.test.ts b/app/src/lib/cron/cronToHuman.test.ts
index a57e76772c..460039062c 100644
--- a/app/src/lib/cron/cronToHuman.test.ts
+++ b/app/src/lib/cron/cronToHuman.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { cronToHuman } from './cronToHuman';
diff --git a/app/src/lib/cron/schedulePresets.test.ts b/app/src/lib/cron/schedulePresets.test.ts
index 01b05da286..48e362f3c2 100644
--- a/app/src/lib/cron/schedulePresets.test.ts
+++ b/app/src/lib/cron/schedulePresets.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { SCHEDULE_PRESET_VALUES, SCHEDULE_PRESETS } from './schedulePresets';
diff --git a/app/src/lib/flows/cron.test.ts b/app/src/lib/flows/cron.test.ts
index cb8f2cc737..c149e9742e 100644
--- a/app/src/lib/flows/cron.test.ts
+++ b/app/src/lib/flows/cron.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for the cron builder helper. Covers build → parse round-trips for
* the three supported shapes (minutes / hours / daily, with and without
diff --git a/app/src/lib/flows/flowValidation.test.ts b/app/src/lib/flows/flowValidation.test.ts
index 8715d4c6f8..f540333398 100644
--- a/app/src/lib/flows/flowValidation.test.ts
+++ b/app/src/lib/flows/flowValidation.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for `erroredNodeIds` (Phase 3c) — mapping graph-level validation
* error strings back to the node ids they name, for canvas highlighting.
diff --git a/app/src/lib/flows/graphDiff.test.ts b/app/src/lib/flows/graphDiff.test.ts
index 695f187b43..a5b6e64d33 100644
--- a/app/src/lib/flows/graphDiff.test.ts
+++ b/app/src/lib/flows/graphDiff.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { buildPreviewGraph, diffGraphs } from './graphDiff';
diff --git a/app/src/lib/flows/newFlow.test.ts b/app/src/lib/flows/newFlow.test.ts
index d319b26327..0735a31940 100644
--- a/app/src/lib/flows/newFlow.test.ts
+++ b/app/src/lib/flows/newFlow.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for `createBlankWorkflowGraph` (Phase 4a "start from scratch").
* Locks the starter-graph shape the chooser persists: a single `manual`
diff --git a/app/src/lib/flows/nodeSummary.test.ts b/app/src/lib/flows/nodeSummary.test.ts
index 6fe93b4b8a..780a97e238 100644
--- a/app/src/lib/flows/nodeSummary.test.ts
+++ b/app/src/lib/flows/nodeSummary.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for describeNode — the dynamic per-node card summary. Asserts the
* config-driven text for representative kinds plus the generic fallbacks when
diff --git a/app/src/lib/flows/runItems.test.ts b/app/src/lib/flows/runItems.test.ts
index 4b2f9349d2..fbbc4db5b7 100644
--- a/app/src/lib/flows/runItems.test.ts
+++ b/app/src/lib/flows/runItems.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* runItems — normalizer contract for the run inspector's per-item data browser.
*/
diff --git a/app/src/lib/flows/runStepSummary.test.ts b/app/src/lib/flows/runStepSummary.test.ts
index 2dccfec676..00d4a79b73 100644
--- a/app/src/lib/flows/runStepSummary.test.ts
+++ b/app/src/lib/flows/runStepSummary.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* runStepSummary (issue B20) — plain-language step summary derivation.
*
diff --git a/app/src/lib/flows/templates/templates.test.ts b/app/src/lib/flows/templates/templates.test.ts
index 0e9e6d0138..61e8fbad63 100644
--- a/app/src/lib/flows/templates/templates.test.ts
+++ b/app/src/lib/flows/templates/templates.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Structural validity tests for the bundled Phase 4c templates. Mirrors the
* exact checks `tinyflows::validate` (and therefore `openhuman.flows_validate`)
diff --git a/app/src/lib/i18n/__tests__/coverage.test.ts b/app/src/lib/i18n/__tests__/coverage.test.ts
index f3e2b934a0..fc9e256540 100644
--- a/app/src/lib/i18n/__tests__/coverage.test.ts
+++ b/app/src/lib/i18n/__tests__/coverage.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { REASONING_EFFORTS } from '../../../features/conversations/aui/ReasoningEffortPicker';
diff --git a/app/src/lib/mcp/__tests__/transport.test.ts b/app/src/lib/mcp/__tests__/transport.test.ts
index 2b87281431..c2a7c6ec83 100644
--- a/app/src/lib/mcp/__tests__/transport.test.ts
+++ b/app/src/lib/mcp/__tests__/transport.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import type { Socket } from 'socket.io-client';
import { beforeEach, describe, expect, test } from 'vitest';
diff --git a/app/src/lib/mcp/errorHandler.test.ts b/app/src/lib/mcp/errorHandler.test.ts
index 6ba85f4d37..24a6040cca 100644
--- a/app/src/lib/mcp/errorHandler.test.ts
+++ b/app/src/lib/mcp/errorHandler.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for MCP error handling utilities
*/
diff --git a/app/src/lib/mcp/transport.test.ts b/app/src/lib/mcp/transport.test.ts
index 0afa8a5062..601091233d 100644
--- a/app/src/lib/mcp/transport.test.ts
+++ b/app/src/lib/mcp/transport.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for SocketIOMCPTransportImpl
*
diff --git a/app/src/lib/mcp/validation.test.ts b/app/src/lib/mcp/validation.test.ts
index 3f60160c8d..047ebb98cd 100644
--- a/app/src/lib/mcp/validation.test.ts
+++ b/app/src/lib/mcp/validation.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for MCP validation utilities
*/
diff --git a/app/src/lib/notificationRouter.test.ts b/app/src/lib/notificationRouter.test.ts
index 3a758c915c..3e28f12c92 100644
--- a/app/src/lib/notificationRouter.test.ts
+++ b/app/src/lib/notificationRouter.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { NotificationItem } from '../store/notificationSlice';
diff --git a/app/src/lib/theme/chrome.test.ts b/app/src/lib/theme/chrome.test.ts
index 944dbc5173..69554ab27a 100644
--- a/app/src/lib/theme/chrome.test.ts
+++ b/app/src/lib/theme/chrome.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { deriveSurfaceChrome, withDerivedChrome } from './chrome';
diff --git a/app/src/lib/theme/color.test.ts b/app/src/lib/theme/color.test.ts
index 136fcce4b3..50e7d68f15 100644
--- a/app/src/lib/theme/color.test.ts
+++ b/app/src/lib/theme/color.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/lib/theme/presets.contrast.test.ts b/app/src/lib/theme/presets.contrast.test.ts
index 84f4c495c8..ad5459e62a 100644
--- a/app/src/lib/theme/presets.contrast.test.ts
+++ b/app/src/lib/theme/presets.contrast.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { readFileSync } from 'node:fs';
import { dirname, resolve as resolvePath } from 'node:path';
import { fileURLToPath } from 'node:url';
diff --git a/app/src/lib/tunnel/framing.test.ts b/app/src/lib/tunnel/framing.test.ts
index f3e1b98398..ead267f6e7 100644
--- a/app/src/lib/tunnel/framing.test.ts
+++ b/app/src/lib/tunnel/framing.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for tunnel/framing.ts
*/
diff --git a/app/src/lib/userErrors/__tests__/classify.test.ts b/app/src/lib/userErrors/__tests__/classify.test.ts
index 0f661f4fae..b9ac3921cc 100644
--- a/app/src/lib/userErrors/__tests__/classify.test.ts
+++ b/app/src/lib/userErrors/__tests__/classify.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { classifyUserActionableError, userErrorId } from '../classify';
diff --git a/app/src/lib/userErrors/__tests__/report.test.ts b/app/src/lib/userErrors/__tests__/report.test.ts
index 8d2c8983b2..3bd2bc1b1b 100644
--- a/app/src/lib/userErrors/__tests__/report.test.ts
+++ b/app/src/lib/userErrors/__tests__/report.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import type { AppDispatch } from '../../../store';
diff --git a/app/src/lib/workflows/workflowProposal.test.ts b/app/src/lib/workflows/workflowProposal.test.ts
index ba34946b1c..af795f6d3e 100644
--- a/app/src/lib/workflows/workflowProposal.test.ts
+++ b/app/src/lib/workflows/workflowProposal.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { ThreadMessage } from '../../types/thread';
diff --git a/app/src/providers/__tests__/assistantUiMessages.reasoningTiming.test.ts b/app/src/providers/__tests__/assistantUiMessages.reasoningTiming.test.ts
index 9dc3248a63..2aeddac705 100644
--- a/app/src/providers/__tests__/assistantUiMessages.reasoningTiming.test.ts
+++ b/app/src/providers/__tests__/assistantUiMessages.reasoningTiming.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { ThreadMessage } from '../../types/thread';
diff --git a/app/src/providers/__tests__/chatSurfaceHandlers.test.ts b/app/src/providers/__tests__/chatSurfaceHandlers.test.ts
index de315f2e75..f21c69e4f2 100644
--- a/app/src/providers/__tests__/chatSurfaceHandlers.test.ts
+++ b/app/src/providers/__tests__/chatSurfaceHandlers.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, describe, expect, it, vi } from 'vitest';
import { __resetChatSurfaces, getChatSurface, registerChatSurface } from '../chatSurfaceHandlers';
diff --git a/app/src/providers/__tests__/speechAdapter.test.ts b/app/src/providers/__tests__/speechAdapter.test.ts
index 68bdd37f1f..c6ce7ba526 100644
--- a/app/src/providers/__tests__/speechAdapter.test.ts
+++ b/app/src/providers/__tests__/speechAdapter.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* The read-aloud bridge.
*
diff --git a/app/src/services/__tests__/chatService.queue.test.ts b/app/src/services/__tests__/chatService.queue.test.ts
index c5480b6464..b730696870 100644
--- a/app/src/services/__tests__/chatService.queue.test.ts
+++ b/app/src/services/__tests__/chatService.queue.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { chatRemoveQueueItem, subscribeQueueEvents } from '../chatService';
diff --git a/app/src/services/__tests__/chatService.subagentDelta.test.ts b/app/src/services/__tests__/chatService.subagentDelta.test.ts
index cdd218765c..a5add3655b 100644
--- a/app/src/services/__tests__/chatService.subagentDelta.test.ts
+++ b/app/src/services/__tests__/chatService.subagentDelta.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import {
diff --git a/app/src/services/__tests__/chatService.suggestions.test.ts b/app/src/services/__tests__/chatService.suggestions.test.ts
index 0dba4446f1..10274d1182 100644
--- a/app/src/services/__tests__/chatService.suggestions.test.ts
+++ b/app/src/services/__tests__/chatService.suggestions.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { subscribeSuggestionEvents } from '../chatService';
diff --git a/app/src/services/__tests__/coreHealthMonitor.test.ts b/app/src/services/__tests__/coreHealthMonitor.test.ts
index 82799e9a8c..a68bd98aa1 100644
--- a/app/src/services/__tests__/coreHealthMonitor.test.ts
+++ b/app/src/services/__tests__/coreHealthMonitor.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Tests for coreHealthMonitor — covers changed lines 17-19, 21-23, 25-29,
* 31-34, 37, 41-42, 47-50, 53-57, 60-64.
diff --git a/app/src/services/__tests__/coreProcessControl.test.ts b/app/src/services/__tests__/coreProcessControl.test.ts
index 2fab97fff0..986598a389 100644
--- a/app/src/services/__tests__/coreProcessControl.test.ts
+++ b/app/src/services/__tests__/coreProcessControl.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Tests for coreProcessControl — covers changed lines 13-15, 17, 22.
*/
diff --git a/app/src/services/__tests__/coreRpcClient.probeRealtime.test.ts b/app/src/services/__tests__/coreRpcClient.probeRealtime.test.ts
index 03d265bbf0..11fa3a10b1 100644
--- a/app/src/services/__tests__/coreRpcClient.probeRealtime.test.ts
+++ b/app/src/services/__tests__/coreRpcClient.probeRealtime.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, describe, expect, test, vi } from 'vitest';
import { probeCoreRealtime } from '../coreRpcClient';
diff --git a/app/src/services/__tests__/coreRpcClient.selfHostedRelay.test.ts b/app/src/services/__tests__/coreRpcClient.selfHostedRelay.test.ts
index 643453f1fd..49d6bea6a8 100644
--- a/app/src/services/__tests__/coreRpcClient.selfHostedRelay.test.ts
+++ b/app/src/services/__tests__/coreRpcClient.selfHostedRelay.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Regression tests for #3865 — connecting to a self-hosted runtime on a LAN IP
* from the macOS desktop app.
diff --git a/app/src/services/__tests__/coreSocket.test.ts b/app/src/services/__tests__/coreSocket.test.ts
index a30d0d499b..fdf2e8886b 100644
--- a/app/src/services/__tests__/coreSocket.test.ts
+++ b/app/src/services/__tests__/coreSocket.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { connectCoreSocket, createCoreSocket } from '../coreSocket';
diff --git a/app/src/services/__tests__/gatewayService.test.ts b/app/src/services/__tests__/gatewayService.test.ts
index 16a5b11cc7..af0d66b539 100644
--- a/app/src/services/__tests__/gatewayService.test.ts
+++ b/app/src/services/__tests__/gatewayService.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Tests for the gateway service.
*
diff --git a/app/src/services/__tests__/keyringApi.test.ts b/app/src/services/__tests__/keyringApi.test.ts
index 015533ce31..04bb2094d4 100644
--- a/app/src/services/__tests__/keyringApi.test.ts
+++ b/app/src/services/__tests__/keyringApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, describe, expect, it, vi } from 'vitest';
import { decideKeyringConsent, fetchKeyringStatus, retryKeyringProbe } from '../keyringApi';
diff --git a/app/src/services/__tests__/rpcMethods.test.ts b/app/src/services/__tests__/rpcMethods.test.ts
index ffa647f907..70701baf7c 100644
--- a/app/src/services/__tests__/rpcMethods.test.ts
+++ b/app/src/services/__tests__/rpcMethods.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import * as fs from 'node:fs';
import * as path from 'node:path';
import { describe, expect, test } from 'vitest';
diff --git a/app/src/services/__tests__/socketService.events.test.ts b/app/src/services/__tests__/socketService.events.test.ts
index 64b1592077..f20ef7cc66 100644
--- a/app/src/services/__tests__/socketService.events.test.ts
+++ b/app/src/services/__tests__/socketService.events.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Tests for socketService socket-event handler dispatches.
* Covers lines 212, 230, 237, 240.
diff --git a/app/src/services/__tests__/socketService.subscribeThread.test.ts b/app/src/services/__tests__/socketService.subscribeThread.test.ts
index 44d19a46cf..c85173f7c6 100644
--- a/app/src/services/__tests__/socketService.subscribeThread.test.ts
+++ b/app/src/services/__tests__/socketService.subscribeThread.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, describe, expect, it, vi } from 'vitest';
import { socketService } from '../socketService';
diff --git a/app/src/services/__tests__/socketService.test.ts b/app/src/services/__tests__/socketService.test.ts
index b5e15f702f..bc53c06df6 100644
--- a/app/src/services/__tests__/socketService.test.ts
+++ b/app/src/services/__tests__/socketService.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for socketService internals — specifically the
* resolveCoreSocketBaseUrl() behaviour that was fixed to consult
diff --git a/app/src/services/announcementService.test.ts b/app/src/services/announcementService.test.ts
index 5027483844..dfecb27d1f 100644
--- a/app/src/services/announcementService.test.ts
+++ b/app/src/services/announcementService.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import { fetchLatestAnnouncement, parseAnnouncement } from './announcementService';
diff --git a/app/src/services/api/__tests__/artifactRows.test.ts b/app/src/services/api/__tests__/artifactRows.test.ts
index ca8f1539de..2df6f44923 100644
--- a/app/src/services/api/__tests__/artifactRows.test.ts
+++ b/app/src/services/api/__tests__/artifactRows.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { ThreadMessage } from '../../../types/thread';
diff --git a/app/src/services/api/__tests__/billingApi.test.ts b/app/src/services/api/__tests__/billingApi.test.ts
index 787677cd21..575a819a51 100644
--- a/app/src/services/api/__tests__/billingApi.test.ts
+++ b/app/src/services/api/__tests__/billingApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockCallCoreCommand = vi.fn();
diff --git a/app/src/services/api/__tests__/channelConnectionsApi.test.ts b/app/src/services/api/__tests__/channelConnectionsApi.test.ts
index 37b6104876..057540d4e4 100644
--- a/app/src/services/api/__tests__/channelConnectionsApi.test.ts
+++ b/app/src/services/api/__tests__/channelConnectionsApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockCallCoreRpc = vi.fn();
diff --git a/app/src/services/api/__tests__/openrouterFreeModels.test.ts b/app/src/services/api/__tests__/openrouterFreeModels.test.ts
index f81eacdbe8..63cdb9a28b 100644
--- a/app/src/services/api/__tests__/openrouterFreeModels.test.ts
+++ b/app/src/services/api/__tests__/openrouterFreeModels.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { applyOpenRouterFreeModels, OPENROUTER_FREE_MODEL } from '../openrouterFreeModels';
diff --git a/app/src/services/api/__tests__/userApi.test.ts b/app/src/services/api/__tests__/userApi.test.ts
index 51981a06dd..45d3cd7bc0 100644
--- a/app/src/services/api/__tests__/userApi.test.ts
+++ b/app/src/services/api/__tests__/userApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockFetchCurrentUser = vi.fn();
diff --git a/app/src/services/api/__tests__/voiceSettingsApi.test.ts b/app/src/services/api/__tests__/voiceSettingsApi.test.ts
index b83ac51bda..3332d9d82c 100644
--- a/app/src/services/api/__tests__/voiceSettingsApi.test.ts
+++ b/app/src/services/api/__tests__/voiceSettingsApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { testVoiceProvider } from '../voiceSettingsApi';
diff --git a/app/src/services/api/agentContextApi.test.ts b/app/src/services/api/agentContextApi.test.ts
index 52cf9a2612..66e66134a0 100644
--- a/app/src/services/api/agentContextApi.test.ts
+++ b/app/src/services/api/agentContextApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../coreRpcClient';
diff --git a/app/src/services/api/agentRegistryApi.test.ts b/app/src/services/api/agentRegistryApi.test.ts
index 774ae74d92..e3206108dc 100644
--- a/app/src/services/api/agentRegistryApi.test.ts
+++ b/app/src/services/api/agentRegistryApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../coreRpcClient';
diff --git a/app/src/services/api/approvalApi.test.ts b/app/src/services/api/approvalApi.test.ts
index ad960d7319..abf906295e 100644
--- a/app/src/services/api/approvalApi.test.ts
+++ b/app/src/services/api/approvalApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import {
diff --git a/app/src/services/api/channelConnectionsApi.test.ts b/app/src/services/api/channelConnectionsApi.test.ts
index 078bc78fc6..388b2874d4 100644
--- a/app/src/services/api/channelConnectionsApi.test.ts
+++ b/app/src/services/api/channelConnectionsApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { channelConnectionsApi } from './channelConnectionsApi';
diff --git a/app/src/services/api/embeddingsApi.test.ts b/app/src/services/api/embeddingsApi.test.ts
index fad4ac845a..90d481f3e5 100644
--- a/app/src/services/api/embeddingsApi.test.ts
+++ b/app/src/services/api/embeddingsApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../coreRpcClient';
diff --git a/app/src/services/api/feedbackApi.test.ts b/app/src/services/api/feedbackApi.test.ts
index 834954168f..4fef42f994 100644
--- a/app/src/services/api/feedbackApi.test.ts
+++ b/app/src/services/api/feedbackApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockGet = vi.fn();
diff --git a/app/src/services/api/flowsApi.test.ts b/app/src/services/api/flowsApi.test.ts
index 7a96f184d8..68ea722339 100644
--- a/app/src/services/api/flowsApi.test.ts
+++ b/app/src/services/api/flowsApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { coerceWorkflowProposal } from '../../lib/workflows/workflowProposal';
diff --git a/app/src/services/api/liveVoiceApi.test.ts b/app/src/services/api/liveVoiceApi.test.ts
index 1c25464409..bd573bcdb9 100644
--- a/app/src/services/api/liveVoiceApi.test.ts
+++ b/app/src/services/api/liveVoiceApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import {
diff --git a/app/src/services/api/memoryApi.test.ts b/app/src/services/api/memoryApi.test.ts
index 2afced673e..ce94344248 100644
--- a/app/src/services/api/memoryApi.test.ts
+++ b/app/src/services/api/memoryApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../coreRpcClient';
diff --git a/app/src/services/api/personaFilesApi.test.ts b/app/src/services/api/personaFilesApi.test.ts
index 005caf158a..dbcf8c30ec 100644
--- a/app/src/services/api/personaFilesApi.test.ts
+++ b/app/src/services/api/personaFilesApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import {
diff --git a/app/src/services/api/skillRegistryApi.test.ts b/app/src/services/api/skillRegistryApi.test.ts
index d3a94c57b8..968ff72179 100644
--- a/app/src/services/api/skillRegistryApi.test.ts
+++ b/app/src/services/api/skillRegistryApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { isInstallable, parseRegistryError, skillRegistryApi } from './skillRegistryApi';
diff --git a/app/src/services/api/skillsApi.test.ts b/app/src/services/api/skillsApi.test.ts
index 40a22560c6..c6ab8736a5 100644
--- a/app/src/services/api/skillsApi.test.ts
+++ b/app/src/services/api/skillsApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { skillsApi } from './skillsApi';
diff --git a/app/src/services/api/subagentApi.test.ts b/app/src/services/api/subagentApi.test.ts
index 5b3484107c..84ebd0a52f 100644
--- a/app/src/services/api/subagentApi.test.ts
+++ b/app/src/services/api/subagentApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../coreRpcClient';
diff --git a/app/src/services/api/threadApi.test.ts b/app/src/services/api/threadApi.test.ts
index 4888d9c3e7..7a73ab1b3d 100644
--- a/app/src/services/api/threadApi.test.ts
+++ b/app/src/services/api/threadApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockCallCoreRpc = vi.fn();
diff --git a/app/src/services/api/voiceSettingsApi.test.ts b/app/src/services/api/voiceSettingsApi.test.ts
index d61fb9051d..dfb342e76f 100644
--- a/app/src/services/api/voiceSettingsApi.test.ts
+++ b/app/src/services/api/voiceSettingsApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/services/api/waitlistApi.test.ts b/app/src/services/api/waitlistApi.test.ts
index 9e740cbabb..b6bbf24230 100644
--- a/app/src/services/api/waitlistApi.test.ts
+++ b/app/src/services/api/waitlistApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockPost = vi.fn();
diff --git a/app/src/services/api/worktreeApi.test.ts b/app/src/services/api/worktreeApi.test.ts
index 83915a8e0b..154ee8cce1 100644
--- a/app/src/services/api/worktreeApi.test.ts
+++ b/app/src/services/api/worktreeApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../coreRpcClient';
diff --git a/app/src/services/apiError.test.ts b/app/src/services/apiError.test.ts
index d2b2102fa7..7b0674b799 100644
--- a/app/src/services/apiError.test.ts
+++ b/app/src/services/apiError.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { messageForApiError } from './apiError';
diff --git a/app/src/services/bootCheckService.test.ts b/app/src/services/bootCheckService.test.ts
index 5cfc601276..d412d68a7b 100644
--- a/app/src/services/bootCheckService.test.ts
+++ b/app/src/services/bootCheckService.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for the boot-check service-backed transport.
*
diff --git a/app/src/services/chatDeltaCoalescer.test.ts b/app/src/services/chatDeltaCoalescer.test.ts
index 37dd138125..b3100267e8 100644
--- a/app/src/services/chatDeltaCoalescer.test.ts
+++ b/app/src/services/chatDeltaCoalescer.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import {
diff --git a/app/src/services/coreCommandClient.test.ts b/app/src/services/coreCommandClient.test.ts
index 5b32f96212..00286a6d05 100644
--- a/app/src/services/coreCommandClient.test.ts
+++ b/app/src/services/coreCommandClient.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockCallCoreRpc = vi.fn();
diff --git a/app/src/services/coreStateApi.test.ts b/app/src/services/coreStateApi.test.ts
index 01bea4d6ae..3efc2c793c 100644
--- a/app/src/services/coreStateApi.test.ts
+++ b/app/src/services/coreStateApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockCallCoreRpc = vi.fn();
diff --git a/app/src/services/transport/CloudHttpTransport.test.ts b/app/src/services/transport/CloudHttpTransport.test.ts
index f951c3de37..e888678131 100644
--- a/app/src/services/transport/CloudHttpTransport.test.ts
+++ b/app/src/services/transport/CloudHttpTransport.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, describe, expect, it, vi } from 'vitest';
import { CloudHttpTransport } from './CloudHttpTransport';
diff --git a/app/src/services/transport/LanHttpTransport.test.ts b/app/src/services/transport/LanHttpTransport.test.ts
index 1963bdc3a9..7b1adee2c3 100644
--- a/app/src/services/transport/LanHttpTransport.test.ts
+++ b/app/src/services/transport/LanHttpTransport.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, describe, expect, it, vi } from 'vitest';
import { LanHttpTransport } from './LanHttpTransport';
diff --git a/app/src/services/transport/LocalTransport.test.ts b/app/src/services/transport/LocalTransport.test.ts
index 4aa95cbb3b..2287cc2fa8 100644
--- a/app/src/services/transport/LocalTransport.test.ts
+++ b/app/src/services/transport/LocalTransport.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, describe, expect, it, vi } from 'vitest';
import { LocalTransport } from './LocalTransport';
diff --git a/app/src/services/transport/TransportManager.race.test.ts b/app/src/services/transport/TransportManager.race.test.ts
index deceee8778..1c8eb1fe7e 100644
--- a/app/src/services/transport/TransportManager.race.test.ts
+++ b/app/src/services/transport/TransportManager.race.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* LAN-vs-Tunnel race semantics for TransportManager.raceLanAndTunnel (plan.md
* §4 P1). The sibling TransportManager.test.ts covers profile *selection* but
diff --git a/app/src/services/transport/TransportManager.test.ts b/app/src/services/transport/TransportManager.test.ts
index dc7c9f88ab..0828a897db 100644
--- a/app/src/services/transport/TransportManager.test.ts
+++ b/app/src/services/transport/TransportManager.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for TransportManager race semantics.
*/
diff --git a/app/src/services/transport/TunnelTransport.test.ts b/app/src/services/transport/TunnelTransport.test.ts
index 3479f11fe0..cf6597f252 100644
--- a/app/src/services/transport/TunnelTransport.test.ts
+++ b/app/src/services/transport/TunnelTransport.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Unit tests for TunnelTransport.
*
diff --git a/app/src/services/transport/logRedaction.test.ts b/app/src/services/transport/logRedaction.test.ts
index f7eccac075..500efa8ece 100644
--- a/app/src/services/transport/logRedaction.test.ts
+++ b/app/src/services/transport/logRedaction.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import debug from 'debug';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/services/walletApi.test.ts b/app/src/services/walletApi.test.ts
index cfc1183dd5..0018d12a83 100644
--- a/app/src/services/walletApi.test.ts
+++ b/app/src/services/walletApi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
const mockCallCoreRpc = vi.fn();
diff --git a/app/src/store/__tests__/accountsSlice.core.test.ts b/app/src/store/__tests__/accountsSlice.core.test.ts
index 9f0f1813b7..53ccf87b5b 100644
--- a/app/src/store/__tests__/accountsSlice.core.test.ts
+++ b/app/src/store/__tests__/accountsSlice.core.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { Account, AccountLogEntry, IngestedMessage } from '../../types/accounts';
diff --git a/app/src/store/__tests__/artifactsPersistFilter.test.ts b/app/src/store/__tests__/artifactsPersistFilter.test.ts
index 03b03f4ab9..6c19c96ca0 100644
--- a/app/src/store/__tests__/artifactsPersistFilter.test.ts
+++ b/app/src/store/__tests__/artifactsPersistFilter.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Coverage for the persist filter that gates `chatRuntime.artifactsByThread`
* on its way to storage (#3024). Confirms the slice's contract:
diff --git a/app/src/store/__tests__/channelConnectionsSlice.test.ts b/app/src/store/__tests__/channelConnectionsSlice.test.ts
index 456d6ed7fe..1c545d4956 100644
--- a/app/src/store/__tests__/channelConnectionsSlice.test.ts
+++ b/app/src/store/__tests__/channelConnectionsSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import reducer, {
diff --git a/app/src/store/__tests__/chatRuntimeSlice.artifactTabs.test.ts b/app/src/store/__tests__/chatRuntimeSlice.artifactTabs.test.ts
index 68b17a220a..4b846d0335 100644
--- a/app/src/store/__tests__/chatRuntimeSlice.artifactTabs.test.ts
+++ b/app/src/store/__tests__/chatRuntimeSlice.artifactTabs.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import reducer, {
diff --git a/app/src/store/__tests__/chatRuntimeSlice.queue.test.ts b/app/src/store/__tests__/chatRuntimeSlice.queue.test.ts
index 9f1f7e8587..4899589598 100644
--- a/app/src/store/__tests__/chatRuntimeSlice.queue.test.ts
+++ b/app/src/store/__tests__/chatRuntimeSlice.queue.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import reducer, {
diff --git a/app/src/store/__tests__/chatRuntimeSlice.subagentStream.test.ts b/app/src/store/__tests__/chatRuntimeSlice.subagentStream.test.ts
index d65b1e1eb5..f3fe2dc436 100644
--- a/app/src/store/__tests__/chatRuntimeSlice.subagentStream.test.ts
+++ b/app/src/store/__tests__/chatRuntimeSlice.subagentStream.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { PersistedTurnState } from '../../types/turnState';
diff --git a/app/src/store/__tests__/chatRuntimeSlice.thunk.test.ts b/app/src/store/__tests__/chatRuntimeSlice.thunk.test.ts
index ab19a25251..3d36b6eb69 100644
--- a/app/src/store/__tests__/chatRuntimeSlice.thunk.test.ts
+++ b/app/src/store/__tests__/chatRuntimeSlice.thunk.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { configureStore } from '@reduxjs/toolkit';
import { describe, expect, it, vi } from 'vitest';
diff --git a/app/src/store/__tests__/connectivitySelectors.test.ts b/app/src/store/__tests__/connectivitySelectors.test.ts
index 617da4a071..d28fcb3a4b 100644
--- a/app/src/store/__tests__/connectivitySelectors.test.ts
+++ b/app/src/store/__tests__/connectivitySelectors.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { isHostedDegraded, selectBlockingState } from '../connectivitySelectors';
diff --git a/app/src/store/__tests__/notificationSlice.test.ts b/app/src/store/__tests__/notificationSlice.test.ts
index af811d2700..8b76fee8ee 100644
--- a/app/src/store/__tests__/notificationSlice.test.ts
+++ b/app/src/store/__tests__/notificationSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { REHYDRATE } from 'redux-persist';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/store/__tests__/notificationsSlice.dismissActions.test.ts b/app/src/store/__tests__/notificationsSlice.dismissActions.test.ts
index 8820c0e8ec..175c0f270e 100644
--- a/app/src/store/__tests__/notificationsSlice.dismissActions.test.ts
+++ b/app/src/store/__tests__/notificationsSlice.dismissActions.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { IntegrationNotification } from '../../types/notifications';
diff --git a/app/src/store/__tests__/notificationsSlice.test.ts b/app/src/store/__tests__/notificationsSlice.test.ts
index 21886ba8f6..31f584e42a 100644
--- a/app/src/store/__tests__/notificationsSlice.test.ts
+++ b/app/src/store/__tests__/notificationsSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { IntegrationNotification } from '../../types/notifications';
diff --git a/app/src/store/__tests__/settingsSlice.test.ts b/app/src/store/__tests__/settingsSlice.test.ts
index df6e1be355..6519f36c1f 100644
--- a/app/src/store/__tests__/settingsSlice.test.ts
+++ b/app/src/store/__tests__/settingsSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import reducer, {
diff --git a/app/src/store/__tests__/socketSlice.test.ts b/app/src/store/__tests__/socketSlice.test.ts
index 562333a9a5..48b7c72f59 100644
--- a/app/src/store/__tests__/socketSlice.test.ts
+++ b/app/src/store/__tests__/socketSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { configureStore } from '@reduxjs/toolkit';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/store/__tests__/threadSlice.createThread.test.ts b/app/src/store/__tests__/threadSlice.createThread.test.ts
index 2673f4b640..c90f4b8db4 100644
--- a/app/src/store/__tests__/threadSlice.createThread.test.ts
+++ b/app/src/store/__tests__/threadSlice.createThread.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* #5156 — a `threads_create_new` that blows the 30 s RPC budget must land as a
* recorded, displayable failure, never as an unhandled rejection.
diff --git a/app/src/store/__tests__/userErrorsSlice.test.ts b/app/src/store/__tests__/userErrorsSlice.test.ts
index 0eff87eac2..b331420033 100644
--- a/app/src/store/__tests__/userErrorsSlice.test.ts
+++ b/app/src/store/__tests__/userErrorsSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { configureStore } from '@reduxjs/toolkit';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/store/chatRuntimeSlice.reasoningTiming.test.ts b/app/src/store/chatRuntimeSlice.reasoningTiming.test.ts
index 58ec3610e8..72f0c6a16a 100644
--- a/app/src/store/chatRuntimeSlice.reasoningTiming.test.ts
+++ b/app/src/store/chatRuntimeSlice.reasoningTiming.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { configureStore } from '@reduxjs/toolkit';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/store/chatRuntimeSlice.toolFailure.test.ts b/app/src/store/chatRuntimeSlice.toolFailure.test.ts
index 9ff93f66d1..41640ce8cb 100644
--- a/app/src/store/chatRuntimeSlice.toolFailure.test.ts
+++ b/app/src/store/chatRuntimeSlice.toolFailure.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { parseToolFailure } from './chatRuntimeSlice';
diff --git a/app/src/store/followupSuggestionsSlice.test.ts b/app/src/store/followupSuggestionsSlice.test.ts
index bc1876557c..9c8e8ad068 100644
--- a/app/src/store/followupSuggestionsSlice.test.ts
+++ b/app/src/store/followupSuggestionsSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/store/githubStarSlice.test.ts b/app/src/store/githubStarSlice.test.ts
index 43fa7d2669..5cd4563a62 100644
--- a/app/src/store/githubStarSlice.test.ts
+++ b/app/src/store/githubStarSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import reducer, { dismissGithubStarCta, type GithubStarState } from './githubStarSlice';
diff --git a/app/src/store/layoutSlice.test.ts b/app/src/store/layoutSlice.test.ts
index 231db7d244..83441cd829 100644
--- a/app/src/store/layoutSlice.test.ts
+++ b/app/src/store/layoutSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import layoutReducer, {
diff --git a/app/src/store/mascotSlice.liveVoice.test.ts b/app/src/store/mascotSlice.liveVoice.test.ts
index 9116e36378..58206fba35 100644
--- a/app/src/store/mascotSlice.liveVoice.test.ts
+++ b/app/src/store/mascotSlice.liveVoice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { REHYDRATE } from 'redux-persist';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/store/mascotSlice.voiceMode.test.ts b/app/src/store/mascotSlice.voiceMode.test.ts
index f072910bfb..83f784dd0c 100644
--- a/app/src/store/mascotSlice.voiceMode.test.ts
+++ b/app/src/store/mascotSlice.voiceMode.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { REHYDRATE } from 'redux-persist';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/store/personaSlice.test.ts b/app/src/store/personaSlice.test.ts
index 7629aa4734..7db295afea 100644
--- a/app/src/store/personaSlice.test.ts
+++ b/app/src/store/personaSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { REHYDRATE } from 'redux-persist';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/store/queueSlice.test.ts b/app/src/store/queueSlice.test.ts
index 6356d45392..0e4ea61735 100644
--- a/app/src/store/queueSlice.test.ts
+++ b/app/src/store/queueSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { ThreadMessage } from '../types/thread';
diff --git a/app/src/store/runModeSlice.test.ts b/app/src/store/runModeSlice.test.ts
index f4baf0b0e1..291bec1c47 100644
--- a/app/src/store/runModeSlice.test.ts
+++ b/app/src/store/runModeSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import reducer, { type RunModeState, setRunMode } from './runModeSlice';
diff --git a/app/src/store/themeSlice.test.ts b/app/src/store/themeSlice.test.ts
index ab0fc5ef9f..df6b4c0532 100644
--- a/app/src/store/themeSlice.test.ts
+++ b/app/src/store/themeSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { REHYDRATE } from 'redux-persist';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/store/threadGoalSlice.test.ts b/app/src/store/threadGoalSlice.test.ts
index a60ada8157..e13057d77e 100644
--- a/app/src/store/threadGoalSlice.test.ts
+++ b/app/src/store/threadGoalSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import reducer, { clearThreadGoal, setThreadGoal, type ThreadGoalState } from './threadGoalSlice';
diff --git a/app/src/store/threadTodosSlice.test.ts b/app/src/store/threadTodosSlice.test.ts
index e526773934..e1a0c21df4 100644
--- a/app/src/store/threadTodosSlice.test.ts
+++ b/app/src/store/threadTodosSlice.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import reducer, {
diff --git a/app/src/test/eslintCentralizedConfigRule.test.ts b/app/src/test/eslintCentralizedConfigRule.test.ts
index cf14b02719..b93dc1ba87 100644
--- a/app/src/test/eslintCentralizedConfigRule.test.ts
+++ b/app/src/test/eslintCentralizedConfigRule.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import tsparser from '@typescript-eslint/parser';
import { Linter } from 'eslint';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/test/mockApiCore.headersRedaction.test.ts b/app/src/test/mockApiCore.headersRedaction.test.ts
index 72dfd18ec2..d16ed9cf8b 100644
--- a/app/src/test/mockApiCore.headersRedaction.test.ts
+++ b/app/src/test/mockApiCore.headersRedaction.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { expect, it } from 'vitest';
// @ts-ignore - test-only JS module outside app/src
diff --git a/app/src/test/mockApiCore.portSelection.test.ts b/app/src/test/mockApiCore.portSelection.test.ts
index 95a79e8b68..1de09512c6 100644
--- a/app/src/test/mockApiCore.portSelection.test.ts
+++ b/app/src/test/mockApiCore.portSelection.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import net from 'node:net';
import { afterEach, expect, it } from 'vitest';
diff --git a/app/src/test/setup.ts b/app/src/test/setup.ts
index c9e156f3e6..96f347d920 100644
--- a/app/src/test/setup.ts
+++ b/app/src/test/setup.ts
@@ -117,7 +117,7 @@ alignGlobalEventWithDom();
// Polyfill window.matchMedia — used by Rive (@rive-app/react-webgl2) and
// some media-query hooks; not implemented in jsdom.
-if (typeof window !== 'undefined' && typeof window.matchMedia === 'undefined') {
+if (typeof window.matchMedia === 'undefined') {
Object.defineProperty(window, 'matchMedia', {
writable: true,
value: vi.fn((query: string) => ({
@@ -190,7 +190,7 @@ if (typeof globalThis.IntersectionObserver === 'undefined') {
// Polyfill PointerEvent for @testing-library/user-event's pointer sequences
// against Radix triggers. jsdom 28 still ships no PointerEvent constructor, so
// user-event falls back to MouseEvent and Radix's pointer handlers never fire.
-if (typeof globalThis.PointerEvent === 'undefined' && typeof MouseEvent !== 'undefined') {
+if (typeof globalThis.PointerEvent === 'undefined') {
globalThis.PointerEvent = class PointerEvent extends MouseEvent {
readonly pointerId: number;
readonly pointerType: string;
@@ -212,11 +212,9 @@ if (typeof globalThis.PointerEvent === 'undefined' && typeof MouseEvent !== 'und
// regress to the non-Tauri path. Seed a no-op handle once globally so the
// IPC-readiness check passes by default. Tests that *want* the CEF gap
// behaviour can `delete window.__TAURI_INTERNALS__` in a `beforeEach`.
-if (typeof window !== 'undefined') {
- (
- window as unknown as { __TAURI_INTERNALS__: { invoke: () => Promise<unknown> } }
- ).__TAURI_INTERNALS__ = { invoke: vi.fn(() => Promise.resolve()) };
-}
+(
+ window as unknown as { __TAURI_INTERNALS__: { invoke: () => Promise<unknown> } }
+).__TAURI_INTERNALS__ = { invoke: vi.fn(() => Promise.resolve()) };
// Mock Tauri APIs (not available in test env)
vi.mock('@tauri-apps/api/core', () => ({ invoke: vi.fn(), isTauri: vi.fn(() => false) }));
@@ -412,18 +410,16 @@ afterEach(async () => {
// Fake-timer suites own their clock. Awaiting a synthetic timer there would
// wait until Vitest's per-test timeout, rather than draining anything.
if (!vi.isFakeTimers()) {
- await new Promise<void>(resolve => setTimeout(resolve, 0));
+ await new Promise<void>(resolve => window.setTimeout(resolve, 0));
}
alignGlobalEventWithDom();
// Re-seed the IPC handle after any test that may have deleted it
// (e.g. tests exercising the CEF-gap branch of `isTauri()`). Without
// this, sibling tests in the same jsdom worker would silently regress
// to the non-Tauri path. Per graycyrus review on PR #1556.
- if (typeof window !== 'undefined') {
- (
- window as unknown as { __TAURI_INTERNALS__: { invoke: () => Promise<unknown> } }
- ).__TAURI_INTERNALS__ = { invoke: vi.fn(() => Promise.resolve()) };
- }
+ (
+ window as unknown as { __TAURI_INTERNALS__: { invoke: () => Promise<unknown> } }
+ ).__TAURI_INTERNALS__ = { invoke: vi.fn(() => Promise.resolve()) };
});
afterAll(async () => {
await stopMockServer();
diff --git a/app/src/utils/__tests__/latex.test.ts b/app/src/utils/__tests__/latex.test.ts
index 24ab002b44..c4f3897b28 100644
--- a/app/src/utils/__tests__/latex.test.ts
+++ b/app/src/utils/__tests__/latex.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { hasLatexContent, normalizeLatexDelimiters } from '../latex';
diff --git a/app/src/utils/__tests__/openrouterOAuth.test.ts b/app/src/utils/__tests__/openrouterOAuth.test.ts
index 2b20db2707..d4c6896ead 100644
--- a/app/src/utils/__tests__/openrouterOAuth.test.ts
+++ b/app/src/utils/__tests__/openrouterOAuth.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import { connectOpenRouterViaOAuth } from '../openrouterOAuth';
diff --git a/app/src/utils/__tests__/sanitize.test.ts b/app/src/utils/__tests__/sanitize.test.ts
index 6143c8f1c6..60940d07d0 100644
--- a/app/src/utils/__tests__/sanitize.test.ts
+++ b/app/src/utils/__tests__/sanitize.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { createSafeLogData, sanitizeError, sanitizeForLogging } from '../sanitize';
diff --git a/app/src/utils/__tests__/tauriCoreBridge.e2e.test.ts b/app/src/utils/__tests__/tauriCoreBridge.e2e.test.ts
index e1437b03be..7d37509266 100644
--- a/app/src/utils/__tests__/tauriCoreBridge.e2e.test.ts
+++ b/app/src/utils/__tests__/tauriCoreBridge.e2e.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { isTauri } from '@tauri-apps/api/core';
import { beforeEach, describe, expect, type Mock, test, vi } from 'vitest';
diff --git a/app/src/utils/__tests__/toolTimelineFormatting.test.ts b/app/src/utils/__tests__/toolTimelineFormatting.test.ts
index f8c047c8f0..017e87a337 100644
--- a/app/src/utils/__tests__/toolTimelineFormatting.test.ts
+++ b/app/src/utils/__tests__/toolTimelineFormatting.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import type { ToolTimelineEntry } from '../../store/chatRuntimeSlice';
diff --git a/app/src/utils/cryptoKeys.test.ts b/app/src/utils/cryptoKeys.test.ts
index b3828cd1a8..40b9429969 100644
--- a/app/src/utils/cryptoKeys.test.ts
+++ b/app/src/utils/cryptoKeys.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { deriveAesKeyFromSeed } from './cryptoKeys';
diff --git a/app/src/utils/format.test.ts b/app/src/utils/format.test.ts
index 1d6c3174a0..013c3d2158 100644
--- a/app/src/utils/format.test.ts
+++ b/app/src/utils/format.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { formatBytes } from './format';
diff --git a/app/src/utils/hashRouterBootstrap.test.ts b/app/src/utils/hashRouterBootstrap.test.ts
index 6f62384345..25e45cf8cd 100644
--- a/app/src/utils/hashRouterBootstrap.test.ts
+++ b/app/src/utils/hashRouterBootstrap.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { missingHashRedirectTarget } from './hashRouterBootstrap';
diff --git a/app/src/utils/ollamaUrlValidation.test.ts b/app/src/utils/ollamaUrlValidation.test.ts
index ae8a0931fb..2f799bc968 100644
--- a/app/src/utils/ollamaUrlValidation.test.ts
+++ b/app/src/utils/ollamaUrlValidation.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { validateOllamaUrl } from './ollamaUrlValidation';
diff --git a/app/src/utils/relativeTime.test.ts b/app/src/utils/relativeTime.test.ts
index 8517136334..920ce8572a 100644
--- a/app/src/utils/relativeTime.test.ts
+++ b/app/src/utils/relativeTime.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { fullTimestamp, relativeTime } from './relativeTime';
diff --git a/app/src/utils/semver.test.ts b/app/src/utils/semver.test.ts
index a91aa89767..8282103a3b 100644
--- a/app/src/utils/semver.test.ts
+++ b/app/src/utils/semver.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { compareSemver, isVersionAtLeast, parseSemverParts } from './semver';
diff --git a/app/src/utils/supportUrl.test.ts b/app/src/utils/supportUrl.test.ts
index ae5abae4e7..368a090d0a 100644
--- a/app/src/utils/supportUrl.test.ts
+++ b/app/src/utils/supportUrl.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, test, vi } from 'vitest';
import { DISCORD_INVITE_URL } from './links';
diff --git a/app/src/utils/tauriCommands/__tests__/config.test.ts b/app/src/utils/tauriCommands/__tests__/config.test.ts
index f54ac45380..280c15d727 100644
--- a/app/src/utils/tauriCommands/__tests__/config.test.ts
+++ b/app/src/utils/tauriCommands/__tests__/config.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../../../services/coreRpcClient';
diff --git a/app/src/utils/tauriCommands/__tests__/migrateHermes.test.ts b/app/src/utils/tauriCommands/__tests__/migrateHermes.test.ts
index c7f70c4b77..57aae363c1 100644
--- a/app/src/utils/tauriCommands/__tests__/migrateHermes.test.ts
+++ b/app/src/utils/tauriCommands/__tests__/migrateHermes.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it, vi } from 'vitest';
import { callCoreRpc } from '../../../services/coreRpcClient';
diff --git a/app/src/utils/tauriCommands/config.test.ts b/app/src/utils/tauriCommands/config.test.ts
index e65ff2396d..3f87ae75e0 100644
--- a/app/src/utils/tauriCommands/config.test.ts
+++ b/app/src/utils/tauriCommands/config.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { isTauri } from '@tauri-apps/api/core';
import { afterEach, beforeEach, describe, expect, type Mock, test, vi } from 'vitest';
diff --git a/app/src/utils/tauriCommands/cron.test.ts b/app/src/utils/tauriCommands/cron.test.ts
index fa6d871160..51f9fa25ba 100644
--- a/app/src/utils/tauriCommands/cron.test.ts
+++ b/app/src/utils/tauriCommands/cron.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Vitest coverage for the two new cron tauriCommand wrappers added by the
* skills runner PR: openhumanCronRun and openhumanCronRuns.
diff --git a/app/src/utils/tauriCommands/directoryPicker.test.ts b/app/src/utils/tauriCommands/directoryPicker.test.ts
index 8b84739d48..68a620431c 100644
--- a/app/src/utils/tauriCommands/directoryPicker.test.ts
+++ b/app/src/utils/tauriCommands/directoryPicker.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Tests for the native directory chooser wrapper (#5831).
*
diff --git a/app/src/utils/tauriCommands/localAi.test.ts b/app/src/utils/tauriCommands/localAi.test.ts
index f7aa8f803d..fb5d88c8dc 100644
--- a/app/src/utils/tauriCommands/localAi.test.ts
+++ b/app/src/utils/tauriCommands/localAi.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { beforeEach, describe, expect, it, vi } from 'vitest';
vi.mock('../../services/coreRpcClient', () => ({ callCoreRpc: vi.fn() }));
diff --git a/app/src/utils/tauriCommands/taskSources.test.ts b/app/src/utils/tauriCommands/taskSources.test.ts
index bbafbe75ac..e753b1b847 100644
--- a/app/src/utils/tauriCommands/taskSources.test.ts
+++ b/app/src/utils/tauriCommands/taskSources.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
/**
* Vitest for the task-sources tauriCommands surface.
*
diff --git a/app/src/utils/tauriCommands/workspacePaths.test.ts b/app/src/utils/tauriCommands/workspacePaths.test.ts
index cd18aae799..4e5c3f9f80 100644
--- a/app/src/utils/tauriCommands/workspacePaths.test.ts
+++ b/app/src/utils/tauriCommands/workspacePaths.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { invoke } from '@tauri-apps/api/core';
import { beforeEach, describe, expect, test, vi } from 'vitest';
diff --git a/app/src/utils/tauriCsp.test.ts b/app/src/utils/tauriCsp.test.ts
index c89cfa16b7..bfc1634c1f 100644
--- a/app/src/utils/tauriCsp.test.ts
+++ b/app/src/utils/tauriCsp.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { describe, expect, it } from 'vitest';
diff --git a/app/src/utils/toolDefinitions.test.ts b/app/src/utils/toolDefinitions.test.ts
index a4f4226062..359523b6c6 100644
--- a/app/src/utils/toolDefinitions.test.ts
+++ b/app/src/utils/toolDefinitions.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import {
diff --git a/app/src/utils/workspaceLinks.test.ts b/app/src/utils/workspaceLinks.test.ts
index 978fa146b8..78136cfee7 100644
--- a/app/src/utils/workspaceLinks.test.ts
+++ b/app/src/utils/workspaceLinks.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, test } from 'vitest';
import { isWorkspaceHref, parseWorkspaceHref } from './workspaceLinks';
diff --git a/app/test/core-rpc-node.test.ts b/app/test/core-rpc-node.test.ts
index 9d6a2b1b41..5af670abf0 100644
--- a/app/test/core-rpc-node.test.ts
+++ b/app/test/core-rpc-node.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { afterEach, describe, expect, it, vi } from 'vitest';
import { formatRpcCallFailure } from './e2e/helpers/core-rpc-node';
diff --git a/app/test/coverage-matrix-parser.test.ts b/app/test/coverage-matrix-parser.test.ts
index 86e2902f8b..d6ec3ce7af 100644
--- a/app/test/coverage-matrix-parser.test.ts
+++ b/app/test/coverage-matrix-parser.test.ts
@@ -1,4 +1,3 @@
-// @vitest-environment node
import { describe, expect, it } from 'vitest';
import { parseMatrix, validateAgainstCatalog } from '../../scripts/lib/coverage-matrix-parser.mjs';