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:
@@ -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}`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user