mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 12:13:59 +00:00
fix(cursor): harden stopDaemon PID validation, tighten regex, add lifecycle test
- Validate PID belongs to cursor daemon via /proc before signaling - Tighten detectProvider regex to avoid over-matching o-prefixed models - Add integration test for daemon start→health→stop lifecycle - Add void cast on discarded handleHelp() return value - Update model catalog date comment
This commit is contained in:
1 parent
934238740e
commit
760a5c3ca4
4 files changed
+38
-3
No files matched your search
@@ -137,6 +137,29 @@ describe('startDaemon', () => {
|
||||
expect(result.success).toBe(false);
|
||||
expect(result.error).toContain('Invalid port');
|
||||
});
|
||||
|
||||
it(
|
||||
'starts and stops daemon successfully',
|
||||
async () => {
|
||||
const port = 18765;
|
||||
const result = await startDaemon({ port, model: 'test' });
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.pid).toBeDefined();
|
||||
|
||||
// Verify health
|
||||
const running = await isDaemonRunning(port);
|
||||
expect(running).toBe(true);
|
||||
|
||||
// Stop
|
||||
const stopResult = await stopDaemon();
|
||||
expect(stopResult.success).toBe(true);
|
||||
|
||||
// Verify stopped
|
||||
const stillRunning = await isDaemonRunning(port);
|
||||
expect(stillRunning).toBe(false);
|
||||
},
|
||||
35000
|
||||
);
|
||||
});
|
||||
|
||||
describe('isDaemonRunning', () => {
|
||||
|
||||
Reference in new issue
Block a user