[5db9054b] Bound the in-memory learning notification queue in learning.py (cap growth; optional prune-on-ack) - #1119
Open
roboco-app[bot] wants to merge 4 commits into
Conversation
added 2 commits
September 27, 2026 21:38
…ue maxlen + prune-on-ack The queue grew monotonically in the orchestrator process (one entry per notified agent per learning; nothing in production acks so nothing was ever removed). Switch _notification_queue to a deque with a 256-entry maxlen so appends evict the oldest entries, and prune acknowledged entries inside acknowledge_notification. Public signatures of get_pending_notifications / acknowledge_notification are unchanged; _fetch_notify_agents fanout logic untouched. NotificationTable rows from _persist_notifications remain the durable record. Queue-lifecycle coverage added in tests/unit/services/test_learning.py: cap eviction of oldest entries, prune-on-ack behavior, and unchanged pending filtering. tests/integration/test_learning_service.py is deliberately untouched (owned by a sibling leaf).
|
Thanks for opening your first pull request on RoboCo! Quick checklist before review (most of these are enforced by CI, but worth a glance):
See CONTRIBUTING.md for the full workflow and the Code of Conduct for the community standards we follow. Welcome aboard — a maintainer will review shortly. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VERIFIED INTAKE FACTS (forwarded from upstream; anchors re-verified by be-pm on this branch, all current):
DESIGN CALL (made by be-pm, recorded in the cell decision journal): BOUND the queue — a deque with maxlen, or cap+trim in _enqueue_in_memory, so appends beyond the cap evict the OLDEST entries. You MAY additionally prune acknowledged entries inside acknowledge_notification (cheap honesty for the public API). Queue REMOVAL is ruled out this round: tests/integration/test_learning_service.py still reads svc._notification_queue in 8 other places outside your scope (a sibling leaf owns that file in parallel) — removal would break its tests. Evicting oldest pending entries is safe: the NotificationTable rows from _persist_notifications remain the durable record, and nothing in production reads the in-memory queue.
HARD CONSTRAINTS: