mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-07 12:29:50 +08:00
feat(server): converge legacy compatibility (#15426)
#### PR Dependency Tree * **PR #15426** 👈 This tree was auto-generated by [Charcoal](https://github.com/danerwilliams/charcoal) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added workspace BYOK profiles with provider/model catalogs, capability validation, connection probing, credential rotation, reordering, and secure local leases. * Added Copilot route options, selectable targets, managed tiers, explicit profile/model overrides, and improved streaming with tool callbacks and abort support. * Added Copilot availability controls to prevent access when the feature is disabled. * **Changes** * Simplified Copilot configuration and removed legacy provider-specific settings. * Removed obsolete model, token-cost, transcript strategy, and provider metadata fields from public responses. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import { skipOnboarding } from '@affine-test/kit/playwright';
|
||||
import {
|
||||
createRandomAIUser,
|
||||
switchDefaultChatModel,
|
||||
} from '@affine-test/kit/utils/cloud';
|
||||
import { createRandomAIUser } from '@affine-test/kit/utils/cloud';
|
||||
import { openHomePage, setCoreUrl } from '@affine-test/kit/utils/load-page';
|
||||
import {
|
||||
clickNewPageButton,
|
||||
@@ -63,7 +60,6 @@ export class TestUtils {
|
||||
|
||||
public async setupTestEnvironment(page: Page, defaultModel?: string) {
|
||||
const selectedModel = defaultModel ?? 'gpt-5.6-luna';
|
||||
await switchDefaultChatModel(selectedModel);
|
||||
|
||||
await skipOnboarding(page.context());
|
||||
await page.context().addInitScript(model => {
|
||||
|
||||
@@ -155,21 +155,6 @@ export async function cleanupWorkspace(workspaceId: string): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function switchDefaultChatModel(model: string) {
|
||||
await runPrisma(async client => {
|
||||
const prompt = await client.aiPrompt.findFirst({
|
||||
where: { name: 'Chat With AFFiNE AI' },
|
||||
select: { id: true },
|
||||
});
|
||||
if (!prompt) return;
|
||||
|
||||
await client.aiPrompt.update({
|
||||
where: { id: prompt.id },
|
||||
data: { model },
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function createRandomAIUser(): Promise<{
|
||||
name: string;
|
||||
email: string;
|
||||
|
||||
Reference in New Issue
Block a user