From d4e5ecd4974b0f8f197e8efa222ff46eae5c0a20 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Wed, 15 Apr 2026 12:29:09 +0800 Subject: [PATCH] fix: compatible with Python 3.7 by deferring Literal import in truncate.py --- agent/tools/utils/truncate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agent/tools/utils/truncate.py b/agent/tools/utils/truncate.py index c2ed0f65..4a6ff8ae 100644 --- a/agent/tools/utils/truncate.py +++ b/agent/tools/utils/truncate.py @@ -8,7 +8,10 @@ Truncation is based on two independent limits - whichever is hit first wins: Never returns partial lines (except bash tail truncation edge case). """ -from typing import Dict, Any, Optional, Literal, Tuple +from __future__ import annotations +from typing import Dict, Any, Optional, Tuple, TYPE_CHECKING +if TYPE_CHECKING: + from typing import Literal DEFAULT_MAX_LINES = 2000