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:
YeonGyu-Kim
2026-04-08 13:22:41 +09:00
parent 8090ee6afe
commit 14f4390a34
2 changed files with 3 additions and 1 deletions
@@ -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,