v0.6.25: cloudwatch, live kb sync, linear fixes, posthog upgrade#3963
v0.6.25: cloudwatch, live kb sync, linear fixes, posthog upgrade#3963waleedlatif1 merged 11 commits intomainfrom
Conversation
…nks (#3925) * fix(ui): handle markdown internal links * Fix lint * Reference correct scroll container * Add resource tab to url state, scroll correctly on new tab * Handle delete all resource by clearing url --------- Co-authored-by: Theodore Li <theo@sim.ai>
* fix(posthog): upgrade SDKs and fix serverless event flushing * fix(posthog): revert flushAt to 20 for long-running ECS container
…g billing (#3959) * feat(knowledge): add Live sync option to KB connector modal for Max/Enterprise users Adds a "Live" (every 5 min) sync frequency option gated to Max and Enterprise plan users. Includes client-side badge + disabled state, shared sync intervals constant, and server-side plan validation on both POST and PATCH connector routes. * fix(knowledge): record embedding usage cost for KB document processing Adds billing tracking to the KB embedding pipeline, which was previously generating OpenAI API calls with no cost recorded. Token counts are now captured from the actual API response and recorded via recordUsage after successful embedding insertion. BYOK workspaces are excluded from billing. Applies to all execution paths: direct, BullMQ, and Trigger.dev. * fix(knowledge): simplify embedding billing — use calculateCost, return modelName - Use calculateCost() from @/providers/utils instead of inline formula, consistent with how LLM billing works throughout the platform - Return modelName from GenerateEmbeddingsResult so billing uses the actual model (handles custom Azure deployments) instead of a hardcoded fallback string - Fix docs-chunker.ts empty-path fallback to satisfy full GenerateEmbeddingsResult type * fix(knowledge): remove dev bypass from hasLiveSyncAccess * chore(knowledge): rename sync-intervals to consts, fix stale TSDoc comment * improvement(knowledge): extract MaxBadge component, capture billing config once per document * fix(knowledge): add knowledge-base to usage_log_source enum, fix docs-chunker type * fix(knowledge): generate migration for knowledge-base usage_log_source enum value * fix(knowledge): add knowledge-base to usage_log_source enum via drizzle-kit * fix(knowledge): fix search embedding test mocks, parallelize billing lookups * fix(knowledge): warn when embedding model has no pricing entry * fix(knowledge): call checkAndBillOverageThreshold after embedding usage
* feat(analytics): posthog audit — remove noise, add 10 new events Remove task_marked_read (fires automatically on every task view). Add workspace_id to task_message_sent for group analytics. New events: - search_result_selected: block/tool/trigger/workflow/table/file/ knowledge_base/workspace/task/page/docs with query_length - workflow_imported: count + format (json/zip) - workflow_exported: count + format (json/zip) - folder_created / folder_deleted - logs_filter_applied: status/workflow/folder/trigger/time - knowledge_base_document_deleted - scheduled_task_created / scheduled_task_deleted * fix(analytics): use usePostHog + captureEvent in hooks, track custom date range * fix(analytics): always fire scheduled_task_deleted regardless of workspaceId * fix(analytics): correct format field logic and add missing useCallback deps
…3961) * fix(kb): fix Linear connector GraphQL type errors and tag slot reuse * fix(kb): simplify tag slot reuse, revert Linear GraphQL types to String Clean up newTagSlotMapping into direct assignment, remove unnecessary comment, and revert ID! back to String! to match Linear SDK types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(kb): use ID! type for Linear GraphQL filter variables * fix(kb): verify field type when reusing existing tag slots Add fieldType check to the tag slot reuse logic so a connector with a matching displayName but different fieldType falls through to fresh slot allocation instead of silently reusing an incompatible slot. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(kb): enable search on connector selector dropdowns --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat(block): Add cloudwatch block (#3911) * feat(block): add cloudwatch integration * Fix bun lock * Add logger, use execution timeout * Switch metric dimensions to map style input * Fix attribute names for dimension map * Fix import styling --------- Co-authored-by: Theodore Li <theo@sim.ai> * Fix import ordering --------- Co-authored-by: Theodore Li <theo@sim.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Knowledge base connector + embedding pipeline updates. Adds a “Live” (5 min) sync interval option gated to Max/Enterprise on hosted deployments (server-side enforcement + UI disable/badge), improves tag-slot reuse when creating connectors, and changes Product analytics + UX tweaks. Expands PostHog events (folders, schedules, logs filters, search selection, workflow import/export, KB doc deletion), upgrades PostHog SDKs and improves shutdown flushing, removes a noisy Reviewed by Cursor Bugbot for commit 855c892. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 855c892. Configure here.
Greptile SummaryThis release bundles ten incremental improvements across monitoring integrations, knowledge-base sync billing, and developer tooling. The headline feature is a new CloudWatch block (7 operations: Log Insights query, log groups/streams, log events, list metrics, metric statistics, and describe alarms) with cascading file-selectors for log groups and streams. Knowledge-base connectors receive a Live sync tier (5-minute interval gated behind Max/Enterprise plans on both the frontend and both API routes), a fix for tag-slot reuse when re-adding connectors with matching field definitions, and accurate per-document embedding billing that skips BYOK users. Linear connector GraphQL type fixes (
Confidence Score: 4/5PR is safe to merge; all remaining findings are P2 style/usability suggestions that do not affect correctness or data integrity All billing and auth paths are properly double-gated on both frontend and backend. Linear type fixes, tag-slot reuse, and embedding billing corrections are solid. Three P2 findings remain: (1) describe-log-groups and list-metrics only fetch the first page, silently omitting results in large AWS accounts; (2) CloudWatch output timestamps are inconsistent between routes (epoch seconds for metric stats, epoch milliseconds everywhere else). None of these block correctness or data integrity, but the pagination gap could meaningfully degrade usability in large AWS accounts. apps/sim/app/api/tools/cloudwatch/describe-log-groups/route.ts, apps/sim/app/api/tools/cloudwatch/list-metrics/route.ts, apps/sim/app/api/tools/cloudwatch/get-metric-statistics/route.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as Browser / Workflow UI
participant SelectorAPI as /api/tools/cloudwatch/describe-log-groups
participant SelectorStreamsAPI as /api/tools/cloudwatch/describe-log-streams
participant ToolExec as Workflow Executor
participant QueryAPI as /api/tools/cloudwatch/query-logs
participant LogEventsAPI as /api/tools/cloudwatch/get-log-events
participant MetricsAPI as /api/tools/cloudwatch/get-metric-statistics
participant AlarmsAPI as /api/tools/cloudwatch/describe-alarms
participant AWS as AWS CloudWatch / CloudWatch Logs
UI->>SelectorAPI: POST (session auth) — list log groups
SelectorAPI->>AWS: DescribeLogGroupsCommand
AWS-->>SelectorAPI: logGroups (first page only)
SelectorAPI-->>UI: { logGroups }
UI->>SelectorStreamsAPI: POST (session auth) — list streams for selected group
SelectorStreamsAPI->>AWS: DescribeLogStreamsCommand
AWS-->>SelectorStreamsAPI: logStreams
SelectorStreamsAPI-->>UI: { logStreams }
ToolExec->>QueryAPI: POST (internal auth) — run Insights query
QueryAPI->>AWS: StartQueryCommand
AWS-->>QueryAPI: queryId
loop poll until Complete or timeout
QueryAPI->>AWS: GetQueryResultsCommand
AWS-->>QueryAPI: status + partial results
end
QueryAPI-->>ToolExec: { results, statistics, status }
ToolExec->>LogEventsAPI: POST (internal auth)
LogEventsAPI->>AWS: GetLogEventsCommand (epoch-ms timestamps)
AWS-->>LogEventsAPI: events
LogEventsAPI-->>ToolExec: { events (epoch-ms) }
ToolExec->>MetricsAPI: POST (internal auth)
MetricsAPI->>AWS: GetMetricStatisticsCommand
AWS-->>MetricsAPI: datapoints
MetricsAPI-->>ToolExec: { label, datapoints (epoch-seconds ⚠️) }
ToolExec->>AlarmsAPI: POST (internal auth)
AlarmsAPI->>AWS: DescribeAlarmsCommand
AWS-->>AlarmsAPI: MetricAlarms + CompositeAlarms
AlarmsAPI-->>ToolExec: { alarms (stateUpdatedTimestamp epoch-ms) }
Reviews (1): Last reviewed commit: "feat(block): Add cloudwatch block (#395..." | Re-trigger Greptile |
| const logGroups = (response.logGroups ?? []).map((lg) => ({ | ||
| logGroupName: lg.logGroupName ?? '', | ||
| arn: lg.arn ?? '', | ||
| storedBytes: lg.storedBytes ?? 0, | ||
| retentionInDays: lg.retentionInDays, | ||
| creationTime: lg.creationTime, | ||
| })) | ||
|
|
||
| return NextResponse.json({ | ||
| success: true, | ||
| output: { logGroups }, | ||
| }) | ||
| } catch (error) { | ||
| const errorMessage = |
There was a problem hiding this comment.
First-page only — selector may miss log groups in large accounts
The DescribeLogGroupsCommand response includes a nextToken for pagination, but the implementation only processes the first page. In AWS accounts with many log groups (default page size is 50), the UI dropdown selector will silently omit log groups beyond the first page. Consider paginating when the response includes a nextToken, or at least relying on the search/prefix filter to narrow results.
| const response = await client.send(command) | ||
|
|
||
| const metrics = (response.Metrics ?? []).slice(0, validatedData.limit ?? 500).map((m) => ({ | ||
| namespace: m.Namespace ?? '', | ||
| metricName: m.MetricName ?? '', | ||
| dimensions: (m.Dimensions ?? []).map((d) => ({ | ||
| name: d.Name ?? '', | ||
| value: d.Value ?? '', | ||
| })), | ||
| })) |
There was a problem hiding this comment.
Only first page of metrics returned
ListMetricsCommand paginates via NextToken, but only the first page is fetched. The post-fetch slice(0, validatedData.limit ?? 500) cap is applied to a result set that may already be incomplete. ListMetricsCommand supports a MaxResults parameter (max 500) that can be set directly on the command, making the limit explicit and eliminating silent truncation for users with many custom metrics.
|
|
||
| const datapoints = (response.Datapoints ?? []) | ||
| .sort((a, b) => (a.Timestamp?.getTime() ?? 0) - (b.Timestamp?.getTime() ?? 0)) | ||
| .map((dp) => ({ | ||
| timestamp: dp.Timestamp ? Math.floor(dp.Timestamp.getTime() / 1000) : 0, | ||
| average: dp.Average, | ||
| sum: dp.Sum, |
There was a problem hiding this comment.
Timestamp unit inconsistency across CloudWatch routes
Metric datapoint timestamp values are converted to epoch seconds via Math.floor(dp.Timestamp.getTime() / 1000), while all other CloudWatch output timestamps (log event timestamp, log stream lastEventTimestamp / firstEventTimestamp / creationTime, alarm stateUpdatedTimestamp) are returned as epoch milliseconds directly from the AWS SDK.
This inconsistency will confuse users composing multiple CloudWatch operations in a workflow. Consider normalising all output timestamps to the same unit — either all milliseconds (matching the AWS SDK native representation and the rest of the routes) or all seconds (matching the startTime/endTime inputs throughout the block).
…tions (#3964) * feat(cloudformation): add AWS CloudFormation integration with 7 operations * fix(cloudformation): add pagination to list-stack-resources, describe-stacks, and describe-stack-events routes

Uh oh!
There was an error while loading. Please reload this page.