Skip to content

Commit cd25280

Browse files
authored
feat: dashboard agent - package upgrades (#3793)
1. in webapp folder update ai-sdk to 6.x.x 2. update vitest to 4.xx
1 parent 4c4ed22 commit cd25280

30 files changed

Lines changed: 517 additions & 578 deletions

.github/workflows/unit-tests-internal.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: pnpm run generate
9797

9898
- name: 🧪 Run Internal Unit Tests
99-
run: pnpm run test:internal --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
99+
run: pnpm run test:internal --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests
100100

101101
- name: Gather all reports
102102
if: ${{ !cancelled() }}
@@ -145,4 +145,4 @@ jobs:
145145
merge-multiple: true
146146

147147
- name: Merge reports
148-
run: pnpm dlx vitest@3.1.4 run --merge-reports --pass-with-no-tests
148+
run: pnpm dlx vitest@4.1.7 run --merge-reports --pass-with-no-tests

.github/workflows/unit-tests-packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: pnpm run generate
9797

9898
- name: 🧪 Run Package Unit Tests
99-
run: pnpm run test:packages --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
99+
run: pnpm run test:packages --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests
100100

101101
- name: Gather all reports
102102
if: ${{ !cancelled() }}
@@ -145,4 +145,4 @@ jobs:
145145
merge-multiple: true
146146

147147
- name: Merge reports
148-
run: pnpm dlx vitest@3.1.4 run --merge-reports --pass-with-no-tests
148+
run: pnpm dlx vitest@4.1.7 run --merge-reports --pass-with-no-tests

.github/workflows/unit-tests-webapp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: pnpm run generate
9797

9898
- name: 🧪 Run Webapp Unit Tests
99-
run: pnpm run test:webapp --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
99+
run: pnpm run test:webapp --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests
100100
env:
101101
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
102102
DIRECT_URL: postgresql://postgres:postgres@localhost:5432/postgres
@@ -153,4 +153,4 @@ jobs:
153153
merge-multiple: true
154154

155155
- name: Merge reports
156-
run: pnpm dlx vitest@3.1.4 run --merge-reports --pass-with-no-tests
156+
run: pnpm dlx vitest@4.1.7 run --merge-reports --pass-with-no-tests

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query.ai-generate.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,19 @@ export async function action({ request, params }: ActionFunctionArgs) {
116116
for await (const part of result.fullStream) {
117117
switch (part.type) {
118118
case "text-delta": {
119-
sendEvent({ type: "thinking", content: part.textDelta });
119+
sendEvent({ type: "thinking", content: part.text });
120120
break;
121121
}
122122
case "tool-call": {
123123
sendEvent({
124124
type: "tool_call",
125125
tool: part.toolName,
126-
args: part.args,
126+
args: part.input,
127127
});
128128

129129
// If it's a setTimeFilter call, emit the time_filter event immediately
130130
if (part.toolName === "setTimeFilter") {
131-
const args = part.args as { period?: string; from?: string; to?: string };
131+
const args = part.input as { period?: string; from?: string; to?: string };
132132
sendEvent({
133133
type: "time_filter",
134134
filter: {

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.ai-generate-payload.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { openai } from "@ai-sdk/openai";
2-
import { streamText, tool } from "ai";
2+
import { streamText, stepCountIs, tool } from "ai";
33
import { type ActionFunctionArgs } from "@remix-run/server-runtime";
44
import { z } from "zod";
55
import { env } from "~/env.server";
@@ -105,19 +105,19 @@ export async function action({ request, params }: ActionFunctionArgs) {
105105
getTaskSourceCode: tool({
106106
description:
107107
"Look up the source code of the task to understand what payload shape it expects. Use this when there is no JSON Schema available and you need to infer the payload structure from the task implementation.",
108-
parameters: z.object({}),
108+
inputSchema: z.object({}),
109109
execute: async () => {
110110
return getTaskSourceCode(environment.id, environment.type, taskIdentifier);
111111
},
112112
}),
113113
},
114-
maxSteps: 3,
114+
stopWhen: stepCountIs(3),
115115
});
116116

117117
for await (const part of result.fullStream) {
118118
switch (part.type) {
119119
case "text-delta": {
120-
sendEvent({ type: "thinking", content: part.textDelta });
120+
sendEvent({ type: "thinking", content: part.text });
121121
break;
122122
}
123123
case "tool-call": {

apps/webapp/app/v3/services/aiQueryService.server.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
type TableSchema,
66
type ValidationIssue,
77
} from "@internal/tsql";
8-
import { streamText, type LanguageModelV1, tool } from "ai";
8+
import { streamText, stepCountIs, type LanguageModel, tool } from "ai";
99
import { z } from "zod";
1010
import type { AITimeFilter } from "~/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/types";
1111

@@ -55,7 +55,7 @@ export class AIQueryService {
5555

5656
constructor(
5757
private readonly tableSchema: TableSchema[],
58-
private readonly model: LanguageModelV1 = openai("gpt-4.1-mini")
58+
private readonly model: LanguageModel = openai("gpt-4.1-mini")
5959
) {}
6060

6161
/**
@@ -66,7 +66,7 @@ export class AIQueryService {
6666
return tool({
6767
description:
6868
"Set the time filter for the query page UI instead of adding time conditions to the query. ALWAYS use this tool when the user wants to filter by time (e.g., 'last 7 days', 'past hour', 'yesterday'). The UI will apply this filter automatically using the table's time column (triggered_at for runs, bucket_start for metrics). Do NOT add triggered_at or bucket_start to the WHERE clause for time filtering - use this tool instead.",
69-
parameters: z.object({
69+
inputSchema: z.object({
7070
period: z
7171
.string()
7272
.optional()
@@ -125,7 +125,7 @@ export class AIQueryService {
125125
validateTSQLQuery: tool({
126126
description:
127127
"Validate a TSQL query for syntax errors and schema compliance. Always use this tool to verify your query before returning it to the user.",
128-
parameters: z.object({
128+
inputSchema: z.object({
129129
query: z.string().describe("The TSQL query to validate"),
130130
}),
131131
execute: async ({ query }) => {
@@ -135,7 +135,7 @@ export class AIQueryService {
135135
getTableSchema: tool({
136136
description:
137137
"Get detailed schema information about available tables and columns. Use this to understand what data is available and how to query it.",
138-
parameters: z.object({
138+
inputSchema: z.object({
139139
tableName: z
140140
.string()
141141
.optional()
@@ -147,7 +147,7 @@ export class AIQueryService {
147147
}),
148148
setTimeFilter: this.buildSetTimeFilterTool(),
149149
},
150-
maxSteps: 5,
150+
stopWhen: stepCountIs(5),
151151
experimental_telemetry: {
152152
isEnabled: true,
153153
metadata: {
@@ -191,7 +191,7 @@ export class AIQueryService {
191191
validateTSQLQuery: tool({
192192
description:
193193
"Validate a TSQL query for syntax errors and schema compliance. Always use this tool to verify your query before returning it to the user.",
194-
parameters: z.object({
194+
inputSchema: z.object({
195195
query: z.string().describe("The TSQL query to validate"),
196196
}),
197197
execute: async ({ query }) => {
@@ -201,7 +201,7 @@ export class AIQueryService {
201201
getTableSchema: tool({
202202
description:
203203
"Get detailed schema information about available tables and columns. Use this to understand what data is available and how to query it.",
204-
parameters: z.object({
204+
inputSchema: z.object({
205205
tableName: z
206206
.string()
207207
.optional()
@@ -213,7 +213,7 @@ export class AIQueryService {
213213
}),
214214
setTimeFilter: this.buildSetTimeFilterTool(),
215215
},
216-
maxSteps: 5,
216+
stopWhen: stepCountIs(5),
217217
experimental_telemetry: {
218218
isEnabled: true,
219219
metadata: {

apps/webapp/app/v3/services/aiQueryTitleService.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { openai } from "@ai-sdk/openai";
2-
import { generateText, type LanguageModelV1 } from "ai";
2+
import { generateText, type LanguageModel } from "ai";
33
import { env } from "~/env.server";
44

55
/**
@@ -13,7 +13,7 @@ export type AIQueryTitleResult =
1313
* Service for generating concise titles for SQL queries using AI
1414
*/
1515
export class AIQueryTitleService {
16-
constructor(private readonly model: LanguageModelV1 = openai("gpt-4o-mini")) {}
16+
constructor(private readonly model: LanguageModel = openai("gpt-4o-mini")) {}
1717

1818
/**
1919
* Generate a concise title for a SQL query
@@ -45,7 +45,7 @@ Examples:
4545
- "Average execution time by task"
4646
- "Recent runs with errors"`,
4747
prompt: `Generate a concise title for this SQL query:\n\n${query}`,
48-
maxTokens: 50,
48+
maxOutputTokens: 50,
4949
experimental_telemetry: {
5050
isEnabled: true,
5151
metadata: {

0 commit comments

Comments
 (0)