fix: wait for in-flight LLM requests in Close()
Add activeRequests.Wait() at the start of Close() so graceful shutdown waits for any running llmWorkerNormal to finish before releasing resources (sessions, MCP, stats). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
39b4b475e9
commit
c15f9dd7a6
1 changed files with 3 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue