Fix CutOS Agent models config path
This commit is contained in:
@@ -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)
|
||||
|
||||
+1
-1
@@ -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) {
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user