Merge pull request #71 from dj-oyu/fix/close-wait-requests

fix: wait for in-flight LLM requests in Close()
This commit is contained in:
dj-oyu 2026-03-20 20:25:35 +09:00 committed by GitHub
commit 65db89214e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -619,6 +619,9 @@ func (al *AgentLoop) Stop() {
// and dirty session data). Should be called during graceful shutdown.
func (al *AgentLoop) Close() {
// Wait for in-flight LLM requests to finish before releasing resources.
al.activeRequests.Wait()
al.closeExt()
mcpManager := al.mcp.takeManager()