Conversation
7 tasks
…upt conversations Agent-Logs-Url: https://github.com/adamd9/delegate1/sessions/869cb696-86e1-4431-952b-aeee98f8eb0c Co-authored-by: adamd9 <4033496+adamd9@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add arbiter agent for memory retrieval interruptions
Add arbiter agent to gate memory retrieval interruptions
Apr 1, 2026
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.
Memory retrieval currently interrupts conversations (via shadow turns) automatically whenever new memories arrive, leading to poorly-timed or excessive interruptions. This adds a lightweight
MemoryArbitercomponent that decides allow/deny/defer before any interruption fires.New:
src/memory/arbiter.tsStateless decision engine with three ordered policies:
"safety","billing") bypasses all other rulesrateLimitMs(default 30 s); returnssuggestedDelayMsconfidenceThreshold(default 0.5); score =min(1, newItemCount / 3)Config:
MemoryConfig(persisted inmemory-config.json, tunable via/memory-configAPI)arbiter_enabledfalsearbiter_rate_limit_ms30000arbiter_confidence_threshold0.5arbiter_priority_tags["safety","billing","urgent","critical"]Integration:
MemoryModule.retrieveWithLate()newMemoriesreturn value and the asynconLateArrivalcallbackmemory_arbiterDB events (metadata only — no memory content in logs)clearCache()Tests:
tests/unit/memory-arbiter.test.ts10 unit tests covering allow, deny, rate-limit, priority-tag override, case-insensitive tag matching, zero items, reset, live reconfigure, and rapid-call suppression. Runnable via
npm run test:arbiter.