agentscope-ai / agentscope-ai/agentscope-java

[Feature]: Agui mode does not expose sessionId during agent execution, preventing saveTo / session persistence

未關閉
#751 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area/ext/integration enhancement
主要語言
Java
星號
5.6k
分支
1.3k
平均合併
4 天 12 小時
30 天內合併 PR
77

描述

## Title

Agui mode does not expose sessionId during agent execution, preventing saveTo / session persistence

## Is your feature request related to a problem? Please describe.

In Agui mode, we need to persist agent conversation state (e.g. messages / memory) using the existing AgentScope session mechanism.

However, during the agent execution lifecycle in Agui, there is currently no way to obtain the `sessionId` (or `SessionKey` / `threadId`) required for `agent.saveTo(...)` or other session persistence operations.

Although it is possible to access the `Agent` instance from certain hooks, the lack of session context makes it impossible to correctly save or restore conversation history.

This prevents message persistence and session-based state recovery when running agents through Agui.

## Describe the solution you'd like

We would like Agui to expose or propagate the session context during agent execution, for example:

- Provide access to `sessionId` / `threadId` / `SessionKey` in Agui hooks
- Or offer an official extension point in Agui to perform session persistence (e.g. `saveTo`)
- Or pass session-related metadata together with the `Agent` instance during execution

This would allow Agui-based executions to integrate cleanly with AgentScope’s existing Session / Memory persistence mechanisms.

## Describe alternatives you've considered

- Triggering `saveTo` manually inside hooks using the `Agent` instance
→ Not feasible because `sessionId` is not available

- Managing a separate persistence mechanism outside of AgentScope
→ Causes duplication and breaks consistency with the existing Session design

## Additional context

Currently, message saving and loading works correctly when using AgentScope directly, but not when running agents through Agui.

Supporting session persistence in Agui would enable:
- Multi-turn conversation continuity
- Proper memory loading and saving
- Better alignment between Agui and AgentScope core session behavior

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。