fix: make sessionExists() async with SDK verification on SQLite

sessionExists() previously returned unconditional true on SQLite,
preventing ralph-loop orphaned-session cleanup from triggering.
Now uses sdkClient.session.messages() to verify session actually
exists. Callers updated to await the async result.

Addresses Cubic review feedback on PR #1837.
This commit is contained in:
YeonGyu-Kim
2026-02-15 19:23:05 +09:00
parent d0870d6fbe
commit e720a6cc26
4 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ export function createSessionManagerTools(ctx: PluginInput): Record<string, Tool
},
execute: async (args: SessionReadArgs, _context) => {
try {
if (!sessionExists(args.session_id)) {
if (!(await sessionExists(args.session_id))) {
return `Session not found: ${args.session_id}`
}