Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Add CLI options to configure framework services#1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -111,6 +111,9 @@ start_http_adapter() { | ||||||
| fi | ||||||
| } | ||||||
| # Reconstruct SERVICE_ARGS array from env var | ||||||
| SERVICE_ARGS=($SERVICE_ARGS_STR) | ||||||
CopilotAI | ||||||
| SERVICE_ARGS=($SERVICE_ARGS_STR) | |
| read -ra SERVICE_ARGS<<<"$SERVICE_ARGS_STR" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -40,6 +40,26 @@ const CODING_DIR = path.resolve(SCRIPT_DIR, '..'); | ||||||||||||||||
| const execAsync = promisify(exec); | ||||||||||||||||
| const psm = new ProcessStateManager(); | ||||||||||||||||
| // Parse CLI arguments for service control | ||||||||||||||||
| const args = process.argv.slice(2); | ||||||||||||||||
| const SERVICE_FLAGS = { | ||||||||||||||||
| skipVkb: args.includes('--no-vkb'), | ||||||||||||||||
| skipConstraints: args.includes('--no-constraints'), | ||||||||||||||||
| skipTranscript: args.includes('--no-transcript'), | ||||||||||||||||
| skipLogging: args.includes('--no-logging'), | ||||||||||||||||
| skipHealth: args.includes('--no-health') | ||||||||||||||||
| }; | ||||||||||||||||
| if (Object.values(SERVICE_FLAGS).some(Boolean)) { | ||||||||||||||||
| console.log('🔧 Service Configuration:'); | ||||||||||||||||
| if (SERVICE_FLAGS.skipVkb) console.log(' - VKB Server disabled (--no-vkb)'); | ||||||||||||||||
| if (SERVICE_FLAGS.skipConstraints) console.log(' - Constraint Monitor disabled (--no-constraints)'); | ||||||||||||||||
| if (SERVICE_FLAGS.skipTranscript) console.log(' - Transcript Monitor disabled (--no-transcript)'); | ||||||||||||||||
| if (SERVICE_FLAGS.skipLogging) console.log(' - Live Logging disabled (--no-logging)'); | ||||||||||||||||
| if (SERVICE_FLAGS.skipHealth) console.log(' - Health Monitoring disabled (--no-health)'); | ||||||||||||||||
| console.log(''); | ||||||||||||||||
| } | ||||||||||||||||
| // Service configurations | ||||||||||||||||
| const SERVICE_CONFIGS = { | ||||||||||||||||
| transcriptMonitor: { | ||||||||||||||||
| @@ -504,46 +524,54 @@ async function startAllServices() { | ||||||||||||||||
| console.log('📋 Starting REQUIRED services (Live Logging System)...'); | ||||||||||||||||
| console.log(''); | ||||||||||||||||
| try { | ||||||||||||||||
| const transcriptResult = await startServiceWithRetry( | ||||||||||||||||
| SERVICE_CONFIGS.transcriptMonitor.name, | ||||||||||||||||
| SERVICE_CONFIGS.transcriptMonitor.startFn, | ||||||||||||||||
| SERVICE_CONFIGS.transcriptMonitor.healthCheckFn, | ||||||||||||||||
| { | ||||||||||||||||
| required: SERVICE_CONFIGS.transcriptMonitor.required, | ||||||||||||||||
| maxRetries: SERVICE_CONFIGS.transcriptMonitor.maxRetries, | ||||||||||||||||
| timeout: SERVICE_CONFIGS.transcriptMonitor.timeout | ||||||||||||||||
| } | ||||||||||||||||
| ); | ||||||||||||||||
| results.successful.push(transcriptResult); | ||||||||||||||||
| await registerWithPSM(transcriptResult, 'scripts/enhanced-transcript-monitor.js'); | ||||||||||||||||
| } catch (error) { | ||||||||||||||||
| results.failed.push({ | ||||||||||||||||
| serviceName: SERVICE_CONFIGS.transcriptMonitor.name, | ||||||||||||||||
| error: error.message, | ||||||||||||||||
| required: true | ||||||||||||||||
| }); | ||||||||||||||||
| if (!SERVICE_FLAGS.skipTranscript) { | ||||||||||||||||
| try { | ||||||||||||||||
| const transcriptResult = await startServiceWithRetry( | ||||||||||||||||
| SERVICE_CONFIGS.transcriptMonitor.name, | ||||||||||||||||
| SERVICE_CONFIGS.transcriptMonitor.startFn, | ||||||||||||||||
| SERVICE_CONFIGS.transcriptMonitor.healthCheckFn, | ||||||||||||||||
| { | ||||||||||||||||
| required: SERVICE_CONFIGS.transcriptMonitor.required, | ||||||||||||||||
| maxRetries: SERVICE_CONFIGS.transcriptMonitor.maxRetries, | ||||||||||||||||
| timeout: SERVICE_CONFIGS.transcriptMonitor.timeout | ||||||||||||||||
| } | ||||||||||||||||
| ); | ||||||||||||||||
| results.successful.push(transcriptResult); | ||||||||||||||||
| await registerWithPSM(transcriptResult, 'scripts/enhanced-transcript-monitor.js'); | ||||||||||||||||
| } catch (error) { | ||||||||||||||||
| results.failed.push({ | ||||||||||||||||
| serviceName: SERVICE_CONFIGS.transcriptMonitor.name, | ||||||||||||||||
| error: error.message, | ||||||||||||||||
| required: true | ||||||||||||||||
| }); | ||||||||||||||||
| } | ||||||||||||||||
| } else { | ||||||||||||||||
| console.log('⏭️ Skipping Transcript Monitor (--no-transcript)'); | ||||||||||||||||
| } | ||||||||||||||||
Comment on lines
+527
to
550
CopilotAI | ||||||||||||||||
| try { | ||||||||||||||||
| const coordinatorResult = await startServiceWithRetry( | ||||||||||||||||
| SERVICE_CONFIGS.liveLoggingCoordinator.name, | ||||||||||||||||
| SERVICE_CONFIGS.liveLoggingCoordinator.startFn, | ||||||||||||||||
| SERVICE_CONFIGS.liveLoggingCoordinator.healthCheckFn, | ||||||||||||||||
| { | ||||||||||||||||
| required: SERVICE_CONFIGS.liveLoggingCoordinator.required, | ||||||||||||||||
| maxRetries: SERVICE_CONFIGS.liveLoggingCoordinator.maxRetries, | ||||||||||||||||
| timeout: SERVICE_CONFIGS.liveLoggingCoordinator.timeout | ||||||||||||||||
| } | ||||||||||||||||
| ); | ||||||||||||||||
| results.successful.push(coordinatorResult); | ||||||||||||||||
| await registerWithPSM(coordinatorResult, 'scripts/live-logging-coordinator.js'); | ||||||||||||||||
| } catch (error) { | ||||||||||||||||
| results.failed.push({ | ||||||||||||||||
| serviceName: SERVICE_CONFIGS.liveLoggingCoordinator.name, | ||||||||||||||||
| error: error.message, | ||||||||||||||||
| required: true | ||||||||||||||||
| }); | ||||||||||||||||
| if (!SERVICE_FLAGS.skipLogging) { | ||||||||||||||||
| try { | ||||||||||||||||
| const coordinatorResult = await startServiceWithRetry( | ||||||||||||||||
| SERVICE_CONFIGS.liveLoggingCoordinator.name, | ||||||||||||||||
| SERVICE_CONFIGS.liveLoggingCoordinator.startFn, | ||||||||||||||||
| SERVICE_CONFIGS.liveLoggingCoordinator.healthCheckFn, | ||||||||||||||||
| { | ||||||||||||||||
| required: SERVICE_CONFIGS.liveLoggingCoordinator.required, | ||||||||||||||||
| maxRetries: SERVICE_CONFIGS.liveLoggingCoordinator.maxRetries, | ||||||||||||||||
| timeout: SERVICE_CONFIGS.liveLoggingCoordinator.timeout | ||||||||||||||||
| } | ||||||||||||||||
| ); | ||||||||||||||||
| results.successful.push(coordinatorResult); | ||||||||||||||||
| await registerWithPSM(coordinatorResult, 'scripts/live-logging-coordinator.js'); | ||||||||||||||||
| } catch (error) { | ||||||||||||||||
| results.failed.push({ | ||||||||||||||||
| serviceName: SERVICE_CONFIGS.liveLoggingCoordinator.name, | ||||||||||||||||
| error: error.message, | ||||||||||||||||
| required: true | ||||||||||||||||
| }); | ||||||||||||||||
| } | ||||||||||||||||
| } else { | ||||||||||||||||
| console.log('⏭️ Skipping Live Logging Coordinator (--no-logging)'); | ||||||||||||||||
CopilotAI | ||||||||||||||||
| console.log('⏭️ Skipping Live Logging Coordinator (--no-logging)'); | |
| if(SERVICE_CONFIGS.liveLoggingCoordinator.required){ | |
| console.error('❌ ERROR: Live Logging Coordinator is a REQUIRED service and cannot be skipped with --no-logging.'); | |
| process.exit(1); | |
| }else{ | |
| console.log('⏭️ Skipping Live Logging Coordinator (--no-logging)'); | |
| } |
CopilotAINov 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The array reconstruction
SERVICE_ARGS=($SERVICE_ARGS_STR)is missing quotes around the variable expansion. This can cause issues if SERVICE_ARGS_STR is empty or contains special characters. While the current use case (simple flag names) works, this is a bash anti-pattern.Recommendation: Use
read -ra SERVICE_ARGS <<< "$SERVICE_ARGS_STR"for safer array reconstruction, or quote the expansion asSERVICE_ARGS=("$SERVICE_ARGS_STR")if treating as a single element, or use proper array serialization if multiple elements with spaces are expected.