Fix CutOS Agent models config path

This commit is contained in:
yankun
2026-08-02 19:17:31 +08:00
parent 9ccdd73955
commit 6488374da8
3 changed files with 15 additions and 1 deletions
+12
View File
@@ -30,6 +30,18 @@ const payload = {
'api-key': 'test-key',
};
test('defaults to Pi agent models config path', () => {
assert.equal(
piProvider.resolvePiModelsConfigFile({}),
path.join(os.homedir(), '.pi', 'agent', 'models.json'),
);
});
test('allows PI_MODELS_CONFIG to override Pi models config path', () => {
const customPath = path.join(os.tmpdir(), 'custom-pi-models.json');
assert.equal(piProvider.resolvePiModelsConfigFile({ PI_MODELS_CONFIG: customPath }), path.resolve(customPath));
});
test('creates a Pi models file and maps models to reasoning entries', async () => {
const configFile = tempConfig();
await apply(payload, {