MCPcopy Create free account
hub / github.com/compozy/agh / canReuse

Method canReuse

internal/workspace/resolver.go:325–346  ·  view source on GitHub ↗
(ws Workspace, snapshots map[string]filesnap.Snapshot)

Source from the content-addressed store, hash-verified

323}
324
325func (c *cachedEntry) canReuse(ws Workspace, snapshots map[string]filesnap.Snapshot) bool {
326 if c == nil {
327 return false
328 }
329 if !filesnap.Equal(c.snapshots, snapshots) {
330 return false
331 }
332 if strings.TrimSpace(c.workspace.DefaultAgent) != strings.TrimSpace(ws.DefaultAgent) {
333 return false
334 }
335 if strings.TrimSpace(c.workspace.SandboxRef) != strings.TrimSpace(ws.SandboxRef) {
336 return false
337 }
338 if strings.TrimSpace(c.workspace.RootDir) != strings.TrimSpace(ws.RootDir) {
339 return false
340 }
341 if !slices.Equal(c.workspace.AdditionalDirs, ws.AdditionalDirs) {
342 return false
343 }
344
345 return true
346}
347
348func (r *Resolver) evictExpiredLocked(now time.Time) {
349 cutoff := now.Add(-r.cacheTTL)

Callers 1

ResolveMethod · 0.80

Calls 1

EqualFunction · 0.92

Tested by

no test coverage detected