Skip to content

Commit 8d6b615

Browse files
v0.6.67: VFS upload fix, posthog/copilot correlation, exa date filters, logs panel width, tables UI/DB decoupling
v0.6.67: VFS upload fix, posthog/copilot correlation, exa date filters, logs panel width, tables UI/DB decoupling
2 parents 4253e57 + c09e0a0 commit 8d6b615

24 files changed

Lines changed: 16103 additions & 393 deletions

File tree

apps/docs/content/docs/en/tools/exa.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ Search the web using Exa AI. Returns relevant search results with titles, URLs,
5454
| `highlights` | boolean | No | Include highlighted snippets in results \(default: false\) |
5555
| `summary` | boolean | No | Include AI-generated summaries in results \(default: false\) |
5656
| `livecrawl` | string | No | Live crawling mode: never \(default\), fallback, always, or preferred \(always try livecrawl, fall back to cache if fails\) |
57+
| `startCrawlDate` | string | No | Only include results crawled on or after this ISO 8601 date \(e.g., "2024-01-01" or "2024-01-01T00:00:00.000Z"\) |
58+
| `endCrawlDate` | string | No | Only include results crawled on or before this ISO 8601 date |
59+
| `startPublishedDate` | string | No | Only include results published on or after this ISO 8601 date |
60+
| `endPublishedDate` | string | No | Only include results published on or before this ISO 8601 date |
5761
| `apiKey` | string | Yes | Exa AI API Key |
5862
| `pricing` | custom | No | No description |
5963
| `metadata` | string | No | No description |

apps/sim/app/workspace/[workspaceId]/home/home.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,21 @@ export function Home({ chatId }: HomeProps = {}) {
143143
editQueuedMessage,
144144
previewSession,
145145
genericResourceData,
146+
getCurrentRequestId,
146147
} = useChat(
147148
workspaceId,
148149
chatId,
149150
getMothershipUseChatOptions({
150151
onResourceEvent: handleResourceEvent,
151152
initialActiveResourceId: initialResourceId,
153+
onRequestStarted: ({ requestId, userMessageId }) => {
154+
captureEvent(posthogRef.current, 'task_request_started', {
155+
workspace_id: workspaceId,
156+
view: 'mothership',
157+
request_id: requestId,
158+
user_message_id: userMessageId,
159+
})
160+
},
152161
})
153162
)
154163

@@ -198,6 +207,7 @@ export function Home({ chatId }: HomeProps = {}) {
198207
captureEvent(posthogRef.current, 'task_generation_aborted', {
199208
workspace_id: workspaceId,
200209
view: 'mothership',
210+
request_id: getCurrentRequestId(),
201211
})
202212
void stopGeneration().catch(() => {})
203213
}

apps/sim/app/workspace/[workspaceId]/home/hooks/use-chat.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export interface UseChatReturn {
167167
editQueuedMessage: (id: string) => QueuedMessage | undefined
168168
previewSession: FilePreviewSession | null
169169
genericResourceData: GenericResourceData | null
170+
getCurrentRequestId: () => string | undefined
170171
}
171172

172173
const DEPLOY_TOOL_NAMES: Set<string> = new Set([
@@ -1278,6 +1279,8 @@ export interface UseChatOptions {
12781279
onTitleUpdate?: () => void
12791280
onStreamEnd?: (chatId: string, messages: ChatMessage[]) => void
12801281
initialActiveResourceId?: string | null
1282+
/** Fired when the server's `traceparent` response header arrives, before any stream content. */
1283+
onRequestStarted?: (info: { requestId: string; userMessageId: string }) => void
12811284
}
12821285

12831286
interface ActiveStreamRecovery {
@@ -1293,7 +1296,10 @@ interface StopGenerationOptions {
12931296
}
12941297

12951298
export function getMothershipUseChatOptions(
1296-
options: Pick<UseChatOptions, 'onResourceEvent' | 'onStreamEnd' | 'initialActiveResourceId'> = {}
1299+
options: Pick<
1300+
UseChatOptions,
1301+
'onResourceEvent' | 'onStreamEnd' | 'initialActiveResourceId' | 'onRequestStarted'
1302+
> = {}
12971303
): UseChatOptions {
12981304
return {
12991305
apiPath: MOTHERSHIP_CHAT_API_PATH,
@@ -1305,7 +1311,7 @@ export function getMothershipUseChatOptions(
13051311
export function getWorkflowCopilotUseChatOptions(
13061312
options: Pick<
13071313
UseChatOptions,
1308-
'workflowId' | 'onToolResult' | 'onTitleUpdate' | 'onStreamEnd'
1314+
'workflowId' | 'onToolResult' | 'onTitleUpdate' | 'onStreamEnd' | 'onRequestStarted'
13091315
> = {}
13101316
): UseChatOptions {
13111317
return {
@@ -1351,6 +1357,13 @@ export function useChat(
13511357
onTitleUpdateRef.current = options?.onTitleUpdate
13521358
const onStreamEndRef = useRef(options?.onStreamEnd)
13531359
onStreamEndRef.current = options?.onStreamEnd
1360+
const onRequestStartedRef = useRef(options?.onRequestStarted)
1361+
onRequestStartedRef.current = options?.onRequestStarted
1362+
1363+
const getCurrentRequestId = useCallback(() => {
1364+
const traceId = streamTraceparentRef.current?.split('-')[1] ?? ''
1365+
return /^[0-9a-f]{32}$/.test(traceId) ? traceId : undefined
1366+
}, [])
13541367

13551368
const clearQueueDispatchState = useCallback(() => {
13561369
queueDispatchEpochRef.current++
@@ -4209,6 +4222,14 @@ export function useChat(
42094222
if (traceparent) {
42104223
streamTraceparentRef.current = traceparent
42114224
setCurrentChatTraceparent(traceparent)
4225+
const traceId = traceparent.split('-')[1] ?? ''
4226+
if (/^[0-9a-f]{32}$/.test(traceId)) {
4227+
try {
4228+
onRequestStartedRef.current?.({ requestId: traceId, userMessageId })
4229+
} catch (callbackError) {
4230+
logger.warn('onRequestStarted callback threw', { error: callbackError })
4231+
}
4232+
}
42124233
}
42134234

42144235
if (!response.ok) {
@@ -5103,5 +5124,6 @@ export function useChat(
51035124
editQueuedMessage,
51045125
previewSession,
51055126
genericResourceData,
5127+
getCurrentRequestId,
51065128
}
51075129
}

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table/cells/expanded-cell-popover.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function ExpandedCellPopover({
7878
return
7979
}
8080
setDraftValue(isEditable ? formatValueForInput(target.value, target.column.type) : '')
81-
const selector = `[data-table-scroll] [data-row="${target.row.position}"][data-col="${target.colIndex}"]`
81+
const selector = `[data-table-scroll] [data-row-id="${target.row.id}"][data-col="${target.colIndex}"]`
8282
const el = document.querySelector<HTMLElement>(selector)
8383
if (!el) {
8484
setRect(null)

0 commit comments

Comments
 (0)