gemcode 0.4.30__py3-none-any.whl → 0.4.32__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.
gemcode/thinking.py CHANGED
@@ -96,8 +96,16 @@ def build_thinking_config(cfg: GemCodeConfig) -> Optional[types.ThinkingConfig]:
96
96
  )
97
97
 
98
98
  # If the user only wants thought summaries, we can set include_thoughts
99
- # without forcing a budget/level.
99
+ # without forcing a budget/level (Gemini 2.5). Gemini 3.x also needs an
100
+ # explicit thinking_level or the model may consume thought tokens without
101
+ # streaming readable summaries to the client.
100
102
  if include:
103
+ if not is_25:
104
+ show_full = bool(getattr(cfg, "show_full_thinking", False))
105
+ level = "high" if show_full else "medium"
106
+ if _is_gemini_3_pro(model_id) and level == "minimal":
107
+ level = "low"
108
+ return types.ThinkingConfig(include_thoughts=True, thinking_level=level)
101
109
  return types.ThinkingConfig(include_thoughts=True)
102
110
 
103
111
  # Otherwise: familiar auto mapping based on model_mode.
@@ -53,7 +53,7 @@ def extract_parts_from_event(event: Any) -> tuple[str, str]:
53
53
  t = getattr(p, "text", None)
54
54
  if not isinstance(t, str) or not t:
55
55
  continue
56
- if getattr(p, "thought", None):
56
+ if getattr(p, "thought", None) is True:
57
57
  thought_parts.append(t)
58
58
  else:
59
59
  final_parts.append(t)
@@ -139,9 +139,13 @@ async def _emit_text_delta(index: int, delta: str) -> None:
139
139
 
140
140
 
141
141
  async def _emit_thinking_delta(delta: str) -> None:
142
+ """Stream thought text in small pieces so the UI can show it before the answer."""
142
143
  if not delta:
143
144
  return
144
- _sse_emit({"type": "thinking", "content": delta})
145
+ chunk_size = int(os.environ.get("GEMCODE_WEB_THINKING_CHUNK", "24"))
146
+ for piece in _iter_chunks(delta, max(1, chunk_size)):
147
+ _sse_emit({"type": "thinking", "content": piece})
148
+ await asyncio.sleep(0.008)
145
149
 
146
150
 
147
151
  def _emit_status(phase: str, *, message: str = "", elapsed_s: float | None = None) -> None:
