Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(byok): 心动企业成员也同步企业自带模型

孙毅dca7d6d8daa0
diff --git a/apps/desktop/src/main/model-access/__tests__/byokCredentials.test.ts b/apps/desktop/src/main/model-access/__tests__/byokCredentials.test.ts
index d52e806588..72e4cf4d02 100644
--- a/apps/desktop/src/main/model-access/__tests__/byokCredentials.test.ts
+++ b/apps/desktop/src/main/model-access/__tests__/byokCredentials.test.ts
@@ -17,7 +17,7 @@ afterEach(() => {
});
describe('BYOK live credential readers', () => {
- it('enables managed BYOK only for external organization identities', () => {
+ it('enables managed BYOK for organization identities, including xd', () => {
expect(isExternalOrganizationByokUser(null)).toBe(false);
expect(
isExternalOrganizationByokUser({
@@ -34,7 +34,7 @@ describe('BYOK live credential readers', () => {
orgSlug: 'xd',
orgName: 'XD',
}),
- ).toBe(false);
+ ).toBe(true);
expect(
isExternalOrganizationByokUser({
membershipKind: 'org',
diff --git a/apps/desktop/src/main/model-access/organizationManaged.ts b/apps/desktop/src/main/model-access/organizationManaged.ts
index ead602952a..870bfe17b7 100644
--- a/apps/desktop/src/main/model-access/organizationManaged.ts
+++ b/apps/desktop/src/main/model-access/organizationManaged.ts
@@ -1,13 +1,12 @@
-import { isXdOrgUser, type XdOrgBetaUser } from '../xdOrgBetaDefault.js';
+import type { XdOrgBetaUser } from '../xdOrgBetaDefault.js';
-/** Client BYOK is scoped to signed-in external organizations with a stable organization id. */
+/** Client BYOK is scoped to signed-in organizations (including xd) with a stable organization id. */
export function isExternalOrganizationByokUser(
user: (XdOrgBetaUser & { orgId: string | null }) | null | undefined,
): user is XdOrgBetaUser & { orgId: string } {
return Boolean(
user?.membershipKind === 'org' &&
typeof user.orgId === 'string' &&
- user.orgId.trim().length > 0 &&
- !isXdOrgUser(user),
+ user.orgId.trim().length > 0,
);
}