fix: make sessionExists() SQLite-aware for session_read tool

sessionExists() relied on JSON message directories which don't exist on
SQLite. Return true on SQLite and let readSessionMessages() handle lookup.
Also add empty-messages fallback in session_read for graceful not-found.
This commit is contained in:
YeonGyu-Kim
2026-02-15 19:06:46 +09:00
parent 52161ef69f
commit a25b35c380
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -76,6 +76,10 @@ export function createSessionManagerTools(ctx: PluginInput): Record<string, Tool
let messages = await readSessionMessages(args.session_id)
if (messages.length === 0) {
return `Session not found: ${args.session_id}`
}
if (args.limit && args.limit > 0) {
messages = messages.slice(0, args.limit)
}