sycommon-python-lib 0.2.12a10__py3-none-any.whl → 0.2.12a12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sycommon/agent/deep_agent.py +30 -9
- sycommon/agent/multi_agent_team.py +13 -9
- sycommon/devchat/handler.py +5 -2
- {sycommon_python_lib-0.2.12a10.dist-info → sycommon_python_lib-0.2.12a12.dist-info}/METADATA +1 -1
- {sycommon_python_lib-0.2.12a10.dist-info → sycommon_python_lib-0.2.12a12.dist-info}/RECORD +8 -8
- {sycommon_python_lib-0.2.12a10.dist-info → sycommon_python_lib-0.2.12a12.dist-info}/WHEEL +0 -0
- {sycommon_python_lib-0.2.12a10.dist-info → sycommon_python_lib-0.2.12a12.dist-info}/entry_points.txt +0 -0
- {sycommon_python_lib-0.2.12a10.dist-info → sycommon_python_lib-0.2.12a12.dist-info}/top_level.txt +0 -0
sycommon/agent/deep_agent.py
CHANGED
|
@@ -81,6 +81,23 @@ MAX_ARGS_BUFFER_BYTES = int(os.environ.get("DEEP_AGENT_MAX_ARGS_BUFFER", 1024 *
|
|
|
81
81
|
# 需 >= _match_summary_prefix_overlap 的 min_overlap(20) 且覆盖典型复述开头。
|
|
82
82
|
_DEFENSE4_PROBE_CHARS = int(os.environ.get("DEEP_AGENT_DEFENSE4_PROBE", 120))
|
|
83
83
|
|
|
84
|
+
|
|
85
|
+
def _is_punct_only(s: str) -> bool:
|
|
86
|
+
"""reasoning chunk 是否只含标点/空白(如 "." 续思考占位 token)。
|
|
87
|
+
|
|
88
|
+
思考型模型的思考流里常有单个标点的 chunk,原样转发会在前端渲染成
|
|
89
|
+
「已思考: .」空块。字母/数字/汉字任一出现即 False(一句话里的符号
|
|
90
|
+
不受影响——只有整 chunk 全是标点/空白才过滤)。与 Go 侧
|
|
91
|
+
deep_agent.go isPunctuationOnly 同语义。
|
|
92
|
+
"""
|
|
93
|
+
import unicodedata
|
|
94
|
+
for ch in s:
|
|
95
|
+
cat = unicodedata.category(ch)
|
|
96
|
+
# P* = 标点(含中文标点),Zs/Zl/Zp = 空白分隔;Cc 覆盖 \n\t 等
|
|
97
|
+
if not (cat.startswith("P") or cat.startswith("Z") or cat == "Cc"):
|
|
98
|
+
return False
|
|
99
|
+
return True
|
|
100
|
+
|
|
84
101
|
if TYPE_CHECKING:
|
|
85
102
|
from deepagents.graph import CompiledStateGraph
|
|
86
103
|
from langchain.agents.middleware.types import AgentState, ContextT, ModelRequest, ModelResponse, ResponseT
|
|
@@ -749,15 +766,19 @@ class DeepAgent:
|
|
|
749
766
|
)
|
|
750
767
|
if reasoning_content:
|
|
751
768
|
ai_text_content += reasoning_content
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
769
|
+
# 纯标点/空白 chunk(如 "." 续思考占位 token)不发射:
|
|
770
|
+
# 单独成块在前端就是一行「已思考: .」噪音;仍计入
|
|
771
|
+
# ai_text_content(空响应判定依据)与流完整性。
|
|
772
|
+
if not _is_punct_only(reasoning_content):
|
|
773
|
+
event = ChatEventBuilder.ai_chunk(
|
|
774
|
+
reasoning_content,
|
|
775
|
+
id=getattr(msg, "id", None),
|
|
776
|
+
agent=DEFAULT_AGENT_NAME,
|
|
777
|
+
)
|
|
778
|
+
event.data["reasoning"] = True
|
|
779
|
+
if on_event:
|
|
780
|
+
await on_event(event)
|
|
781
|
+
yield event
|
|
761
782
|
|
|
762
783
|
# 处理 tool_call_chunks(流式分片逐步到达,args 是字符串片段)
|
|
763
784
|
tool_call_chunks = getattr(msg, "tool_call_chunks", [])
|
|
@@ -353,15 +353,19 @@ class MultiAgentTeam:
|
|
|
353
353
|
)
|
|
354
354
|
)
|
|
355
355
|
if reasoning_content:
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
356
|
+
# 纯标点/空白 chunk("." 占位 token)不发射,同
|
|
357
|
+
# deep_agent._is_punct_only 语义。
|
|
358
|
+
from sycommon.agent.deep_agent import _is_punct_only
|
|
359
|
+
if not _is_punct_only(reasoning_content):
|
|
360
|
+
event = ChatEventBuilder.ai_chunk(
|
|
361
|
+
reasoning_content,
|
|
362
|
+
id=getattr(msg, "id", None),
|
|
363
|
+
agent=current_agent,
|
|
364
|
+
)
|
|
365
|
+
event.data["reasoning"] = True
|
|
366
|
+
if on_event:
|
|
367
|
+
await on_event(event)
|
|
368
|
+
yield event
|
|
365
369
|
|
|
366
370
|
tool_calls = getattr(msg, "tool_calls", [])
|
|
367
371
|
|
sycommon/devchat/handler.py
CHANGED
|
@@ -77,7 +77,10 @@ class DevchatConfig:
|
|
|
77
77
|
restartSelf: Optional[Callable[[], Any]] = None
|
|
78
78
|
corsOrigins: List[str] = field(default_factory=list)
|
|
79
79
|
maxHistory: int = 500
|
|
80
|
-
|
|
80
|
+
# 单次 claude 任务最长运行时间(秒)。默认 1 小时:30 分钟对真实开发
|
|
81
|
+
# 任务太短,到点硬杀致任务白跑(Go 侧 #589000 同因;与 Go
|
|
82
|
+
# devchat.options.commandTimeout 默认值保持一致)。
|
|
83
|
+
commandTimeoutSec: float = 3600.0
|
|
81
84
|
loginSessionTTL: int = 0 # 登录会话 TTL 秒;0 = 默认 7 天
|
|
82
85
|
|
|
83
86
|
@classmethod
|
|
@@ -102,7 +105,7 @@ class DevchatConfig:
|
|
|
102
105
|
with contextlib.suppress(Exception):
|
|
103
106
|
cfg.maxHistory = int(raw.get("maxHistory") or 500)
|
|
104
107
|
with contextlib.suppress(Exception):
|
|
105
|
-
cfg.commandTimeoutSec = float(raw.get("commandTimeoutSec") or
|
|
108
|
+
cfg.commandTimeoutSec = float(raw.get("commandTimeoutSec") or 3600.0)
|
|
106
109
|
with contextlib.suppress(Exception):
|
|
107
110
|
cfg.loginSessionTTL = int(raw.get("loginSessionTTL") or raw.get("login_session_ttl") or 0)
|
|
108
111
|
return cfg
|
|
@@ -137,8 +137,8 @@ sycommon/services.py,sha256=bGwsfKnm2CYNquesAJUqVu31kn5JXZmHvfjGkP0tjvA,31090
|
|
|
137
137
|
sycommon/agent/__init__.py,sha256=mxceAeUifQ-DKvWp7ZEJIFlmOCb5wpYHPGQw3rwEN8I,4378
|
|
138
138
|
sycommon/agent/agent_manager.py,sha256=6GpQHk2PBX4UvvyosGKXtGkuEc5Jh0gi1iZqbyXjg04,18833
|
|
139
139
|
sycommon/agent/chat_events.py,sha256=t7qWa6OrIWLfqtd1AnqaVP67QWkn1JxpCBTZYQpoLuM,14226
|
|
140
|
-
sycommon/agent/deep_agent.py,sha256=
|
|
141
|
-
sycommon/agent/multi_agent_team.py,sha256=
|
|
140
|
+
sycommon/agent/deep_agent.py,sha256=5RWhVQ4f6gO7rHmFS3uKDN7e-Oog66_ePjjdCN5NT94,93905
|
|
141
|
+
sycommon/agent/multi_agent_team.py,sha256=TxcQRSXHWnPnAsQfzcaHRXcaLZy1mtIHpXvK6QGtJcA,35110
|
|
142
142
|
sycommon/agent/reasoning_content_patch.py,sha256=HZ_If0qVDHlz_b1mDT3tuTqbExhzRVhP4VgsoDt0JLc,3945
|
|
143
143
|
sycommon/agent/resume_compactor.py,sha256=CJp3AUqeStr8U2JeWP31DyulomXZdrkLL4kVtLxnwn8,20849
|
|
144
144
|
sycommon/agent/skills_retry_patch.py,sha256=syDXFpnz8dVV4tCbJXc3XxLCUab8uePfbKfvE8Fmo44,4566
|
|
@@ -217,7 +217,7 @@ sycommon/database/txnref.py,sha256=sOFp85PlanCA0oryVpHu53JbM0aSHAVkELWgEJKalLI,7
|
|
|
217
217
|
sycommon/devchat/__init__.py,sha256=Z2BgzDKrp_mR165d3a1kftP8lf1-WKz_5xuZMFXR-iw,2288
|
|
218
218
|
sycommon/devchat/_page.html,sha256=CxzEhC867FawFjlEKk6uCChEX3EoRP4jwdn09C_MdaU,29126
|
|
219
219
|
sycommon/devchat/_page.py,sha256=4y2h9DEJfL07zIKDhdSNEaN1Rpe-yJsKm7H0QnqZC9o,2404
|
|
220
|
-
sycommon/devchat/handler.py,sha256=
|
|
220
|
+
sycommon/devchat/handler.py,sha256=ZlslyAxDvxYhjzQWqvqLoj7WaPMSSfB6yj27vbVW9bc,50641
|
|
221
221
|
sycommon/devchat/login.py,sha256=TF57n0iP3jHgiYs4NdDDgAXlGJNtiKcW8haw9Rd9Jjo,7701
|
|
222
222
|
sycommon/devchat/store.py,sha256=iAxCJs5jrNbRDCVL4i0QnbEAUGLXtJumf8YsBGwfBe0,4047
|
|
223
223
|
sycommon/devchat/tasks.py,sha256=ijGHe2gyBfEZ11ylqvRihQDtbF2ugchQ6AzdyNCbD_0,19080
|
|
@@ -404,8 +404,8 @@ sycommon/tools/usercache.py,sha256=Zu2oiXISUOojleEYCAS9t06ZzgWSNHCIhCjv4yTtkRw,4
|
|
|
404
404
|
sycommon/xxljob/__init__.py,sha256=7eoBlQxv-B39IfRSCY2bkqdGYs1QRe1umAWd88VMEEM,86
|
|
405
405
|
sycommon/xxljob/sharding.py,sha256=LJ0tle7qSUS32S5ntjzri1aOcPzwL5CFde3W4Rf1AUE,2560
|
|
406
406
|
sycommon/xxljob/xxljob_service.py,sha256=1yifwIBNGsCIxLnQjHKiBlbsigc_zvPH-dMTZcNxe-Q,7649
|
|
407
|
-
sycommon_python_lib-0.2.
|
|
408
|
-
sycommon_python_lib-0.2.
|
|
409
|
-
sycommon_python_lib-0.2.
|
|
410
|
-
sycommon_python_lib-0.2.
|
|
411
|
-
sycommon_python_lib-0.2.
|
|
407
|
+
sycommon_python_lib-0.2.12a12.dist-info/METADATA,sha256=hpmvEAe7lam_KxEK2nqN5UxJHVayxIm5ji02LZGBv-I,8029
|
|
408
|
+
sycommon_python_lib-0.2.12a12.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
409
|
+
sycommon_python_lib-0.2.12a12.dist-info/entry_points.txt,sha256=gsR4SssKxDWjRU8ggidzNcdMXDPRSKRS7UaGyNP84Qg,92
|
|
410
|
+
sycommon_python_lib-0.2.12a12.dist-info/top_level.txt,sha256=RgphKrg7nJyZ7irJqbxFr-5H2LUYTvI7ivoWZH2hcD0,29
|
|
411
|
+
sycommon_python_lib-0.2.12a12.dist-info/RECORD,,
|
|
File without changes
|
{sycommon_python_lib-0.2.12a10.dist-info → sycommon_python_lib-0.2.12a12.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{sycommon_python_lib-0.2.12a10.dist-info → sycommon_python_lib-0.2.12a12.dist-info}/top_level.txt
RENAMED
|
File without changes
|