mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 14:19:56 +00:00
fix(proxy): harden stale daemon ownership checks
This commit is contained in:
@@ -4,6 +4,7 @@ import * as os from 'os';
|
||||
import * as path from 'path';
|
||||
import {
|
||||
getLegacyOpenAICompatProxySessionPath,
|
||||
getOpenAICompatProxyPidPath,
|
||||
getOpenAICompatProxySessionPath,
|
||||
} from '../../../src/proxy/proxy-daemon-paths';
|
||||
import { listOpenAICompatProxyProfileNames } from '../../../src/proxy/proxy-daemon-state';
|
||||
@@ -42,4 +43,11 @@ describe('listOpenAICompatProxyProfileNames', () => {
|
||||
|
||||
expect(listOpenAICompatProxyProfileNames()).toEqual(['ccg']);
|
||||
});
|
||||
|
||||
it('includes pid-only profile state in the discovered profile list', () => {
|
||||
fs.mkdirSync(path.dirname(getLegacyOpenAICompatProxySessionPath()), { recursive: true });
|
||||
fs.writeFileSync(getOpenAICompatProxyPidPath('ccg'), '123\n', 'utf8');
|
||||
|
||||
expect(listOpenAICompatProxyProfileNames()).toEqual(['ccg']);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user