Skip to content

fix issue #1160#1177

Open
xuhuafeifei wants to merge 2 commits intoagentscope-ai:mainfrom
xuhuafeifei:fix_issue_1160
Open

fix issue #1160#1177
xuhuafeifei wants to merge 2 commits intoagentscope-ai:mainfrom
xuhuafeifei:fix_issue_1160

Conversation

@xuhuafeifei
Copy link
Copy Markdown
Contributor

AgentScope-Java Version

io.agentscope:agentscope-parent:pom:1.0.12-SNAPSHOT

Description

LongTermMemory will block the agent when the LLM stops responding. This commit enables the framework to record long term memory asynchronously.

Added longTermMemoryAsyncRecord option to ReActAgent.Builder to support fire-and-forget long-term memory recording in STATIC_CONTROL / BOTH mode.

When enabled, the StaticLongTermMemoryHook performs record() asynchronously without blocking the agent's response, reducing latency in STATIC_CONTROL mode. Agent-controlled recording (AGENT_CONTROL) remains synchronous.

Checklist

Please check the following items before code is ready to be reviewed.

  • ReActAgent.Builder — new longTermMemoryAsyncRecord(boolean) setter

  • StaticLongTermMemoryHook — overloaded constructor accepting asyncRecord flag; handlePostCall() splits sync/async paths

  • StaticLongTermMemoryHookTest — added 3 async recording test cases

  • Code has been formatted with mvn spotless:apply

  • All tests are passing (mvn test)

  • Javadoc comments are complete and follow project conventions

  • Related documentation has been updated (e.g. links, examples, etc.)

  • Code is ready for review

@xuhuafeifei xuhuafeifei requested a review from a team April 9, 2026 11:08
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

1 participant