Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

perf(agents): load the agent block eagerly (#7796)

Wolf Mermelsteinba6a67b430e7
diff --git a/apps/web/src/features/block-agent/CHANNEL_BLOCK_NOTES.md b/apps/web/src/features/block-agent/CHANNEL_BLOCK_NOTES.md
index bb03255bd2..18d412b4d1 100644
--- a/apps/web/src/features/block-agent/CHANNEL_BLOCK_NOTES.md
+++ b/apps/web/src/features/block-agent/CHANNEL_BLOCK_NOTES.md
@@ -22,7 +22,7 @@ features/block-channel/definition.ts defineBlock({ name:'channel', comp
### definition.ts (`features/block-channel/definition.ts`)
Trivial: `load` accepts a `dss` source and returns `ok({ id })`. `liveTrackingEnabled: true`.
-The agent block's `definition.ts` is already the same shape (with `lazy()` component — keep that).
+The agent block's `definition.ts` is already the same shape.
### The adapter layer (`NewChannelBlockAdapter.tsx`)
Everything "block-shaped" lives here, NOT in Channel.tsx:
diff --git a/apps/web/src/features/block-agent/definition.ts b/apps/web/src/features/block-agent/definition.ts
index a0e001a012..accc11a23b 100644
--- a/apps/web/src/features/block-agent/definition.ts
+++ b/apps/web/src/features/block-agent/definition.ts
@@ -1,11 +1,11 @@
import { defineBlock, type ExtractLoadType, LoadErrors } from '@core/block';
import { ok } from 'neverthrow';
-import { lazy } from 'solid-js';
+import Block from './component/Block';
export const definition = defineBlock({
name: 'agent',
description: 'View an agent session',
- component: lazy(() => import('./component/Block')),
+ component: Block,
liveTrackingEnabled: false,
async load(source, _intent) {
// A just-created session's id is the real one from the first frame
diff --git a/apps/web/src/features/routines/components/routines-list.test.tsx b/apps/web/src/features/routines/components/routines-list.test.tsx
index 45cb3070fb..da1e45c2fa 100644
--- a/apps/web/src/features/routines/components/routines-list.test.tsx
+++ b/apps/web/src/features/routines/components/routines-list.test.tsx
@@ -3,6 +3,17 @@ import { afterEach, describe, expect, it, vi } from 'vitest';
import type { RoutineRow } from '../core/types';
import { RoutinesList } from './routines-list';
+vi.mock('@service-connection/websocket', () => ({
+ ws: { addEventListener: vi.fn(), send: vi.fn() },
+ state: () => 'closed',
+ createConnectionBlockWebsocketEffect: vi.fn(),
+ createConnectionWebsocketEffect: vi.fn(),
+}));
+vi.mock('@service-storage/websocket', () => ({
+ storageWS: { reconnectIfDisconnected: vi.fn() },
+ createWebSocketJob: vi.fn(),
+}));
+
afterEach(cleanup);
const rows: RoutineRow[] = [
{