Skip to content

Commit 4e86c51

Browse files
committed
fix(ci): restore test isolation and memory file scope checks
1 parent b5f194c commit 4e86c51

62 files changed

Lines changed: 290 additions & 166 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/sim/app/_shell/desktop-title-bar-surfaces.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ describe('desktop title-bar surface audit', () => {
166166
// (KnowledgeBase et al) whose header bars reserve the lane. It inherits the
167167
// variable, so without this reset those bars gain the inset while sitting nowhere
168168
// near the traffic lights.
169-
expect(mothershipView).toContain('[--workspace-content-title-bar-inset:0px]')
169+
expect(mothershipView).toContain('<ChatPanelContent')
170+
expect(read('../workspace/[workspaceId]/home/components/chat-panel-layout.tsx')).toContain(
171+
'[--workspace-content-title-bar-inset:0px]'
172+
)
170173
})
171174

172175
it('reserves that lane in every top-of-pane header bar', () => {

‎apps/sim/app/api/copilot/api-keys/validate/route.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import {
2323
import { getHighestPrioritySubscription } from '@/lib/billing/core/plan'
2424
import { isEnterprisePlan } from '@/lib/billing/core/subscription'
2525
import { deriveBillingContext } from '@/lib/billing/core/usage-log'
26+
import { isBillingEnabled, isHosted } from '@/lib/core/config/env-flags'
27+
import { asOrchestrationError } from '@/lib/core/orchestration/types'
2628
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
2729
import {
2830
authorizeCopilotChatCallback,
@@ -48,8 +50,6 @@ import { TraceAttr } from '@/lib/mothership/generated/trace-attributes-v1'
4850
import { TraceSpan } from '@/lib/mothership/generated/trace-spans-v1'
4951
import { checkInternalApiKey } from '@/lib/mothership/request/http'
5052
import { withIncomingGoSpan } from '@/lib/mothership/request/otel'
51-
import { isBillingEnabled, isHosted } from '@/lib/core/config/env-flags'
52-
import { asOrchestrationError } from '@/lib/core/orchestration/types'
5353

5454
const logger = createLogger('CopilotApiKeysValidate')
5555

‎apps/sim/app/api/copilot/chat/stop/route.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { type NextRequest, NextResponse } from 'next/server'
44
import { copilotChatStopContract } from '@/lib/api/contracts/copilot'
55
import { parseRequest } from '@/lib/api/server'
66
import { getSession } from '@/lib/auth'
7-
import { getAccessibleCopilotChatAuth } from '@/lib/mothership/chat/lifecycle'
87
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
8+
import { getAccessibleCopilotChatAuth } from '@/lib/mothership/chat/lifecycle'
99
import {
1010
normalizeMessage,
1111
type PersistedMessage,

‎apps/sim/app/api/copilot/chat/stream/route.test.ts‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,21 @@
33
*/
44

55
import { authMockFns } from '@sim/testing'
6-
import { OrchestrationError } from '@/lib/core/orchestration/types'
76
import { NextRequest } from 'next/server'
87
import { beforeEach, describe, expect, it, vi } from 'vitest'
8+
import { OrchestrationError } from '@/lib/core/orchestration/types'
99
import {
1010
MothershipStreamV1CompletionStatus,
1111
MothershipStreamV1EventType,
1212
} from '@/lib/mothership/generated/mothership-stream-v1'
1313

14-
const {
15-
getLatestRunForStream,
16-
readEvents,
17-
readFilePreviewSessions,
18-
checkForReplayGap,
19-
} = vi.hoisted(() => ({
20-
getLatestRunForStream: vi.fn(),
21-
readEvents: vi.fn(),
22-
readFilePreviewSessions: vi.fn(),
23-
checkForReplayGap: vi.fn(),
24-
}))
14+
const { getLatestRunForStream, readEvents, readFilePreviewSessions, checkForReplayGap } =
15+
vi.hoisted(() => ({
16+
getLatestRunForStream: vi.fn(),
17+
readEvents: vi.fn(),
18+
readFilePreviewSessions: vi.fn(),
19+
checkForReplayGap: vi.fn(),
20+
}))
2521

2622
vi.mock('@/lib/mothership/request/application/recover-stream', () => ({
2723
readChatStream: { execute: getLatestRunForStream },

‎apps/sim/app/api/copilot/chat/stream/route.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
internalOrchestrationErrorPolicy,
1212
internalSessionAuth,
1313
} from '@/lib/api/server/routes'
14+
import { encodeSSEComment } from '@/lib/core/utils/sse'
1415
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
1516
import {
1617
MothershipStreamV1CompletionStatus,
@@ -35,7 +36,6 @@ import {
3536
SSE_RESPONSE_HEADERS,
3637
} from '@/lib/mothership/request/session'
3738
import { toReplayEnvelope, toStreamBatchEvent } from '@/lib/mothership/request/session/types'
38-
import { encodeSSEComment } from '@/lib/core/utils/sse'
3939

4040
export const maxDuration = 3600
4141

‎apps/sim/app/api/knowledge/search/utils.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ describe('Knowledge Search Utils', () => {
740740
})
741741

742742
await expect(generateSearchEmbedding('test query', DEFAULT_EMBEDDING_TARGET)).rejects.toThrow(
743-
'OPENAI_API_KEY is not configured'
743+
'Semantic retrieval is unavailable because its embedding provider is not configured.'
744744
)
745745
})
746746

‎apps/sim/app/api/knowledge/utils.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ describe('Knowledge Utils', () => {
341341

342342
try {
343343
await expect(generateEmbeddings(['test text'], DEFAULT_EMBEDDING_TARGET)).rejects.toThrow(
344-
'OPENAI_API_KEY is not configured'
344+
'Semantic retrieval is unavailable because its embedding provider is not configured.'
345345
)
346346
expect(rotationSpy).toHaveBeenCalledWith('openai')
347347
expect(fetch).not.toHaveBeenCalled()

‎apps/sim/app/api/mothership/chat/route.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
} from '@/lib/api/contracts/mothership-chats'
66
import { validationErrorResponse } from '@/lib/api/server'
77
import { getSession } from '@/lib/auth'
8-
import { handleUnifiedChatPost } from '@/lib/mothership/chat/post'
98
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
9+
import { handleUnifiedChatPost } from '@/lib/mothership/chat/post'
1010
import { validateShimEnvelope } from '@/lib/mothership/request/http'
1111
import { GET as copilotChatGet } from '@/app/api/copilot/chat/queries'
1212

‎apps/sim/app/api/mothership/events/route.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import {
1515
InternalUnauthenticatedError,
1616
internalSessionAuth,
1717
} from '@/lib/api/server/routes/internal-json-route'
18-
import { authorizeOrganizationChatEvents } from '@/lib/mothership/chat/organization-chats'
19-
import { chatPubSub } from '@/lib/mothership/chat-status'
2018
import { isChatEnabled } from '@/lib/core/config/env-flags'
2119
import { asOrchestrationError } from '@/lib/core/orchestration/types'
2220
import { withRouteHandler } from '@/lib/core/utils/with-route-handler'
2321
import { createSSEStream, createWorkspaceSSE } from '@/lib/events/sse-endpoint'
22+
import { authorizeOrganizationChatEvents } from '@/lib/mothership/chat/organization-chats'
23+
import { chatPubSub } from '@/lib/mothership/chat-status'
2424

2525
export const dynamic = 'force-dynamic'
2626

‎apps/sim/app/api/v2/workflows/[workflowId]/export/route.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ describe('/api/v2/workflows/[workflowId]/export route definition', () => {
4848
})
4949
expect(
5050
mapInput({ params: { workflowId: 'workflow-1' }, query: { includeWorkspaceBindings: true } })
51-
).toEqual({ workflowId: 'workflow-1', includeReferences: false, includeWorkspaceBindings: true })
51+
).toEqual({
52+
workflowId: 'workflow-1',
53+
includeReferences: false,
54+
includeWorkspaceBindings: true,
55+
})
5256
expect(
5357
mapInput({
5458
params: { workflowId: 'workflow-1' },

0 commit comments

Comments
 (0)