feat(proxy,chat): add per-task/schedule/chat proxy pool routing and @task mentions

- Support pool auto-rotation mode alongside inherit/direct/node/custom proxy routes across gateway and MITM proxy
- Add GET /api/proxy/routes/{scope}/{owner_id}, task create/DTO proxy_route, and schedule proxy persistence + propagation
- Add list_proxy_pool and set_task_proxy chat agent tools and @task mention search/context injection
- Wire shared proxy/pool selectors into tasks, schedules, chat sandbox popover, and container routes UI
This commit is contained in:
ji ruo committed 2026-12-03 00:10:50 +08:00
1 parent b18cf89b77
commit 778e49317d
28 files changed
+1683 -124

No files matched your search

+28
View File
@@ -259,6 +259,34 @@ func (m *Manager) proxyPoolEntries() []proxyPoolEntry {
return append([]proxyPoolEntry(nil), m.proxyPool.entries...)
}
// ActivePoolRawURL returns the active (or first available enabled) proxy pool entry ID and raw URL.
func (m *Manager) ActivePoolRawURL() (string, string) {
if m == nil || m.proxyPool == nil {
return "", ""
}
m.proxyPool.mu.Lock()
defer m.proxyPool.mu.Unlock()
if len(m.proxyPool.entries) == 0 {
return "", ""
}
for _, e := range m.proxyPool.entries {
if e.ID == m.proxyPool.active && e.Enabled && strings.TrimSpace(e.RawURL) != "" {
return e.ID, strings.TrimSpace(e.RawURL)
}
}
for _, e := range m.proxyPool.entries {
if e.Enabled && e.Health != "unhealthy-cooling" && strings.TrimSpace(e.RawURL) != "" {
return e.ID, strings.TrimSpace(e.RawURL)
}
}
for _, e := range m.proxyPool.entries {
if e.Enabled && strings.TrimSpace(e.RawURL) != "" {
return e.ID, strings.TrimSpace(e.RawURL)
}
}
return "", ""
}
func (m *Manager) setProxyPoolEntries(entries []proxyPoolEntry, active string) error {
if m.proxyPool == nil {
m.proxyPool = &proxyPoolState{}