klaude-code 2.4.1__py3-none-any.whl → 2.4.2__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.
klaude_code/core/turn.py CHANGED
@@ -366,6 +366,7 @@ class TurnExecutor:
366
366
  response_id=msg.response_id,
367
367
  tool_call_id=msg.call_id,
368
368
  tool_name=msg.name,
369
+ model_id=ctx.llm_client.model_name,
369
370
  )
370
371
  case _:
371
372
  continue
@@ -34,6 +34,7 @@ class AssistantImageDeltaEvent(ResponseEvent):
34
34
  class ToolCallStartEvent(ResponseEvent):
35
35
  tool_call_id: str
36
36
  tool_name: str
37
+ model_id: str | None = None
37
38
 
38
39
 
39
40
  class ResponseCompleteEvent(ResponseEvent):
@@ -81,6 +81,7 @@ def render_sub_agent_result(
81
81
  *,
82
82
  has_structured_output: bool = False,
83
83
  description: str | None = None,
84
+ sub_agent_color: Style | None = None,
84
85
  ) -> RenderableType:
85
86
  stripped_result = result.strip()
86
87
  main_content, agent_id_footer = _extract_agent_id_footer(stripped_result)
@@ -88,7 +89,14 @@ def render_sub_agent_result(
88
89
 
89
90
  elements: list[RenderableType] = []
90
91
  if description:
91
- elements.append(Text(f"---\n{description}", style=ThemeKey.TOOL_RESULT))
92
+ elements.append(
93
+ Text(
94
+ f"---\n{description}",
95
+ style=Style(bold=True, color=sub_agent_color.color, frame=True)
96
+ if sub_agent_color
97
+ else ThemeKey.TOOL_RESULT_BOLD,
98
+ )
99
+ )
92
100
 
93
101
  # Try structured JSON output first
94
102
  use_text_rendering = True
@@ -10,7 +10,7 @@ from klaude_code.const import (
10
10
  STATUS_DEFAULT_TEXT,
11
11
  STATUS_THINKING_TEXT,
12
12
  )
13
- from klaude_code.protocol import events, model
13
+ from klaude_code.protocol import events, model, tools
14
14
  from klaude_code.tui.commands import (
15
15
  AppendAssistant,
16
16
  AppendThinking,
@@ -48,6 +48,33 @@ from klaude_code.tui.components.rich.theme import ThemeKey
48
48
  from klaude_code.tui.components.thinking import extract_last_bold_header, normalize_thinking_content
49
49
  from klaude_code.tui.components.tools import get_tool_active_form, is_sub_agent_tool
50
50
 
51
+ # Tools that complete quickly and don't benefit from streaming activity display.
52
+ # For models without fine-grained tool JSON streaming (e.g., Gemini), showing these
53
+ # in the activity state causes a flash-and-disappear effect.
54
+ FAST_TOOLS: frozenset[str] = frozenset(
55
+ {
56
+ tools.READ,
57
+ tools.EDIT,
58
+ tools.WRITE,
59
+ tools.BASH,
60
+ tools.TODO_WRITE,
61
+ tools.UPDATE_PLAN,
62
+ tools.APPLY_PATCH,
63
+ tools.REPORT_BACK,
64
+ }
65
+ )
66
+
67
+
68
+ def _should_skip_tool_activity(tool_name: str, model_id: str | None) -> bool:
69
+ """Check if tool activity should be skipped for non-streaming models."""
70
+ if model_id is None:
71
+ return False
72
+ if tool_name not in FAST_TOOLS:
73
+ return False
74
+ # Gemini and Grok models don't stream tool JSON at fine granularity
75
+ model_lower = model_id.lower()
76
+ return "gemini" in model_lower or "grok" in model_lower
77
+
51
78
 
52
79
  @dataclass
53
80
  class SubAgentThinkingHeaderState:
@@ -142,7 +169,8 @@ class ActivityState:
142
169
 
143
170
  if self._sub_agent_tool_calls:
144
171
  _append_counts(self._sub_agent_tool_calls)
145
- activity_text.append(" | ")
172
+ if self._tool_calls:
173
+ activity_text.append(" , ")
146
174
 
147
175
  if self._tool_calls:
148
176
  _append_counts(self._tool_calls)
@@ -497,11 +525,14 @@ class DisplayStateMachine:
497
525
 
498
526
  self._spinner.set_composing(False)
499
527
 
500
- tool_active_form = get_tool_active_form(e.tool_name)
501
- if is_sub_agent_tool(e.tool_name):
502
- self._spinner.add_sub_agent_tool_call(e.tool_call_id, tool_active_form)
503
- else:
504
- self._spinner.add_tool_call(tool_active_form)
528
+ # Skip activity state for fast tools on non-streaming models (e.g., Gemini)
529
+ # to avoid flash-and-disappear effect
530
+ if not _should_skip_tool_activity(e.tool_name, e.model_id):
531
+ tool_active_form = get_tool_active_form(e.tool_name)
532
+ if is_sub_agent_tool(e.tool_name):
533
+ self._spinner.add_sub_agent_tool_call(e.tool_call_id, tool_active_form)
534
+ else:
535
+ self._spinner.add_tool_call(tool_active_form)
505
536
 
506
537
  cmds.extend(self._spinner_update_commands())
507
538
  return cmds
@@ -569,6 +569,7 @@ class TUICommandRenderer:
569
569
  event.task_result,
570
570
  has_structured_output=event.has_structured_output,
571
571
  description=description,
572
+ sub_agent_color=self._current_sub_agent_color,
572
573
  )
573
574
  )
