langchain-agentx-python 0.8.2__py3-none-any.whl → 0.8.4__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.
@@ -11,7 +11,7 @@ from langchain_agentx import create_loop_agent
11
11
  ```
12
12
  """
13
13
 
14
- __version__ = "0.8.2"
14
+ __version__ = "0.8.4"
15
15
 
16
16
  from .loop import ( # noqa: F401
17
17
  create_loop_agent,
@@ -17,6 +17,7 @@ LangChain AgentX agent 的图路由与条件边构建。
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
+ import logging
20
21
  from typing import Any, Callable, List, Tuple
21
22
 
22
23
  from langchain.agents.middleware.types import (
@@ -234,6 +235,20 @@ class LoopControllerEdge:
234
235
  withheld_result = self._handle_withheld_error(state)
235
236
  if withheld_result is not None:
236
237
  return withheld_result
238
+ # [位置2] 静默决策点日志:记录 loop_controller 的关键决策状态
239
+ _log = logging.getLogger(__name__)
240
+ _log.warning(
241
+ "[LOOP_CTRL] should_end=%s | terminal_reason=%s | step=%s | "
242
+ "finish_reason=%s | messages=%s | has_tool_calls=%s",
243
+ state.get("should_end"),
244
+ state.get("terminal_reason"),
245
+ state.get("step"),
246
+ state.get("finish_reason"),
247
+ len(state.get("messages", [])),
248
+ bool(state.get("messages") and
249
+ any(getattr(m, "tool_calls", None) for m in state.get("messages", [])
250
+ if hasattr(m, "tool_calls"))),
251
+ )
237
252
  if bool(state.get("should_end")):
238
253
  return self._handle_terminal(state)
239
254
  return self._handle_continue(state)
@@ -178,6 +178,14 @@ def _model_response_if_context_token_blocked(
178
178
  est = guard.estimate_messages_tokens(state_messages)
179
179
  if not guard.should_block(ContextCompactionContext(), estimated_tokens=est):
180
180
  return None
181
+ # [位置1] 静默阻塞日志:一旦触发 token 阻塞,日志里直接能看到
182
+ logger.warning(
183
+ "[BLOCKING] _model_response_if_context_token_blocked 触发!"
184
+ " estimated_tokens=%s | threshold=%s | message_count=%s",
185
+ est,
186
+ int(s.default_max_context_tokens * s.compaction_block_main_model_fraction),
187
+ len(state_messages),
188
+ )
181
189
  tw = guard.calculate_token_warning_state(state_messages)
182
190
  blocked_ai = AIMessage(
183
191
  content=(
@@ -566,6 +574,14 @@ class ModelNode(Runnable):
566
574
  state, last_ai_message, self._max_steps, self._max_turns
567
575
  )
568
576
  finish_reason = extract_finish_reason(last_ai_message)
577
+ # [位置3] 决策结果日志:记录 determine_should_end 的关键输出
578
+ logger.warning(
579
+ "[MODEL_DECISION] should_end=%s | terminal_reason=%s | finish_reason=%s | "
580
+ "last_ai_content=%s | step=%s",
581
+ should_end, terminal_reason, finish_reason,
582
+ str(getattr(last_ai_message, 'content', ''))[:200] if last_ai_message else 'None',
583
+ state.get("step", 0),
584
+ )
569
585
  self._log_stop_if_needed(
570
586
  should_end=should_end,
571
587
  terminal_reason=terminal_reason,
@@ -79,7 +79,8 @@ class LoopLoader:
79
79
  from langchain_agentx.tools.read import ReadRuntimeTool
80
80
  from langchain_agentx.tools.ripgrep_plugin_exclusions import PluginCacheGlobExclusions
81
81
  from langchain_agentx.tools.task_list.tool import TaskListRuntimeTool
82
- from langchain_agentx.tools.user_message import UserMessageTool
82
+ # UserMessageTool 暂时移除(待稳定后可能完全删除)
83
+ # from langchain_agentx.tools.user_message import UserMessageTool
83
84
  from langchain_agentx.tools.webfetch import loader as webfetch_loader
84
85
  from langchain_agentx.tools.websearch import loader as websearch_loader
85
86
  from langchain_agentx.tools.write import WriteRuntimeTool
@@ -132,7 +133,8 @@ class LoopLoader:
132
133
  )
133
134
  )
134
135
  self.register(BashRuntimeTool(state_bridge=shared_bridge))
135
- self.register(UserMessageTool())
136
+ # UserMessageTool 暂时移除(待稳定后可能完全删除)
137
+ # self.register(UserMessageTool())
136
138
  self.register(AskUserQuestionTool())
137
139
  self.register(TaskListRuntimeTool(config=cfg))
138
140
 
@@ -6,7 +6,7 @@
6
6
  P2(已完成):GrepRuntimeTool / GlobRuntimeTool — 只读搜索工具
7
7
  P3(进行中):WriteRuntimeTool;EditRuntimeTool — Phase 6 单测 + ``tools/`` 回归已跑通(需 ToolStateBridge + 先 Read)
8
8
  P4(已完成):BashRuntimeTool
9
- P1 用户交互(已完成):UserMessageTool — 用户可见消息(CC BriefTool
9
+ # P1 用户交互(已移除):UserMessageTool — 用户可见消息(CC BriefTool,因不确定性问题已移除)
10
10
  """
11
11
 
12
12
  from .agent import AgentRuntimeTool
@@ -16,9 +16,11 @@ from .grep import GrepRuntimeTool
16
16
  from .read import ReadRuntimeTool
17
17
  from .skill import SkillRuntimeTool
18
18
  from .edit import EditRuntimeTool
19
- from .user_message import UserMessageTool
20
19
  from .write import WriteRuntimeTool
21
20
 
21
+ # UserMessageTool 暂时移除(待稳定后可能完全删除)
22
+ # from .user_message import UserMessageTool
23
+
22
24
  __all__ = [
23
25
  "ReadRuntimeTool",
24
26
  "AgentRuntimeTool",
@@ -28,6 +30,6 @@ __all__ = [
28
30
  "SkillRuntimeTool",
29
31
  "WriteRuntimeTool",
30
32
  "EditRuntimeTool",
31
- "UserMessageTool",
33
+ # "UserMessageTool", # 暂时移除
32
34
  ]
33
35
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langchain-agentx-python
3
- Version: 0.8.2
3
+ Version: 0.8.4
4
4
  Summary: LangChain/LangGraph-based agent utilities for CodeBaseX.
5
5
  Author-email: GoodMood2008 <GoodMood2008@users.noreply.github.com>
6
6
  License: Apache License
@@ -1,4 +1,4 @@
1
- langchain_agentx/__init__.py,sha256=vhl_ftNWrC7wH3MlHkT8B9MZZbkAyeE1yM5oHot2auc,1614
1
+ langchain_agentx/__init__.py,sha256=XL9VtbZHeJ-NCBSEEhbaP0yn0TGdbame31Lg3-8F4DI,1614
2
2
  langchain_agentx/command/__init__.py,sha256=Ej260S5uFQcmEtGZQG_NH7BYjHoStrpBLtGUsBTxyZk,631
3
3
  langchain_agentx/command/context.py,sha256=DIGOGPBw5UGDBm0WNNJlKx1h_9rCRmcdROv4DT61Qug,731
4
4
  langchain_agentx/command/dispatcher.py,sha256=T_idTD0hLllYE01X6FkpA7WRz9R-GZuVBAWnh9YWoeU,7197
@@ -47,7 +47,7 @@ langchain_agentx/loop/exit/reason_codes.py,sha256=vQcsqfute1_weyxtDDWm7CR6vvt6eP
47
47
  langchain_agentx/loop/graph/__init__.py,sha256=9pUUqn7G87n3lV45iYIU24j0wcTHyCD--SSdtv3urh4,136
48
48
  langchain_agentx/loop/graph/builtin_loop_control.py,sha256=X688DfiI0QCNgw0vC2LYKkqKPyaOIqrtpIEFN_Dtr6w,6881
49
49
  langchain_agentx/loop/graph/factory.py,sha256=dxnruFhVNTOOyViSFkWrTDKDxhO4UGkXdOSmgbylk8g,71005
50
- langchain_agentx/loop/graph/graph_edges.py,sha256=JzslaibMZZeMCZNKAvvwc9D4aHAH3k3OhvD0vZtA8f0,33032
50
+ langchain_agentx/loop/graph/graph_edges.py,sha256=AGBNpehaea56GmhCDf7jhk2PgF8H3COgVXmOhMTFAv8,33727
51
51
  langchain_agentx/loop/hook/__init__.py,sha256=odakjuulEYaL9-U3em5SAHHsUGqAoiPCSS9X4VxLTIE,1824
52
52
  langchain_agentx/loop/hook/async_hook_runner.py,sha256=UIrdpgAcUumyxs7ASeJh6ehK2NSo-FDQVj9ICpuPook,2146
53
53
  langchain_agentx/loop/hook/config.py,sha256=f8XtGGHtyjuRvZNhkU8ohbhyqOHD7mHZn_w0rVXMX_o,9157
@@ -65,7 +65,7 @@ langchain_agentx/loop/hook/executors/prompt.py,sha256=oYwOk-acH-dopzfzNUEjpPdXGk
65
65
  langchain_agentx/loop/injection/__init__.py,sha256=rEiAXYqdr_Ry8mhHBu6xZKLypnyJOxcxNe6sJns1rnc,362
66
66
  langchain_agentx/loop/injection/dedup.py,sha256=5wv-Tb8HUean9C82VazVIkTkQdIZi9gewMABukiclpI,2548
67
67
  langchain_agentx/loop/model/__init__.py,sha256=8wOiwa2Yvh7QdR6ilhk4faI7_iwNT6QSEFgewJNhhOw,57
68
- langchain_agentx/loop/model/model_node.py,sha256=TVl1Hf9UZeipIU_I4dTA3uEulezn_eNPiMI5jynTOtA,28899
68
+ langchain_agentx/loop/model/model_node.py,sha256=MUJ_VwYKB5hiYU5QOjqAfLkQBhEUsuWPtZTNf8s3x3Y,29715
69
69
  langchain_agentx/loop/model/model_nodes.py,sha256=4nctxTm3FHdMQ35Tp_y2hUm4q9AYa9HiMI9xXheFAYM,26955
70
70
  langchain_agentx/loop/model/orphan_tool_results.py,sha256=TK8zDO63NYj0f0wDlREYN0qN8lpqnWRv9TMGDMQ3Z1Y,2493
71
71
  langchain_agentx/loop/model/retrier.py,sha256=XGDTsTEJDs6z_tR5vN57szUR7Uw2EJgVY5qzQWf1Yas,10045
@@ -281,7 +281,7 @@ langchain_agentx/tool_runtime/failure_event_emitter.py,sha256=F_Ko3GpJ2eGgvv7m4j
281
281
  langchain_agentx/tool_runtime/identical_call_cache.py,sha256=v8WWuTHWR5ThujcMO4Ty28mZS_w-JN24267fZ4PHWK8,3865
282
282
  langchain_agentx/tool_runtime/limits.py,sha256=imE1IetmyKQM82INR0VkP3qZNM4bjUJuf1CG5BkY0uw,356
283
283
  langchain_agentx/tool_runtime/loader.py,sha256=VUz1l4egYymEAIG3IlizbERYMwyY81iv8lOX6-gCgbY,8324
284
- langchain_agentx/tool_runtime/loop_loader.py,sha256=euv3aQtPg0XQYpAVB7B8-rZ34nW7zBl_kQaPTtlcKjc,6759
284
+ langchain_agentx/tool_runtime/loop_loader.py,sha256=wBzG9yYk4ix0IZpzmRlcv8zv9RTOeh2K7nxUs0YPW5s,6913
285
285
  langchain_agentx/tool_runtime/messages.py,sha256=Fp-ZiLAbOQAQa8uIv-owE8PXtWyhpYSXxtzy3PVbKSw,3631
286
286
  langchain_agentx/tool_runtime/models.py,sha256=tCmXToT1-xT5k4OnZG3T0s4Xf9GPT3HXJ6uS8MfrIoc,15849
287
287
  langchain_agentx/tool_runtime/override.py,sha256=GE_i0J3O7RmfmeSdnQ95FGdTZ4Fu8TdfqXlVjfn0J3w,10422
@@ -333,7 +333,7 @@ langchain_agentx/tool_runtime/resolvers/background.py,sha256=gSdkP2GiPVr7eV00LRK
333
333
  langchain_agentx/tool_runtime/resolvers/base.py,sha256=9yICLDx-CuaM8Dh1V2JVBhumbqaX25GEENIYL5tuAp8,559
334
334
  langchain_agentx/tool_runtime/resolvers/conversation.py,sha256=xH1Xt1uoGM5ifj7OnBXxX-WZiPfUEZ539bucuCKlPD8,595
335
335
  langchain_agentx/tool_runtime/resolvers/workflow.py,sha256=yahIZSShfF-eHUWAEfyxpAiy8xCBKYbc73BIbTKT8oc,2421
336
- langchain_agentx/tools/__init__.py,sha256=YST3WvB-uTuAv6ZZDZaho2l_IfZwY5x9NQD25hcU-Y8,1116
336
+ langchain_agentx/tools/__init__.py,sha256=d5Bk4-y9IcirMmdaX5D1fnqD4TQblHyE5by2x2tgulY,1239
337
337
  langchain_agentx/tools/ripgrep_plugin_exclusions.py,sha256=PoCJ26D--63gflqvwUZ_tI35xL1KMqzCbq5YjEtxJUM,5026
338
338
  langchain_agentx/tools/agent/__init__.py,sha256=doBZ0Bym-CvcwIU8i-bC3jie4MBquFyFZUuoiSYFOCc,209
339
339
  langchain_agentx/tools/agent/backend.py,sha256=Mdi_ALrJbIvjETvNzYV_ORzaNIZJ6DYqZC0uqGQERJI,1821
@@ -525,8 +525,8 @@ langchain_agentx/workspace/root_grant_manager.py,sha256=W3gy8HTevbERbXqIgRcjzOXO
525
525
  langchain_agentx/workspace/tool_boundary.py,sha256=3b4KwMrGhsS_HZaoCjytJJk39pN0lN3nvYQIj1vLD1k,3327
526
526
  langchain_agentx/workspace/validators.py,sha256=tQt-6TOcL8Fw7Ig5ebA9S7vGWh1rby920eFW6x8Tk9E,1439
527
527
  langchain_agentx/workspace/view.py,sha256=g_FfJdG0bPeI0cmYLvTky1vG3FB_q0SfTjT3GQfEBbw,3866
528
- langchain_agentx_python-0.8.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
529
- langchain_agentx_python-0.8.2.dist-info/METADATA,sha256=tuNPHklnUtJlLzCSOmChlorpJqtJ7K0YeNzgJYMkXmA,20949
530
- langchain_agentx_python-0.8.2.dist-info/WHEEL,sha256=51RkbunBAw4BWsgaQWTpPhg4Diwp3c9P5iaLk67Hdtg,92
531
- langchain_agentx_python-0.8.2.dist-info/top_level.txt,sha256=Ge284pniNt8xea0OLk2o9o32GqVpDhOYk20fwE-0xxA,17
532
- langchain_agentx_python-0.8.2.dist-info/RECORD,,
528
+ langchain_agentx_python-0.8.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
529
+ langchain_agentx_python-0.8.4.dist-info/METADATA,sha256=O3iLzfRQbh9T3wl6P6nHus4FN0Jxk0RZHKFi4PRt_XM,20949
530
+ langchain_agentx_python-0.8.4.dist-info/WHEEL,sha256=51RkbunBAw4BWsgaQWTpPhg4Diwp3c9P5iaLk67Hdtg,92
531
+ langchain_agentx_python-0.8.4.dist-info/top_level.txt,sha256=Ge284pniNt8xea0OLk2o9o32GqVpDhOYk20fwE-0xxA,17
532
+ langchain_agentx_python-0.8.4.dist-info/RECORD,,