Skip to content

Commit c21c14e

Browse files
authored
🐛 fix: fix azure ai runtime error (lobehub#9276)
* fix azure ai * improve agent schema * improve agent schema * improve header size * remove sentry * remove sentry * fix * clean * fix tests
1 parent 46f2a28 commit c21c14e

File tree

21 files changed

+6529
-163
lines changed

21 files changed

+6529
-163
lines changed

docs/development/database-schema.dbml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
table agents {
22
id text [pk, not null]
33
slug varchar(100) [unique]
4-
title text
5-
description text
4+
title varchar(255)
5+
description varchar(1000)
66
tags jsonb [default: `[]`]
77
avatar text
88
background_color text

next.config.ts

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import analyzer from '@next/bundle-analyzer';
2-
import { withSentryConfig } from '@sentry/nextjs';
32
import withSerwistInit from '@serwist/next';
43
import type { NextConfig } from 'next';
54
import ReactComponentName from 'react-scan/react-component-name/webpack';
@@ -326,39 +325,4 @@ const withPWA =
326325
})
327326
: noWrapper;
328327

329-
const hasSentry = !!process.env.NEXT_PUBLIC_SENTRY_DSN;
330-
const withSentry =
331-
isProd && hasSentry
332-
? (c: NextConfig) =>
333-
withSentryConfig(c, {
334-
// Enables automatic instrumentation of Vercel Cron Monitors.
335-
// See the following for more information:
336-
// https://docs.sentry.io/product/crons/
337-
// https://vercel.com/docs/cron-jobs
338-
automaticVercelMonitors: true,
339-
340-
// Automatically tree-shake Sentry logger statements to reduce bundle size
341-
disableLogger: true,
342-
343-
org: process.env.SENTRY_ORG,
344-
345-
project: process.env.SENTRY_PROJECT,
346-
347-
// For all available options, see:
348-
// https://github.com/getsentry/sentry-webpack-plugin#options
349-
// Suppresses source map uploading logs during build
350-
silent: true,
351-
352-
// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. (increases server load)
353-
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
354-
// side errors will fail.
355-
tunnelRoute: '/monitoring',
356-
357-
// For all available options, see:
358-
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
359-
// Upload a larger set of source maps for prettier stack traces (increases build time)
360-
widenClientFileUpload: true,
361-
})
362-
: noWrapper;
363-
364-
export default withBundleAnalyzer(withPWA(withSentry(nextConfig) as NextConfig));
328+
export default withBundleAnalyzer(withPWA(nextConfig as NextConfig));

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
"@neondatabase/serverless": "^1.0.1",
168168
"@next/third-parties": "^15.5.3",
169169
"@react-spring/web": "^9.7.5",
170-
"@sentry/nextjs": "^10.11.0",
171170
"@serwist/next": "^9.2.1",
172171
"@t3-oss/env-nextjs": "^0.13.8",
173172
"@tanstack/react-query": "^5.87.4",

packages/const/src/layoutTokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const FORM_STYLE: FormProps = {
2121
style: { maxWidth: MAX_WIDTH, width: '100%' },
2222
};
2323
export const MOBILE_HEADER_ICON_SIZE: ActionIconProps['size'] = { blockSize: 36, size: 22 };
24-
export const DESKTOP_HEADER_ICON_SIZE: ActionIconProps['size'] = { blockSize: 36, size: 22 };
24+
export const DESKTOP_HEADER_ICON_SIZE: ActionIconProps['size'] = { blockSize: 32, size: 20 };
2525
export const HEADER_ICON_SIZE = (mobile?: boolean) =>
2626
mobile ? MOBILE_HEADER_ICON_SIZE : DESKTOP_HEADER_ICON_SIZE;
2727
export const PWA_INSTALL_ID = 'pwa-install';
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
CREATE INDEX "agents_title_idx" ON "agents" USING btree ("title");--> statement-breakpoint
2-
CREATE INDEX "agents_description_idx" ON "agents" USING btree ("description");
1+
-- 将超过 1000 字符的 description 截断为 1000 字符
2+
UPDATE agents
3+
SET description = LEFT(description, 1000)
4+
WHERE LENGTH(description) > 1000;--> statement-breakpoint
5+
CREATE INDEX IF NOT EXISTS "agents_title_idx" ON "agents" USING btree ("title");--> statement-breakpoint
6+
CREATE INDEX IF NOT EXISTS "agents_description_idx" ON "agents" USING btree ("description");
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- 将超过 255 字符的 title 截断为 255 字符
2+
UPDATE agents
3+
SET title = LEFT(title, 255)
4+
WHERE LENGTH(title) > 255;--> statement-breakpoint
5+
ALTER TABLE "agents" ALTER COLUMN "title" SET DATA TYPE varchar(255);--> statement-breakpoint
6+
ALTER TABLE "agents" ALTER COLUMN "description" SET DATA TYPE varchar(1000);

0 commit comments

Comments
 (0)