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
- Enable memory-core with dreaming feature
- Wait for narrative generation to complete (light/rem/deep phases)
- 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
dreaming-narrative-CRZ-WfHg.js:595 calls params.subagent.deleteSession({ sessionKey })
- This triggers an HTTP request to gateway's
/session-kill-http endpoint
- The endpoint requires
operator.admin scope via authorizeOperatorScopesForMethod('sessions.delete', requestedScopes)
- 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.
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
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.adminThis error repeats every minute for each phase (light, rem, deep).
Root cause analysis
dreaming-narrative-CRZ-WfHg.js:595callsparams.subagent.deleteSession({ sessionKey })/session-kill-httpendpointoperator.adminscope viaauthorizeOperatorScopesForMethod('sessions.delete', requestedScopes)operator.admin, causing 403 errorsImpact
Suggested fix
The
sessions.deletemethod should be accessible to session owners without requiringoperator.admin, similar to howsessions.abortworks. Alternatively, memory-core should use a different session deletion mechanism.