diff --git a/install.sh b/install.sh index f94b681..11da62d 100644 --- a/install.sh +++ b/install.sh @@ -201,6 +201,8 @@ CLAWD_LOG_FILE=1 # CLAWD_SERVER=wss://claw.cutos.ai/ws # Agent runtime: openclaw (default) or cutos-agent # AGENT_TYPE=openclaw +# CutOS Agent Pi models config path +# PI_MODELS_CONFIG=$HOME/.pi/agent/models.json # Enable Bluetooth monitor (bluetoothctl); disabled by default # CLAWD_ENABLE_BT=1 # OpenVFD sysfs path (default: /sys/class/leds/openvfd) diff --git a/lib/pi-provider.js b/lib/pi-provider.js index e23cffa..210291d 100644 --- a/lib/pi-provider.js +++ b/lib/pi-provider.js @@ -14,7 +14,7 @@ let operationId = 0; function resolvePiModelsConfigFile(env = process.env) { const configured = String(env.PI_MODELS_CONFIG || '').trim(); - return configured ? path.resolve(configured) : path.join(os.homedir(), '.pi', 'models.json'); + return configured ? path.resolve(configured) : path.join(os.homedir(), '.pi', 'agent', 'models.json'); } function normalizeBaseUrl(baseUrl) { diff --git a/test/pi-provider.test.js b/test/pi-provider.test.js index fe9b240..f17b0d8 100644 --- a/test/pi-provider.test.js +++ b/test/pi-provider.test.js @@ -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, {