fix(ralph-loop): use inherited fallback context and SDK TUI session selection

This commit is contained in:
YeonGyu-Kim
2026-02-21 02:42:59 +09:00
parent 817292c87a
commit 4a4e9dc862
2 changed files with 34 additions and 27 deletions
@@ -30,9 +30,9 @@ export async function injectContinuationPrompt(
let agent: string | undefined
let model: { providerID: string; modelID: string } | undefined
let tools: Record<string, boolean | "allow" | "deny" | "ask"> | undefined
const sourceSessionID = options.inheritFromSessionID ?? options.sessionID
try {
const sourceSessionID = options.inheritFromSessionID ?? options.sessionID
const messagesResp = await withTimeout(
ctx.client.session.messages({
path: { id: sourceSessionID },
@@ -54,7 +54,7 @@ export async function injectContinuationPrompt(
}
}
} catch {
const messageDir = getMessageDir(options.sessionID)
const messageDir = getMessageDir(sourceSessionID)
const currentMessage = messageDir ? findNearestMessageWithFields(messageDir) : null
agent = currentMessage?.agent
model =