fix(memory-v3): address Codex review on #31990 (slow-lane consolidate + positive interval)#32019
Merged
Merged
Conversation
- Classify memory_v3_consolidate as a slow LLM job (it hands off to a background agent for up to 15 min like memory_v2_consolidate); leaving it in the fast lane broke lane isolation when memory.v3.write.enabled is on. - Constrain memory.v3.write.consolidateIntervalMs to positive: 0/negative made the scheduler's `now - lastRun >= interval` always true, flooding the queue. - Tests for both.
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.
Summary
Addresses the two actionable Codex comments on #31990 (merged):
memory_v3_consolidatetoSLOW_LLM_JOB_TYPES. It hands off to a background agent for up to 15 min (likememory_v2_consolidate); in the fast lane it could starve short jobs oncememory.v3.write.enabledis on. The mechanical v3 jobs (memory_v3_index_maintenance,memory_v3_edge_learning) intentionally stay fast.memory.v3.write.consolidateIntervalMsto.positive().0/negative mademaybeEnqueueGraphMaintenanceJobs'now - lastRun >= intervalalways true, enqueuing a consolidation every worker pass.Both paths are still flag-gated (
memory.v3.write.enableddefaults off), so this only matters once the v3 write path is switched on — but the guards belong in now.Test plan
bun testjobs-store-job-classes + memory-v2 schema (48 pass)bunx tsc --noEmit,bun run lint, prettier cleanFollow-up to #31990.