mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-23 21:59:14 +09:00
Checkpoint: File edits
Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-07T23:36:25Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
43b4be29a2
commit
120ceeec57
1 file changed
+36
-6
@@ -524,23 +524,53 @@ export class WorkerDaemon extends EventEmitter {
|
||||
* Run the actual worker logic
|
||||
*/
|
||||
private async runWorkerLogic(workerConfig: WorkerConfig): Promise<unknown> {
|
||||
// Check if this is a headless worker type and headless execution is available
|
||||
if (isHeadlessWorker(workerConfig.type) && this.headlessAvailable && this.headlessExecutor) {
|
||||
try {
|
||||
this.log('info', `Running ${workerConfig.type} in headless mode (Claude Code AI)`);
|
||||
const result = await this.headlessExecutor.execute(workerConfig.type as HeadlessWorkerType);
|
||||
return {
|
||||
mode: 'headless',
|
||||
...result,
|
||||
};
|
||||
} catch (error) {
|
||||
this.log('warn', `Headless execution failed for ${workerConfig.type}, falling back to local mode`);
|
||||
this.emit('headless:fallback', {
|
||||
type: workerConfig.type,
|
||||
error: error instanceof Error ? error.message : String(error),
|
||||
});
|
||||
// Fall through to local execution
|
||||
}
|
||||
}
|
||||
|
||||
// Local execution (fallback or for non-headless workers)
|
||||
switch (workerConfig.type) {
|
||||
case 'map':
|
||||
return this.runMapWorker();
|
||||
case 'audit':
|
||||
return this.runAuditWorker();
|
||||
return this.runAuditWorkerLocal();
|
||||
case 'optimize':
|
||||
return this.runOptimizeWorker();
|
||||
return this.runOptimizeWorkerLocal();
|
||||
case 'consolidate':
|
||||
return this.runConsolidateWorker();
|
||||
case 'testgaps':
|
||||
return this.runTestGapsWorker();
|
||||
return this.runTestGapsWorkerLocal();
|
||||
case 'predict':
|
||||
return this.runPredictWorker();
|
||||
return this.runPredictWorkerLocal();
|
||||
case 'document':
|
||||
return this.runDocumentWorker();
|
||||
return this.runDocumentWorkerLocal();
|
||||
case 'ultralearn':
|
||||
return this.runUltralearnWorkerLocal();
|
||||
case 'refactor':
|
||||
return this.runRefactorWorkerLocal();
|
||||
case 'deepdive':
|
||||
return this.runDeepdiveWorkerLocal();
|
||||
case 'benchmark':
|
||||
return this.runBenchmarkWorkerLocal();
|
||||
case 'preload':
|
||||
return this.runPreloadWorkerLocal();
|
||||
default:
|
||||
return { status: 'unknown worker type' };
|
||||
return { status: 'unknown worker type', mode: 'local' };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user