fix(harness): isolate memory flush and maintenance throttles - #2993
fix(harness): isolate memory flush and maintenance throttles#2993guslegend0510 wants to merge 2 commits into
Conversation
Give flush and maintenance distinct periodic gate keys so either task can claim its own window. Preserve first-call eligibility and document the independent trigger semantics for issue agentscope-ai#2982. Add 16 regression cases across local/store-backed gates, isolation scopes, and trigger orders. Existing store-backed throttle entries use the old shared key; each new task key starts a fresh window after upgrade.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
I reviewed the current diff and the throttle contract looks coherent. Prefixing the operation into the composite key isolates flush and maintenance for both local and store-backed gates, while preserving scope isolation; the parameterized matrix covers both execution orders and middleware reconstruction. The upgrade note is important: old shared keys are intentionally not migrated, so each operation gets a fresh window after upgrade. That matches the documented semantics and avoids treating a historical shared timestamp as either operation's successful run. The first-call behavior and I did not find a blocking issue in the current patch. The remaining merge gate is maintainer review. |
…-trigger-isolation
THROTTLED memory flush and background maintenance share the same periodic gate key, so either operation can suppress the other even though they have separate configured intervals.
This change gives each operation a distinct key prefix and adds regression coverage for local/store-backed gates, all isolation scopes, and both execution orders.
It also clarifies first-call behavior in MemoryConfig and the English/Chinese documentation: minimum gaps limit subsequent runs; they do not delay the first eligible call. FlushTrigger.never() only disables per-call flush.
Validation:
Upgrade note: existing store-backed entries use the old shared key. Each new operation key starts a fresh throttle window after upgrade.
Related to #2982.