Release empty registry agent state
This commit is contained in:
parent
6ef1fe52e0
commit
1b934c43f4
|
|
@ -71,6 +71,11 @@ func (r *Registry) Unload(agentID, name string) error {
|
|||
}
|
||||
|
||||
delete(agentTools, name)
|
||||
if len(agentTools) == 0 {
|
||||
delete(r.agents, agentID)
|
||||
delete(r.revisions, agentID)
|
||||
return nil
|
||||
}
|
||||
r.revisions[agentID]++
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -286,13 +286,9 @@ Completion notifications now use the toolsrv run context with a ten-second timeo
|
|||
|
||||
### M14. Toolsrv registry retains abandoned agent state
|
||||
|
||||
**Evidence:** `cmd/toolsrv/internal/registry/registry.go:15-19,47-75`.
|
||||
**Status:** Fixed in the working tree.
|
||||
|
||||
`Load` creates per-agent tool and revision maps. `Unload` removes tools but never removes empty agent maps or revision entries.
|
||||
|
||||
**Impact:** transient or deleted agent identifiers accumulate in long-lived toolsrv processes.
|
||||
|
||||
**Remediation:** delete empty agent state when an agent is unloaded.
|
||||
`Unload` now removes the per-agent tool map and revision entry when the final tool is removed. Empty agent state no longer accumulates in long-lived toolsrv processes.
|
||||
|
||||
### M15. `DismissProc` and process GC can lose cleanup ownership
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue