fix(ralph-loop): dispatch after message inheritance fallback
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -83,6 +83,7 @@ export async function injectContinuationPrompt(
|
|||||||
let agent: string | undefined
|
let agent: string | undefined
|
||||||
let model: { providerID: string; modelID: string; variant?: string } | undefined
|
let model: { providerID: string; modelID: string; variant?: string } | undefined
|
||||||
let tools: Record<string, boolean | "allow" | "deny" | "ask"> | undefined
|
let tools: Record<string, boolean | "allow" | "deny" | "ask"> | undefined
|
||||||
|
let canCheckPromptGateToolState = true
|
||||||
const sourceSessionID = options.inheritFromSessionID ?? options.sessionID
|
const sourceSessionID = options.inheritFromSessionID ?? options.sessionID
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -107,6 +108,7 @@ export async function injectContinuationPrompt(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
canCheckPromptGateToolState = false
|
||||||
const messageDir = getMessageDir(sourceSessionID)
|
const messageDir = getMessageDir(sourceSessionID)
|
||||||
const currentMessage = messageDir ? findNearestMessageWithFields(messageDir) : null
|
const currentMessage = messageDir ? findNearestMessageWithFields(messageDir) : null
|
||||||
agent = currentMessage?.agent
|
agent = currentMessage?.agent
|
||||||
@@ -138,6 +140,7 @@ export async function injectContinuationPrompt(
|
|||||||
source: "ralph-loop",
|
source: "ralph-loop",
|
||||||
settleMs: options.idleSettleMs,
|
settleMs: options.idleSettleMs,
|
||||||
queueBehavior: "defer",
|
queueBehavior: "defer",
|
||||||
|
checkToolState: canCheckPromptGateToolState,
|
||||||
input: {
|
input: {
|
||||||
path: { id: options.sessionID },
|
path: { id: options.sessionID },
|
||||||
body: {
|
body: {
|
||||||
|
|||||||
Reference in New Issue
Block a user