mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-17 00:14:50 +00:00
feat(browser): add timeout, idle auto-close, and max-pages safety mechanisms
Prevent resource leaks and hanging actions in the browser tool: - Per-action context timeout (default 30s, configurable via timeoutMs param or config) - Idle page reaper goroutine closes pages unused for 10min (configurable) - Max pages per tenant (default 5) with LRU eviction - RefStore cleanup on page close/evict/reap to prevent memory leaks
This commit is contained in:
1 parent
afbecd3e4c
commit
ee4d34ae28
8 files changed
+226
-12
No files matched your search
@@ -81,6 +81,14 @@ func NormalizeRef(raw string) string {
|
||||
return s
|
||||
}
|
||||
|
||||
// Remove deletes all refs for a target.
|
||||
func (rs *RefStore) Remove(targetID string) {
|
||||
rs.mu.Lock()
|
||||
defer rs.mu.Unlock()
|
||||
rs.removeFromOrder(targetID)
|
||||
delete(rs.entries, targetID)
|
||||
}
|
||||
|
||||
func (rs *RefStore) removeFromOrder(targetID string) {
|
||||
for i, id := range rs.order {
|
||||
if id == targetID {
|
||||
|
||||
Reference in new issue
Block a user