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

Method memoryCallerActorKind

internal/daemon/native_tools.go:5315–5339  ·  view source on GitHub ↗
(
	ctx context.Context,
	scope toolspkg.Scope,
	req toolspkg.CallRequest,
)

Source from the content-addressed store, hash-verified

5313}
5314
5315func (n *daemonNativeTools) memoryCallerActorKind(
5316 ctx context.Context,
5317 scope toolspkg.Scope,
5318 req toolspkg.CallRequest,
5319) (nativeMemoryActorKind, error) {
5320 if actorKind := normalizeNativeMemoryActorKind(firstNonEmpty(req.ActorKind, scope.ActorKind)); actorKind != "" {
5321 return actorKind, nil
5322 }
5323 sessionID := strings.TrimSpace(firstNonEmpty(req.SessionID, scope.SessionID))
5324 if sessionID == "" || n == nil || n.deps == nil || n.deps.Sessions == nil {
5325 return nativeMemoryActorKind(""), nil
5326 }
5327 info, err := n.deps.Sessions.Status(ctx, sessionID)
5328 if err != nil {
5329 return nativeMemoryActorKind(""), fmt.Errorf(
5330 "daemon: resolve memory tool caller session %q: %w",
5331 sessionID,
5332 err,
5333 )
5334 }
5335 if info != nil && info.Lineage != nil && strings.TrimSpace(info.Lineage.ParentSessionID) != "" {
5336 return nativeMemoryActorKindSubagent, nil
5337 }
5338 return nativeMemoryActorKindRoot, nil
5339}
5340
5341func (n *daemonNativeTools) denySubagentMemoryWrite(
5342 ctx context.Context,

Callers 2

memoryProposeMethod · 0.95
memoryNoteMethod · 0.95

Calls 4

nativeMemoryActorKindTypeAlias · 0.85
firstNonEmptyFunction · 0.70
StatusMethod · 0.65

Tested by

no test coverage detected