feat(*): 云端 Agent - 增强画布上下文读取并接入 Gemini 缓存

This commit is contained in:
ddcat666 committed 2026-09-26 02:21:47 +08:00
1 parent 2ce50bbb9d
commit 2cedc4c66b
35 files changed
+1927 -266

No files matched your search

+5 -1
View File
@@ -34,6 +34,9 @@ type Service struct {
storageTestMu sync.Mutex
workerRuntimeMu sync.Mutex
agentSchedulerMu sync.Mutex
agentSchedulerWake chan struct{}
taskDispatcherWake chan struct{}
geminiCacheLockMu sync.Mutex
agentSchedulerCursor string
agentConflictStreak map[string]int
activeStorageTests map[string]bool
@@ -66,6 +69,7 @@ type Service struct {
concurrencyReadCache *platform.BoundedReadCache[string, platform.RuntimeTaskPolicy]
textReplayReadCache *platform.BoundedReadCache[textReplayCacheKey, *TextReplayResult]
routeVersionReadCache *platform.BoundedReadCache[string, int64]
geminiCacheLocks map[string]*geminiCacheKeyLock
routeCatalogRetryAt time.Time
routeCatalogRefreshError error
skills *skills.Service
@@ -113,7 +117,7 @@ func newService(repo *repository.Repository, dataDir string) *Service {
paymentRegistry = dynamic
}
}
service := &Service{repo: repo, dataDir: dataDir, activeStorageTests: make(map[string]bool), activeCancels: make(map[string]context.CancelFunc), agentConflictStreak: make(map[string]int), coordinator: coordinator, runtimeErr: err, pluginRuntime: pluginRuntime, pluginRuntimeErr: pluginRuntimeErr, paymentRegistry: paymentRegistry, workerID: newID(), routeCatalogTTL: 30 * time.Second, routeCatalogMaxStale: 5 * time.Minute, routeHealthBlocked: make(map[string]time.Time)}
service := &Service{repo: repo, dataDir: dataDir, activeStorageTests: make(map[string]bool), activeCancels: make(map[string]context.CancelFunc), agentConflictStreak: make(map[string]int), agentSchedulerWake: make(chan struct{}, 1), taskDispatcherWake: make(chan struct{}, 1), coordinator: coordinator, runtimeErr: err, pluginRuntime: pluginRuntime, pluginRuntimeErr: pluginRuntimeErr, paymentRegistry: paymentRegistry, workerID: newID(), routeCatalogTTL: 30 * time.Second, routeCatalogMaxStale: 5 * time.Minute, routeHealthBlocked: make(map[string]time.Time), geminiCacheLocks: make(map[string]*geminiCacheKeyLock)}
service.taskBillingCoordinator = newTaskBillingCoordinator(service.repo)
service.taskTerminalCoordinator = newTaskTerminalCoordinator(service)
service.taskRouteExecutor = newTaskRouteExecutor(service)