mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-16 04:18:17 +08:00
fix(memory): add success-path debug logs to MemoryLifecycleMediator
beforeLlmCall / afterLlmCall / onSessionEnd only logged on failure, making flag on/off indistinguishable in logs. Add debug lines on the success path so lifecycle activation is observable.
This commit is contained in:
parent
74928d615d
commit
907c6eff8c
@ -44,6 +44,8 @@ public class MemoryLifecycleMediator {
|
|||||||
try {
|
try {
|
||||||
String context = memoryManager.prefetchAll(ctx.agentId(), ctx.userQuery());
|
String context = memoryManager.prefetchAll(ctx.agentId(), ctx.userQuery());
|
||||||
events.publishEvent(new TurnStartedEvent(ctx));
|
events.publishEvent(new TurnStartedEvent(ctx));
|
||||||
|
log.debug("[Memory] beforeLlmCall: agent={}, contextLen={}", ctx.agentId(),
|
||||||
|
context != null ? context.length() : 0);
|
||||||
return context;
|
return context;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.debug("[Memory] beforeLlmCall failed (non-fatal): {}", e.getMessage());
|
log.debug("[Memory] beforeLlmCall failed (non-fatal): {}", e.getMessage());
|
||||||
@ -61,6 +63,8 @@ public class MemoryLifecycleMediator {
|
|||||||
memoryManager.syncAll(ctx.agentId(), ctx.conversationId(),
|
memoryManager.syncAll(ctx.agentId(), ctx.conversationId(),
|
||||||
ctx.userQuery(), assistantReply);
|
ctx.userQuery(), assistantReply);
|
||||||
events.publishEvent(new TurnCompletedEvent(ctx, assistantReply));
|
events.publishEvent(new TurnCompletedEvent(ctx, assistantReply));
|
||||||
|
log.debug("[Memory] afterLlmCall: agent={}, conv={}, replyLen={}", ctx.agentId(),
|
||||||
|
ctx.conversationId(), assistantReply != null ? assistantReply.length() : 0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.debug("[Memory] afterLlmCall failed (non-fatal): {}", e.getMessage());
|
log.debug("[Memory] afterLlmCall failed (non-fatal): {}", e.getMessage());
|
||||||
}
|
}
|
||||||
@ -72,6 +76,7 @@ public class MemoryLifecycleMediator {
|
|||||||
public void onSessionEnd(Long agentId, String conversationId) {
|
public void onSessionEnd(Long agentId, String conversationId) {
|
||||||
try {
|
try {
|
||||||
memoryManager.onSessionEnd(agentId, conversationId);
|
memoryManager.onSessionEnd(agentId, conversationId);
|
||||||
|
log.debug("[Memory] onSessionEnd: agent={}, conv={}", agentId, conversationId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.debug("[Memory] onSessionEnd dispatch failed (non-fatal): {}", e.getMessage());
|
log.debug("[Memory] onSessionEnd dispatch failed (non-fatal): {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user