574
575
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: klaude-code
3
- Version: 2.4.1
3
+ Version: 2.4.2
4
4
  Summary: Minimal code agent CLI
5
5
  Requires-Dist: anthropic>=0.66.0
6
6
  Requires-Dist: chardet>=5.2.0
@@ -17,7 +17,7 @@ Requires-Dist: rich>=14.1.0
17
17
  Requires-Dist: term-image>=0.7.2
18
18
  Requires-Dist: trafilatura>=2.0.0
19
19
  Requires-Dist: typer>=0.17.3
20
- Requires-Python: >=3.13
20
+ Requires-Python: >=3.13, <3.14
21
21
  Description-Content-Type: text/markdown
22
22
 
23
23
  # Klaude Code
@@ -88,7 +88,7 @@ klaude_code/core/tool/web/web_fetch_tool.md,sha256=jIrW-EAmfl50bBevcfioQ3Vrg8kWl
88
88
  klaude_code/core/tool/web/web_fetch_tool.py,sha256=MpAfiRVg4CNvLQlve4jphpX4juN81aR7XWOZi0I5-UQ,10323
89
89
  klaude_code/core/tool/web/web_search_tool.md,sha256=l5gGPx-fXHFel1zLBljm8isy9pwEYXGrq5cFzzw1VBw,1135
90
90
  klaude_code/core/tool/web/web_search_tool.py,sha256=ljkgXxP6L5nJnbYB_IOUtPUN9zA_h5hBD55lhNAja08,4293
91
- klaude_code/core/turn.py,sha256=Xjg8PCcpug3Okl12ciWBO7EiqZxlBYtGuY2gAKV3GFk,18081
91
+ klaude_code/core/turn.py,sha256=oQ7T5GVwbGuxD-CA8hGENRG3gP-78q-taUXMRlPKaqc,18141
92
92
  klaude_code/llm/__init__.py,sha256=b4AsqnrMIs0a5qR_ti6rZcHwFzAReTwOW96EqozEoSo,287
93
93
  klaude_code/llm/anthropic/__init__.py,sha256=PWETvaeNAAX3ue0ww1uRUIxTJG0RpWiutkn7MlwKxBs,67
94
94
  klaude_code/llm/anthropic/client.py,sha256=l0b4aMs7LoaowKYNdwz3_xTZVLyfKwfcKXOHbKnJmRs,12356
@@ -127,7 +127,7 @@ klaude_code/protocol/events/base.py,sha256=QfqgksjA2Hj-ClmwKVeJ7QA6Z7YdzjswO1NfA
127
127
  klaude_code/protocol/events/chat.py,sha256=mI_Ks5IIU1ZiywclQYxzhSsGA3ga7ACKShU6d9_KqSs,731
128
128
  klaude_code/protocol/events/lifecycle.py,sha256=5csZkv3oZIuLzs_7H84v8HgAYwbjIjkZOHfjxq9YfxM,357
129
129
  klaude_code/protocol/events/metadata.py,sha256=oVZ1zanGcTEFkHW8fLEqS2Z1A9e1MMcjLOcNwUUuCBI,285
130
- klaude_code/protocol/events/streaming.py,sha256=U1plGQSTeGZa3E4fIxW_fHXJpuv_DSIBrmGh1l4Fm54,708
130
+ klaude_code/protocol/events/streaming.py,sha256=Cn7LRIIzd_7Y0Ex1TnqaLf1imS7m8ZplxfTQSpZy9bY,740
131
131
  klaude_code/protocol/events/system.py,sha256=ihWZLNyPO0xvHAVjMkbGt2FqL8m-ZVreq-MTZLfxQnc,1453
132
132
  klaude_code/protocol/events/tools.py,sha256=8ds_8Zj-wQWvHNAvNt1-fSIHeDffw1dsLWI7ByrAqcM,617
133
133
  klaude_code/protocol/llm_param.py,sha256=DSCxBdFSdQV8qOhEjjjYNapgA3v4TBkN5V9HgEWho_k,5164
@@ -199,7 +199,7 @@ klaude_code/tui/components/rich/quote.py,sha256=gTLwxSPQd9nlp73P1ysQIEgOb-BoTE2g
199
199
  klaude_code/tui/components/rich/searchable_text.py,sha256=PUe6MotKxSBY4FlPeojVjVQgxCsx_jiQ41bCzLp8WvE,2271
