fix(ultrawork): add iteration cap to prevent infinite loops
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -2,5 +2,6 @@ export const HOOK_NAME = "ralph-loop"
|
||||
export const DEFAULT_STATE_FILE = ".sisyphus/ralph-loop.local.md"
|
||||
export const COMPLETION_TAG_PATTERN = /<promise>(.*?)<\/promise>/is
|
||||
export const DEFAULT_MAX_ITERATIONS = 100
|
||||
export const ULTRAWORK_MAX_ITERATIONS = 500
|
||||
export const DEFAULT_COMPLETION_PROMISE = "DONE"
|
||||
export const ULTRAWORK_VERIFICATION_PROMISE = "VERIFIED"
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
DEFAULT_COMPLETION_PROMISE,
|
||||
DEFAULT_MAX_ITERATIONS,
|
||||
HOOK_NAME,
|
||||
ULTRAWORK_MAX_ITERATIONS,
|
||||
ULTRAWORK_VERIFICATION_PROMISE,
|
||||
} from "./constants"
|
||||
import { clearState, incrementIteration, readState, writeState } from "./storage"
|
||||
@@ -36,7 +37,7 @@ export function createLoopStateController(options: {
|
||||
active: true,
|
||||
iteration: 1,
|
||||
max_iterations: loopOptions?.ultrawork
|
||||
? undefined
|
||||
? ULTRAWORK_MAX_ITERATIONS
|
||||
: loopOptions?.maxIterations ??
|
||||
config?.default_max_iterations ??
|
||||
DEFAULT_MAX_ITERATIONS,
|
||||
|
||||
Reference in New Issue
Block a user