perf: memo GridCard, fuse save fns, fix slash tab active color
Some checks failed
CI / Lint, Unit Tests & Build (push) Failing after 1m32s
CI / Deploy production (on server) (push) Has been skipped

This commit is contained in:
Antigravity
2026-06-14 14:06:05 +00:00
parent a8785ed4f1
commit a623454347
120 changed files with 12301 additions and 785 deletions

View File

@@ -19,7 +19,7 @@ const createSchema = z.object({
apiKey: z.string().min(8),
alias: z.string().max(120).optional(),
model: z.string().max(120).optional(),
baseUrl: z.string().url().optional(),
baseUrl: z.string().max(2000).optional(),
});
import { PROVIDER_MODEL_SUGGESTIONS } from '@/lib/ai/models-list';
@@ -75,8 +75,9 @@ export async function POST(req: NextRequest) {
);
}
const effectiveBaseUrl = provider === 'custom' ? body.baseUrl : undefined;
if (provider !== 'custom' && body.baseUrl) {
const effectiveBaseUrl = (provider === 'custom' || provider === 'custom_openai' || provider === 'custom_anthropic') ? body.baseUrl : undefined;
const allowsBaseUrl = provider === 'custom' || provider === 'custom_openai' || provider === 'custom_anthropic';
if (!allowsBaseUrl && body.baseUrl) {
return NextResponse.json(
{ error: 'INVALID_REQUEST', message: 'baseUrl is only allowed for custom providers' },
{ status: 400 },
@@ -96,6 +97,7 @@ export async function POST(req: NextRequest) {
plaintext: body.apiKey,
alias: body.alias,
model: body.model,
baseUrl: effectiveBaseUrl,
});
return NextResponse.json({ key: toPublicApiKey(row) });