fix(ralph-loop): settle idle before continuation
This commit is contained in:
@@ -22,6 +22,7 @@ export interface RalphLoopHook {
|
||||
}
|
||||
|
||||
const DEFAULT_API_TIMEOUT = 5000 as const
|
||||
const DEFAULT_IDLE_SETTLE_MS = 150 as const
|
||||
|
||||
function getMessageCountFromResponse(messagesResponse: unknown): number {
|
||||
if (Array.isArray(messagesResponse)) {
|
||||
@@ -44,6 +45,7 @@ export function createRalphLoopHook(
|
||||
const stateDir = config?.state_dir
|
||||
const getTranscriptPath = options?.getTranscriptPath ?? getDefaultTranscriptPath
|
||||
const apiTimeout = options?.apiTimeout ?? DEFAULT_API_TIMEOUT
|
||||
const idleSettleMs = options?.idleSettleMs ?? DEFAULT_IDLE_SETTLE_MS
|
||||
const checkSessionExists = options?.checkSessionExists
|
||||
const backgroundManager = options?.backgroundManager
|
||||
|
||||
@@ -56,6 +58,7 @@ export function createRalphLoopHook(
|
||||
const event = createRalphLoopEventHandler(ctx, {
|
||||
directory: ctx.directory,
|
||||
apiTimeoutMs: apiTimeout,
|
||||
idleSettleMs,
|
||||
getTranscriptPath,
|
||||
checkSessionExists,
|
||||
backgroundManager,
|
||||
|
||||
Reference in New Issue
Block a user