Skip to content

fix(harness): isolate memory flush and maintenance throttles - #2993

Open
guslegend0510 wants to merge 2 commits into
agentscope-ai:mainfrom
guslegend0510:codex/fix-2982-memory-trigger-isolation
Open

fix(harness): isolate memory flush and maintenance throttles#2993
guslegend0510 wants to merge 2 commits into
agentscope-ai:mainfrom
guslegend0510:codex/fix-2982-memory-trigger-isolation

Conversation

@guslegend0510

Copy link
Copy Markdown
Contributor

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:

  • 16 new regression cases fail before the fix and pass afterward.
  • Core: 2,318 tests, 0 failures/errors, 9 skipped.
  • Harness: 935 tests, 0 failures/errors, 5 skipped.
  • Spotless and git diff --check pass.

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.

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

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@CryoThrust

Copy link
Copy Markdown

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 FlushTrigger.never() boundary are also now explicit in both language docs.

I did not find a blocking issue in the current patch. The remaining merge gate is maintainer review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants