fix(auth): scope km alias mapping to settings profiles

- prevent km continuity mappings from affecting kimi cliproxy executions

- apply canonical alias fallback only for settings profile lookups

- add regression test for cross-type alias isolation
This commit is contained in:
Tam Nhu Tran committed 2026-03-03 02:58:49 +07:00
1 parent 1eb41cc4e2
commit d827c3ab0b
2 files changed
+33 -6

No files matched your search

@@ -258,6 +258,28 @@ describe('resolveProfileContinuityInheritance', () => {
});
});
it('does not apply km settings alias mapping to kimi cliproxy profile', async () => {
spyOn(configLoader, 'loadOrCreateUnifiedConfig').mockReturnValue({
version: 8,
continuity: {
inherit_from_account: {
km: 'pro',
},
},
} as ReturnType<typeof configLoader.loadOrCreateUnifiedConfig>);
const ensureInstanceSpy = spyOn(InstanceManager.prototype, 'ensureInstance');
const result = await resolveProfileContinuityInheritance({
profileName: 'kimi',
profileType: 'cliproxy',
target: 'claude',
});
expect(result).toEqual({});
expect(ensureInstanceSpy).not.toHaveBeenCalled();
});
it('fails open when source account instance initialization throws', async () => {
spyOn(configLoader, 'loadOrCreateUnifiedConfig').mockReturnValue({
version: 8,