200
200
  klaude_code/tui/components/rich/status.py,sha256=kNt08FQGvMZJB-zUhT5UyVFA7jvuRBNqf6yDXLEhb9c,14756
201
201
  klaude_code/tui/components/rich/theme.py,sha256=KCPY3Kv5uYpnlULv131XSvW7yDe2z3lx1P2kxLNcCRs,15151
202
- klaude_code/tui/components/sub_agent.py,sha256=YfcmFzyNKuFNr0pqaJHTEf_AmkKyEN0xnx7bfHPNYA0,6079
202
+ klaude_code/tui/components/sub_agent.py,sha256=afkDbndByQmrxO3lvWR3rSvlbIE0wktbjdnlBTwka5I,6309
203
203
  klaude_code/tui/components/thinking.py,sha256=AXC7Xpyiu7ST-eWGLRGY7N8Dak2ny3lV3mvznmfqKmM,2890
204
204
  klaude_code/tui/components/tools.py,sha256=xqrWBDPsVtOeyE-qF_Idzr1Dhf5bjgrvl-v6svv-H3Q,26230
205
205
  klaude_code/tui/components/user_input.py,sha256=6VHH77xwUUW0rW7yv8hOwGXsmK52HEsBg9-QZVbOm1A,3427
@@ -210,8 +210,8 @@ klaude_code/tui/input/clipboard.py,sha256=HjThFB9MG_YdJ76CQv7B-IUoz5JarbWUZDbUVk
210
210
  klaude_code/tui/input/completers.py,sha256=lkDBjnqYPLMgR6AZHhx2bfT_vMW-fbV6aqY9SqRwq74,32571
211
211
  klaude_code/tui/input/key_bindings.py,sha256=2uN48J1HRHeCBqq7WrH5J82NIU59oQscce0HquAiYCI,18876
212
212
  klaude_code/tui/input/prompt_toolkit.py,sha256=O3EZG1yOgaxrILbmQf4srVuBqDtkShpkxU3LecMP5o8,27790
213
- klaude_code/tui/machine.py,sha256=c02JvEuWeBk-TmqPCk9G6efsNhwh7yY_Xi3z6kz-zqw,23512
214
- klaude_code/tui/renderer.py,sha256=3VXxFe08n0WVkHt5_vOOBCploVPA_SQUgZsXnv5KI_A,29451
213
+ klaude_code/tui/machine.py,sha256=5Lk3jKdNWrkCOsu42H-0CfiWQ5oTd37KruCIhf8FLZg,24698
214
+ klaude_code/tui/renderer.py,sha256=JZu892irKW0aNis3vs5Rq9aqYdcKhllrhnC2kfsC9tM,29522
215
215
  klaude_code/tui/runner.py,sha256=nOq8wC78HzgqHLRgHC8OgYubH--2gPcDqA6GoV913Yc,11270
216
216
  klaude_code/tui/terminal/__init__.py,sha256=GIMnsEcIAGT_vBHvTlWEdyNmAEpruyscUA6M_j3GQZU,1412
217
217
  klaude_code/tui/terminal/color.py,sha256=6SJR2RA8cqJINNoRz65w0HL3x9g46ydIvDOGWMeNnQU,7195
@@ -229,7 +229,7 @@ klaude_code/ui/debug_mode.py,sha256=ZvqbOx4c_rUerMbEZzOfcbNf9leqEDFjqJUlALtzF9Y,
229
229
  klaude_code/ui/terminal/__init__.py,sha256=5OeAzr994r8-peWsLON0iXsAvJ2pexwMp36JY7FKGDc,179
230
230
  klaude_code/ui/terminal/title.py,sha256=EZpLXTMhunsZPVGaxP317lH0Ad2oOh7OsjbV3yRD5is,1115
231
231
  klaude_code/update.py,sha256=QER816AZe9u3RhRvP0Z37Jh2Ch5RLy9PREyDsI0e1dA,4480
232
- klaude_code-2.4.1.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
233
- klaude_code-2.4.1.dist-info/entry_points.txt,sha256=kkXIXedaTOtjXPr2rVjRVVXZYlFUcBHELaqmyVlWUFA,92
234
- klaude_code-2.4.1.dist-info/METADATA,sha256=msAo2mU-ca2EXKPe6y-8Bt1Ij3w2Op055Uf3tKKRXSk,10242
235
- klaude_code-2.4.1.dist-info/RECORD,,
232
+ klaude_code-2.4.2.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
233
+ klaude_code-2.4.2.dist-info/entry_points.txt,sha256=kkXIXedaTOtjXPr2rVjRVVXZYlFUcBHELaqmyVlWUFA,92
234
+ klaude_code-2.4.2.dist-info/METADATA,sha256=luR1lEqTH7v-LyM2c4gw1f4ZD7s9_IGv2Xd193Hmm0s,10249
235
+ klaude_code-2.4.2.dist-info/RECORD,,