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

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Saurabh Mishra 2026-03-20 21:25:53 +05:30 committed by GitHub
parent f4903052b2
commit 93599cb187
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -558,6 +558,7 @@ 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.
@ -565,17 +566,6 @@ 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).