mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-09-30 09:13:14 +00:00
- Root cause: LLM occasionally generates strings like '1, 80' or '170, "limit": 60' for integer fields, causing a Pydantic ValidationError and wasting an LLM turn - Change: add SanitizeToolInputsMiddleware in agent/middleware/sanitize_tool_inputs.py that extracts the leading integer from any string value in offset/limit before the call reaches Pydantic validation; registered before ToolErrorMiddleware in server.py - Verified: 14 unit tests covering all three production trace patterns pass Co-authored-by: LangSmith Forge <forge-agent@langsmith.ai> Co-authored-by: Johannes du Plessis <johannes@langchain.dev>
15 lines
533 B
Python
15 lines
533 B
Python
from .check_message_queue import check_message_queue_before_model
|
|
from .ensure_no_empty_msg import ensure_no_empty_msg
|
|
from .notify_step_limit import notify_step_limit_reached
|
|
from .open_pr import open_pr_if_needed
|
|
from .sanitize_tool_inputs import SanitizeToolInputsMiddleware
|
|
from .tool_error_handler import ToolErrorMiddleware
|
|
|
|
__all__ = [
|
|
"SanitizeToolInputsMiddleware",
|
|
"ToolErrorMiddleware",
|
|
"check_message_queue_before_model",
|
|
"ensure_no_empty_msg",
|
|
"notify_step_limit_reached",
|
|
"open_pr_if_needed",
|
|
]
|