fix(memory-core): suppress expected dreaming cleanup scope warnings#68681
fix(memory-core): suppress expected dreaming cleanup scope warnings#68681christnorman wants to merge 1 commit into
Conversation
Greptile SummarySuppresses the expected Confidence Score: 5/5Safe to merge — the only finding is a minor style concern about string-based error matching. The change is small and correctly targeted. Existing and new tests cover both the suppressed and non-suppressed paths. No behavior changes outside log noise reduction. The single P2 comment about regex fragility vs. typed error codes is non-blocking. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/memory-core/src/dreaming-narrative.ts
Line: 116-118
Comment:
**String-pattern matching for error suppression is fragile**
`isExpectedNarrativeCleanupScopeError` matches against the human-readable error message rather than a typed error code or class. If the upstream session layer ever changes its error message format (e.g. `"scope missing: operator.admin"` or `"insufficient scope: operator.admin"`), the suppression silently stops working and warning noise returns — or the pattern might match unintended errors.
Consider checking `extractErrorCode(err)` for a stable scope-error code first (the same pattern used in `isRequestScopedSubagentRuntimeError`), and falling back to the regex only if no typed code is available. A brief comment noting the fragility and why no code exists would also help future readers.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(memory-core): suppress expected drea..." | Re-trigger Greptile |
14657ae to
173ce22
Compare
|
Related work from PRtags group Title: Open PR duplicate: [Bug]: memory-core: narrative session cleanup fails with "missing scope: operator.admin"
|
|
Closing this as duplicate or superseded after Codex automated review. #68681 is duplicate/superseded by the open maintainer-owned canonical PR #68020 for the same memory-core dreaming cleanup Best possible solution: Close #68681 as duplicate/superseded and keep the remaining product fix under maintainer PR #68020. When finishing the canonical fix, carry over the useful parts from #68681: preserve gateway error codes, suppress only the expected missing-admin cleanup warning, keep other cleanup failures visible, and retain the least-privilege synthetic runtime 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. |
Summary
Describe the problem and fix in 2–5 bullets:
missing scope: operator.adminduring synthetic plugin-runtime cleanup.missing scope: operator.adminand add regression coverage indreaming-narrative.test.ts.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write
N/A. If the cause is unclear, writeUnknown.deleteSession()and logged any resulting error, even when synthetic plugin runtime scope is intentionally not allowed to perform admin-scoped session deletion.missing scope: operator.admincleanup path as non-actionable noise.Regression Test Plan (if applicable)
For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write
N/A.User-visible / Behavior Changes
List user-visible changes (including defaults/config).
If none, write
None.Diagram (if applicable)
For UI changes or non-trivial logic flows, include a small ASCII diagram reviewers can scan quickly. Otherwise write
N/A.Security Impact (required)
Yes/No)Yes/No)Yes/No)Yes/No)Yes/No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No)Yes/No)Yes/No)Risks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.