Skip to content

fix(memory-core): downgrade narrative cleanup WARN to debug for missing-scope errors#68312

Closed
1aifanatic wants to merge 1 commit into
openclaw:mainfrom
1aifanatic:fix/memory-core-cleanup-scope-warn-68074
Closed

fix(memory-core): downgrade narrative cleanup WARN to debug for missing-scope errors#68312
1aifanatic wants to merge 1 commit into
openclaw:mainfrom
1aifanatic:fix/memory-core-cleanup-scope-warn-68074

Conversation

@1aifanatic

Copy link
Copy Markdown

Summary

  • deleteSession during dreaming narrative cleanup fails with missing scope: operator.admin when the cron session lacks admin permissions
  • This is expected best-effort behavior, but the warn log fires on every dreaming cycle, flooding the logs
  • Fix: detect /missing scopes?:/i in the error message and log at debug level instead of warn
  • Added optional debug field to the local Logger type so callers without a debug method compile cleanly

Test plan

  • missing scope: operator.admin error → logger.debug called, logger.warn not called for cleanup
  • Other errors (e.g. "still active") → logger.warn still called as before
  • Dreaming cycle logs are quiet when operator.admin scope is absent

deleteSession during dreaming cleanup fails with "missing scope:
operator.admin" when the cron session lacks admin permissions.
This is expected best-effort behavior, but logged at WARN, which floods
logs after every dreaming cycle.

Downgrade to debug when the error matches /missing scopes?:/i.
Also add optional debug field to the Logger type so callers without
a debug method (like dreaming-phases) compile cleanly.
@greptile-apps

greptile-apps Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR narrows the log level for deleteSession permission failures during dreaming narrative cleanup from warn to debug, preventing log flooding during cron-driven dreaming cycles that lack operator.admin scope. The implementation is small and targeted: a regex check on the error message routes missing-scope errors to an optional debug method, with the existing warn path preserved for all other failures. Tests cover both the new path and the existing warn path.

Confidence Score: 5/5

Safe to merge — all remaining findings are P2 or lower, no correctness or reliability concerns.

The change is narrow and correct: regex matches the specific error format, optional chaining on debug is intentional for callers without a debug method, and the test covers both branches. No logic, data integrity, or security concerns.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(memory-core): suppress WARN for narr..." | Re-trigger Greptile

@prtags

prtags Bot commented Apr 23, 2026

Copy link
Copy Markdown

Related work from PRtags group ultimate-chow-4ei0

Title: Open PR duplicate: [Bug]: memory-core: narrative session cleanup fails with "missing scope: operator.admin"

Number Title
#68020 fix(memory-core): silence expected operator.admin scope miss in dreaming cleanup
#68087 fix(memory-core): downgrade cleanup warning to debug when missing operator.admin scope
#68130 fix: reduce log level for narrative session cleanup scope failures
#68312* fix(memory-core): downgrade narrative cleanup WARN to debug for missing-scope errors
#68681 fix(memory-core): suppress expected dreaming cleanup scope warnings

* This PR

@clawsweeper

clawsweeper Bot commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

Closing this as duplicate or superseded after Codex automated review.

PR #68312 is a duplicate of the open maintainer-tracked PR #68020. Both target the same memory-core dreaming cleanup warning: suppress expected missing scope: operator.admin cleanup noise while preserving warnings for real cleanup failures. Current main still has the pre-change warn path, so this is not implemented-on-main; the remaining review should stay on #68020.

Best possible solution:

Close #68312 as a duplicate and keep the remaining product/code review on #68020, the open MEMBER-authored, maintainer-labeled canonical PR for this memory-core cleanup-warning behavior.

What I checked:

So I’m closing this here and keeping the remaining discussion on the canonical linked item.

Codex Review notes: model gpt-5.5, reasoning high; reviewed against d54d2d6b9b8a.

@clawsweeper clawsweeper Bot closed this Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant