fix: execute all-complete reaction and guard workspace postCreate
- summary.all_complete reactions now execute in pollAll() after emission - workspace.postCreate errors trigger workspace cleanup to prevent leaks Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
2ecb011982
commit
4a804503b6
|
|
@ -446,6 +446,15 @@ export function createLifecycleManager(deps: LifecycleManagerDeps): LifecycleMan
|
|||
});
|
||||
eventBus.emit(event);
|
||||
emitToHandlers(event);
|
||||
|
||||
// Execute all-complete reaction if configured
|
||||
const reactionKey = eventToReactionKey("summary.all_complete");
|
||||
if (reactionKey) {
|
||||
const reactionConfig = config.reactions[reactionKey];
|
||||
if (reactionConfig && reactionConfig.auto !== false && reactionConfig.action) {
|
||||
await executeReaction(event, reactionKey, reactionConfig as ReactionConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// Poll cycle failed — will retry next interval
|
||||
|
|
|
|||
|
|
@ -184,9 +184,18 @@ export function createSessionManager(deps: SessionManagerDeps): SessionManager {
|
|||
});
|
||||
workspacePath = wsInfo.path;
|
||||
|
||||
// Run post-create hooks
|
||||
// Run post-create hooks — clean up workspace on failure
|
||||
if (plugins.workspace.postCreate) {
|
||||
try {
|
||||
await plugins.workspace.postCreate(wsInfo, project);
|
||||
} catch (err) {
|
||||
try {
|
||||
await plugins.workspace.destroy(workspacePath);
|
||||
} catch {
|
||||
/* best effort */
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue