mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 08:03:15 +00:00
fix: Set model recursion limit to 5k (#1234)
This commit is contained in:
parent
3405d145ac
commit
6579b84b74
1 changed files with 2 additions and 1 deletions
|
|
@ -195,6 +195,7 @@ DEFAULT_LLM_MODEL_ID = "openai:gpt-5.5"
|
|||
DEFAULT_LLM_REASONING: OpenAIReasoning = {"effort": "medium"}
|
||||
DEFAULT_LLM_MAX_TOKENS = 64_000
|
||||
DEFAULT_RECURSION_LIMIT = 9_999
|
||||
MODEL_CALL_RECURSION_LIMIT = 5_000 # ~half the recursion limit to account for tool calls
|
||||
|
||||
|
||||
async def get_agent(config: RunnableConfig) -> Pregel:
|
||||
|
|
@ -328,7 +329,7 @@ async def get_agent(config: RunnableConfig) -> Pregel:
|
|||
backend=sandbox_backend,
|
||||
middleware=[
|
||||
SanitizeToolInputsMiddleware(),
|
||||
ModelCallLimitMiddleware(run_limit=60, exit_behavior="end"),
|
||||
ModelCallLimitMiddleware(run_limit=MODEL_CALL_RECURSION_LIMIT, exit_behavior="end"),
|
||||
ToolErrorMiddleware(),
|
||||
check_message_queue_before_model,
|
||||
ensure_no_empty_msg,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue