Skip to content

memory-core: narrative session cleanup fails with missing scope: operator.admin #71133

@daxiali

Description

@daxiali

Description
memory-core plugin's narrative session cleanup fails with 'missing scope: operator.admin' error every minute during light/rem/deep phase cleanup cycles.

Steps to reproduce

  1. Enable memory-core with dreaming feature
  2. Wait for narrative generation to complete (light/rem/deep phases)
  3. Check logs: tail -f /tmp/openclaw/openclaw-*.log | grep 'narrative session cleanup'

Expected behavior
Subagent sessions created for narrative generation should be deleted without requiring operator.admin scope.

Actual behavior
memory-core: narrative session cleanup failed for {phase} phase: missing scope: operator.admin
This error repeats every minute for each phase (light, rem, deep).

Root cause analysis

  1. dreaming-narrative-CRZ-WfHg.js:595 calls params.subagent.deleteSession({ sessionKey })
  2. This triggers an HTTP request to gateway's /session-kill-http endpoint
  3. The endpoint requires operator.admin scope via authorizeOperatorScopesForMethod('sessions.delete', requestedScopes)
  4. The subagent's scoped session lacks operator.admin, causing 403 errors

Impact

  • Core memory-core functionality works fine (narrative generation succeeds)
  • Orphaned subagent sessions accumulate over time
  • Log noise (3 warnings per minute per workspace)

Suggested fix
The sessions.delete method should be accessible to session owners without requiring operator.admin, similar to how sessions.abort works. Alternatively, memory-core should use a different session deletion mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clawsweeperTracked by ClawSweeper automation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions