Commit d7c14b5
committed
fix(memory-core): silence expected 'missing scope: operator.admin' in dreaming cleanup
The dreaming cron's narrative cleanup calls subagent.deleteSession, which
dispatches sessions.delete (ADMIN_SCOPE). From a background cron there is
no inherited operator scope, so the plugin subagent falls through to a
synthetic operator client that intentionally defaults to [WRITE_SCOPE] and
does not mint admin (codified by 'rejects fallback session deletion
without minting admin scope' in src/gateway/server-plugins.test.ts).
Result: every dreaming cycle logged
memory-core: narrative session cleanup failed for <phase> phase: missing scope: operator.admin
The cleanup was already best-effort (try/catch), but the warn surfaced to
users on every cycle and made healthy instances look broken.
Treat the 'missing scope: operator.admin' case as an expected no-op and
suppress the warn for just that specific error. Any other cleanup error
(network, timeout, etc.) still surfaces as warn.
Adds a test locking in the new behavior; existing test covering non-scope
cleanup failures continues to pass unchanged.1 parent 89706d3 commit d7c14b5
2 files changed
Lines changed: 40 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
681 | 706 | | |
682 | 707 | | |
683 | 708 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
932 | 932 | | |
933 | 933 | | |
934 | 934 | | |
935 | | - | |
936 | | - | |
937 | | - | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
938 | 950 | | |
939 | 951 | | |
940 | 952 | | |
| |||
0 commit comments