refactor(autocontext): expose async compression entry & remove redundant subscribeOn#1480
refactor(autocontext): expose async compression entry & remove redundant subscribeOn#1480guslegend0510 wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR refactors the scheduler offloading logic in the autocontext memory module. It removes redundant subscribeOn(Schedulers.boundedElastic()) from AutoContextHook.handlePreReasoning() and promotes compressIfNeededAsync() from package-private to public as the preferred entry point for reactive callers. The old data-driven async test is replaced with a thread-verification test. No unintended behavioral changes.
| } | ||
| } | ||
|
|
||
| private static final class RecordingAutoContextMemory extends AutoContextMemory { |
There was a problem hiding this comment.
[nit] RecordingAutoContextMemory is defined identically in both AutoContextHookTest and AutoContextMemoryTest. Consider extracting it to a shared test utility class.

说明
修复
AutoContextMemory在 WebFlux/reactive 执行链路中可能触发.block()阻塞 event-loop 的问题。变更
compressIfNeededAsync()暴露为public,作为 reactive 场景的推荐入口AutoContextHook直接调用异步压缩入口,避免额外调度干预测试
mvn -s codex-maven-settings.xml -pl agentscope-extensions/agentscope-extensions-autocontext-memory -am "-Dtest=AutoContextMemoryTest,AutoContextHookTest" test关联
AutoContextMemorycallsblock()during WebFlux reactive execution #1447