Revert "Update src/auto-reply/reply/session.ts"

This reverts commit 93599cb1872a4063261e7c8c664bd5adbe31b047.
This commit is contained in:
Saurabh 2026-03-20 22:50:09 +05:30
parent 93599cb187
commit ce8f0c2de1

View File

@ -558,7 +558,6 @@ export async function initSessionState(params: {
},
);
// When a session is auto-reset (idle timeout or daily reset), emit a
// When a session is auto-reset (idle timeout or daily reset), emit a
// session:reset internal hook so the session-memory hook can persist
// the outgoing session context — just as it does for manual /new and /reset.
@ -566,6 +565,17 @@ export async function initSessionState(params: {
// the handler reads it, getRecentSessionContentWithResetFallback() will
// locate it via the .reset.* sibling naming convention.
if (isNewSession && !resetTriggered && previousSessionEntry) {
const workspaceDir = resolveAgentWorkspaceDir(cfg, agentId);
const autoResetEvent = createInternalHookEvent("session", "reset", sessionKey, {
sessionEntry,
previousSessionEntry,
commandSource: "auto-reset",
workspaceDir,
cfg,
});
void triggerInternalHook(autoResetEvent).catch((err) => {
log.debug("session:reset hook error (auto-reset)", { error: String(err) });
});
}
// Archive old transcript so it doesn't accumulate on disk (#14869).