mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-15 08:16:50 +00:00
feat(targets,management): instrument adapter spawn lifecycle and instance manager
Each target adapter (claude, codex, droid) now emits dispatch on child spawn and respond on child exit with latencyMs. instance-manager emits lifecycle events for instance create / start / stop so multi-instance flows are traceable per requestId. Refs #1141, #1138
This commit is contained in:
1 parent
1ff4329ee4
commit
8afee344e1
4 files changed
+70
No files matched your search
@@ -13,6 +13,9 @@ import ProfileContextSyncLock from './profile-context-sync-lock';
|
||||
import { DEFAULT_ACCOUNT_CONTEXT_MODE } from '../auth/account-context';
|
||||
import type { AccountContextPolicy } from '../auth/account-context';
|
||||
import { getCcsDir, getCcsHome } from '../utils/config-manager';
|
||||
import { createLogger } from '../services/logging';
|
||||
|
||||
const logger = createLogger('management:instance-manager');
|
||||
|
||||
const MANAGED_MCP_SERVER_NAMES = new Set(['ccs-websearch', 'ccs-image-analysis', 'ccs-browser']);
|
||||
|
||||
@@ -52,6 +55,10 @@ class InstanceManager {
|
||||
await this.contextSyncLock.withLock(profileName, async () => {
|
||||
// Lazy initialization
|
||||
if (!fs.existsSync(instancePath)) {
|
||||
logger.stage('route', 'instance.init', 'Initializing new profile instance', {
|
||||
profile: profileName,
|
||||
bare: options.bare === true,
|
||||
});
|
||||
this.initializeInstance(profileName, instancePath, options);
|
||||
}
|
||||
|
||||
@@ -170,6 +177,9 @@ class InstanceManager {
|
||||
}
|
||||
|
||||
fs.rmSync(instancePath, { recursive: true, force: true });
|
||||
logger.stage('cleanup', 'instance.deleted', 'Profile instance deleted', {
|
||||
profile: profileName,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user