feat(multi-review): 添加全局 session 清理兜底#115
Conversation
Add a module-level activeSessions Set in orchestrator.ts to track all live sessions. Expose cleanupAllSessions() to delete any sessions that are still in the set. In index.ts: - Call cleanupAllSessions() in the finally block before server.close() to ensure no session leaks even if individual finally blocks were skipped (e.g. unhandled rejection before reaching them). - Register SIGTERM/SIGINT handlers for best-effort graceful cleanup when the runner kills the process (e.g. GitHub Actions timeout). This provides a second line of defense on top of per-session finally blocks added in the previous fix.
|
无遗漏 PR 标题和 body 描述的三个要求均已完整实现:
所有 session 创建路径( |
|
评审综合报告 最终决策:可合并 四位 reviewer 均无阻塞项,代码整体质量合格。所有发现的改进点均为建议性质。 阻塞项:无 建议项:
📋 各 Reviewer 详细审查结果quality可合并 该 PR 为 multi-review 工具增加了 graceful shutdown 支持,通过追踪活跃 session 并在收到 SIGTERM/SIGINT 时进行清理。 实现正确,错误处理完善(所有删除操作都包裹在 try-catch 中并忽略错误)。信号处理中使用 阻塞项:无 建议项:
security安全无虞 该 PR 仅添加了优雅关闭的信号处理逻辑和活跃会话追踪,不涉及任何用户输入处理、认证授权变更或敏感数据暴露。会话 ID 来自 API 响应(服务端生成),不存在注入风险。改动范围有限且无安全影响。 阻塞项:无 performance性能有疑虑 该 PR 添加了优雅关闭的 session 清理机制,核心逻辑无严重性能问题,但存在以下非关键性改进空间。 阻塞项:无 建议项:
architecture架构有疑虑 该 PR 为 multi-review 模块添加了信号处理优雅关闭机制,整体改动集中在 阻塞项:无 建议项:
|

在 orchestrator.ts 中维护模块级 activeSessions Set,跟踪所有存活 session。index.ts 中:
作为之前 per-session finally 修复的第二道防线。