@@ -1035,9 +1039,16 @@ def _apply_web_request_options(cfg: GemCodeConfig, req: dict[str, Any], workspac
1035
1039
  elif tm == "brief":
1036
1040
  cfg.disable_thinking = False
1037
1041
  cfg.show_full_thinking = False
1042
+ # Web UI "brief" should still request thought summaries so the UI can
1043
+ # render a streaming/collapsible "Thinking" block.
1044
+ cfg.include_thought_summaries = True
1038
1045
  elif tm == "auto":
1039
1046
  cfg.disable_thinking = False
1040
1047
  cfg.show_full_thinking = False
1048
+ # Treat web "auto" as "show brief thinking when available".
1049
+ # Without this, Gemini can enter a thinking phase but the adapter
1050
+ # won't receive any thought content to stream via SSE.
1051
+ cfg.include_thought_summaries = True
1041
1052
 
1042
1053
  caps = req.get("capabilities")
1043
1054
  if isinstance(caps, dict):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gemcode
3
- Version: 0.4.30
3
+ Version: 0.4.32
4
4
  Summary: Local-first coding agent on Google Gemini + ADK
5
5
  Author: GemCode Contributors
6
6
  License: Apache License
@@ -67,7 +67,7 @@ gemcode/session_store.py,sha256=cSDw6kDYfCikX53Z0R4qNIyv9rlPDHM3sFGIihneLIU,6013
67
67
  gemcode/session_summariser.py,sha256=ixRJVGbgWGWP-tT8hGLEqBlZ3uMXJlwQdbFsYfwF4hk,8370
68
68
  gemcode/skills.py,sha256=XXxVoe97EFgVVpN1s2WIHLvYcjLE6OSm6Mst7JWT3UU,18314
69
69
  gemcode/slash_commands.py,sha256=bcD-S_H7p7AlTli6g2dLPPG46HejPje0Imb3ScDTCaQ,798
70
- gemcode/thinking.py,sha256=-1TVkOMG-7CSQN0Mc18EqINkUxWOMBgeTlF7CX9zYL4,4641
70
+ gemcode/thinking.py,sha256=7uRiklZ7jeQsxLpi4Ur_8NbMlI_XPrk_J5tA_Wvhg28,5096
71
71
  gemcode/tool_prompt_manifest.py,sha256=AXwyv09YzzAd6KKWS5ppG3QjVBBen6SfKvZDNixkCDI,10393
72
72
  gemcode/tool_registry.py,sha256=wYfGojTxmLH_gVYh8Sqpr8bNO-CDaMOJLyaFLqxDv6A,2207
73
73
  gemcode/tool_result_store.py,sha256=50ufSP03F1D8mWFX7HFimTVh-fMWpshOtw4AP-qf-cU,6351
@@ -137,16 +137,16 @@ gemcode/web/serve_bind.py,sha256=Q6odfJuoTw8hIn3Hq8jcLe6EvRB1_wj4klrOBjKdTiE,309
137
137
  gemcode/web/serve_state.py,sha256=wTHaZ4CGjZYOxRMlKmFUEMpFoBPnci20GLbMjxGdGG0,6265
138
138
  gemcode/web/server.py,sha256=pBQ9MfzGkTbRR-Oz8xtPc7KbFINc4qbycXPUrGoPhj8,28123
139
139
  gemcode/web/sessions_api.py,sha256=4qudnYLiqIbUixon1PsV8yfBf6tu6llWLc_ESTFK61g,2008
140
- gemcode/web/sse_adapter.py,sha256=_RfPyKbUEnIg7B7_v80fWZ-r6trJG8L7viscV5I798o,44821
140
+ gemcode/web/sse_adapter.py,sha256=nkGsisB_sGJCaaGsHxFvGubZICooWSSz2tBTrNvASZQ,45492
141
141
  gemcode/web/terminal_api.py,sha256=2FWU0XQ6CVUFW_JJiVukFPdj_sgsYa_y7IQb9brxCZw,3329
142
142
  gemcode/web/terminal_repl.py,sha256=fQt895g0qcr6VBhXfv_5b_bsC5zHT5-MO0ysBdgi2Fg,3886
143
143
  gemcode/web/ui_chat_store.py,sha256=sThUOcWC-svx-e2pt88ZazPrWelN2JbqeDicU7s5iUg,2377
144
144
  gemcode/web/web_config_api.py,sha256=1kmk1vSu5z63loddTNBHVsisiYy4CfyVIF93TYCgEqs,2264
145
145
  gemcode/web/web_sse_compat.py,sha256=9A2s-GI7El7AotJqhO263FrLwppCXXkdydZ5EiOQbao,504
146
146
  gemcode/web/workspace_panel_api.py,sha256=uZS11ovlZtc1IJDnOA776Z6IndC0WovcBbmPMnZyIHs,14122
147
- gemcode-0.4.30.dist-info/licenses/LICENSE,sha256=TD4524qn-W8Z07GTDnag-9jJPFutFZNB0a1WbMHPC54,8388
148
- gemcode-0.4.30.dist-info/METADATA,sha256=nNxBDl1SoNbEYKzLUShn7WTQqmVhjyCXJQEezPR5wpY,27378
149
- gemcode-0.4.30.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
150
- gemcode-0.4.30.dist-info/entry_points.txt,sha256=cZdLTLDiHbks7OSUCuxCh66dCWeQdpLR8BozoqfEjV4,45
151
- gemcode-0.4.30.dist-info/top_level.txt,sha256=UYrjULLBY2bcgK6KI6flomJWmsbDXu7n0rvW2SWFrbo,8
152
- gemcode-0.4.30.dist-info/RECORD,,
147
+ gemcode-0.4.32.dist-info/licenses/LICENSE,sha256=TD4524qn-W8Z07GTDnag-9jJPFutFZNB0a1WbMHPC54,8388
148
+ gemcode-0.4.32.dist-info/METADATA,sha256=uShCY77KsCYro3iVtdKuWLQSQjCImH8otZMcP4id50o,27378
149
+ gemcode-0.4.32.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
150
+ gemcode-0.4.32.dist-info/entry_points.txt,sha256=cZdLTLDiHbks7OSUCuxCh66dCWeQdpLR8BozoqfEjV4,45
151
+ gemcode-0.4.32.dist-info/top_level.txt,sha256=UYrjULLBY2bcgK6KI6flomJWmsbDXu7n0rvW2SWFrbo,8
152
+ gemcode-0.4.32.dist-info/RECORD,,