code-puppy 0.0.318__py3-none-any.whl → 0.0.319__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.
@@ -84,6 +84,12 @@ SETTING_DEFINITIONS: Dict[str, Dict] = {
84
84
  "default": 10000,
85
85
  "format": "{:.0f}",
86
86
  },
87
+ "interleaved_thinking": {
88
+ "name": "Interleaved Thinking",
89
+ "description": "Enable thinking between tool calls (Claude 4 only: Opus 4.5, Opus 4.1, Opus 4, Sonnet 4). Adds beta header. WARNING: On Vertex/Bedrock, this FAILS for non-Claude 4 models!",
90
+ "type": "boolean",
91
+ "default": False,
92
+ },
87
93
  }
88
94
 
89
95
 
@@ -319,9 +319,21 @@ class ModelFactory:
319
319
  http2=http2_enabled,
320
320
  )
321
321
 
322
+ # Check if interleaved thinking is enabled for this model
323
+ # Only applies to Claude 4 models (Opus 4.5, Opus 4.1, Opus 4, Sonnet 4)
324
+ from code_puppy.config import get_effective_model_settings
325
+
326
+ effective_settings = get_effective_model_settings(model_name)
327
+ interleaved_thinking = effective_settings.get("interleaved_thinking", False)
328
+
329
+ default_headers = {}
330
+ if interleaved_thinking:
331
+ default_headers["anthropic-beta"] = "interleaved-thinking-2025-05-14"
332
+
322
333
  anthropic_client = AsyncAnthropic(
323
334
  api_key=api_key,
324
335
  http_client=client,
336
+ default_headers=default_headers if default_headers else None,
325
337
  )
326
338
 
327
339
  # Ensure cache_control is injected at the Anthropic SDK layer
@@ -351,10 +363,21 @@ class ModelFactory:
351
363
  http2=http2_enabled,
352
364
  )
353
365
 
366
+ # Check if interleaved thinking is enabled for this model
367
+ from code_puppy.config import get_effective_model_settings
368
+
369
+ effective_settings = get_effective_model_settings(model_name)
370
+ interleaved_thinking = effective_settings.get("interleaved_thinking", False)
371
+
372
+ default_headers = {}
373
+ if interleaved_thinking:
374
+ default_headers["anthropic-beta"] = "interleaved-thinking-2025-05-14"
375
+
354
376
  anthropic_client = AsyncAnthropic(
355
377
  base_url=url,
356
378
  http_client=client,
357
379
  api_key=api_key,
380
+ default_headers=default_headers if default_headers else None,
358
381
  )
359
382
 
360
383
  # Ensure cache_control is injected at the Anthropic SDK layer
@@ -370,6 +393,31 @@ class ModelFactory:
370
393
  )
371
394
  return None
372
395
 
396
+ # Check if interleaved thinking is enabled (defaults to True for OAuth models)
397
+ from code_puppy.config import get_effective_model_settings
398
+
399
+ effective_settings = get_effective_model_settings(model_name)
400
+ interleaved_thinking = effective_settings.get("interleaved_thinking", True)
401
+
402
+ # Handle anthropic-beta header based on interleaved_thinking setting
403
+ if "anthropic-beta" in headers:
404
+ beta_parts = [p.strip() for p in headers["anthropic-beta"].split(",")]
405
+ if interleaved_thinking:
406
+ # Ensure interleaved-thinking is in the header
407
+ if "interleaved-thinking-2025-05-14" not in beta_parts:
408
+ beta_parts.append("interleaved-thinking-2025-05-14")
409
+ else:
410
+ # Remove interleaved-thinking from the header
411
+ beta_parts = [
412
+ p for p in beta_parts if "interleaved-thinking" not in p
413
+ ]
414
+ headers["anthropic-beta"] = ",".join(beta_parts) if beta_parts else None
415
+ if headers.get("anthropic-beta") is None:
416
+ del headers["anthropic-beta"]
417
+ elif interleaved_thinking:
418
+ # No existing beta header, add one for interleaved thinking
419
+ headers["anthropic-beta"] = "interleaved-thinking-2025-05-14"
420
+
373
421
  # Use a dedicated client wrapper that injects cache_control on /v1/messages
374
422
  if verify is None:
375
423
  verify = get_cert_bundle_path()
code_puppy/models.json CHANGED
@@ -81,7 +81,7 @@
81
81
  "type": "anthropic",
82
82
  "name": "claude-opus-4-5",
83
83
  "context_length": 200000,
84
- "supported_settings": ["temperature", "extended_thinking", "budget_tokens"]
84
+ "supported_settings": ["temperature", "extended_thinking", "budget_tokens", "interleaved_thinking"]
85
85
  },
86
86
  "zai-glm-4.6-coding": {
87
87
  "type": "zai_coding",
@@ -368,6 +368,7 @@ def add_models_to_extra_config(models: List[str]) -> bool:
368
368
  "temperature",
369
369
  "extended_thinking",
370
370
  "budget_tokens",
371
+ "interleaved_thinking",
371
372
  ],
372
373
  }
373
374
  added += 1
@@ -81,7 +81,7 @@
81
81
  "type": "anthropic",
82
82
  "name": "claude-opus-4-5",
83
83
  "context_length": 200000,
84
- "supported_settings": ["temperature", "extended_thinking", "budget_tokens"]
84
+ "supported_settings": ["temperature", "extended_thinking", "budget_tokens", "interleaved_thinking"]
85
85
  },
86
86
  "zai-glm-4.6-coding": {
87
87
  "type": "zai_coding",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-puppy
3
- Version: 0.0.318
3
+ Version: 0.0.319
4
4
  Summary: Code generation agent
5
5
  Project-URL: repository, https://github.com/mpfaffenberger/code_puppy
6
6
  Project-URL: HomePage, https://github.com/mpfaffenberger/code_puppy
@@ -10,9 +10,9 @@ code_puppy/gemini_code_assist.py,sha256=KGS7sO5OLc83nDF3xxS-QiU6vxW9vcm6hmzilu79
10
10
  code_puppy/http_utils.py,sha256=w5mWYIGIWJZJvgvMahXs9BmdidoJvGn4CASDRY88a8o,13414
11
11
  code_puppy/keymap.py,sha256=Uzvq7HB-6inTjKox-90JWzuijztRdWqhJpfTDZVy5no,3235
12
12
  code_puppy/main.py,sha256=82r3vZy_XcyEsenLn82BnUusaoyL3Bpm_Th_jKgqecE,273
13
- code_puppy/model_factory.py,sha256=2jXTpi3BuFO8RtbhKKRvb5EN02w_OKzQSdsTdSy78X0,31608
13
+ code_puppy/model_factory.py,sha256=H_a5nX462Q-dhX3g3ZY7dmBCIAUOd1aOSZa4HMxF1o4,34191
14
14
  code_puppy/model_utils.py,sha256=NU8W8NW5F7QS_PXHaLeh55Air1koUV7IVYFP7Rz3XpY,3615
15
- code_puppy/models.json,sha256=nbMCW9SJxWptVEOeMrn_gfyDp-lsbM7Chczjl944GKA,3077
15
+ code_puppy/models.json,sha256=mTpmJH0UJlmX8M2KVPbxMWb99de3IxKXCWO-B23b6xo,3101
16
16
  code_puppy/models_dev_api.json,sha256=wHjkj-IM_fx1oHki6-GqtOoCrRMR0ScK0f-Iz0UEcy8,548187
17
17
  code_puppy/models_dev_parser.py,sha256=8ndmWrsSyKbXXpRZPXc0w6TfWMuCcgaHiMifmlaBaPc,20611
18
18
  code_puppy/pydantic_patches.py,sha256=YecAEeCOjSIwIBu2O5vEw72atMSL37cXGrbEuukI07o,4582
@@ -56,7 +56,7 @@ code_puppy/command_line/file_path_completion.py,sha256=gw8NpIxa6GOpczUJRyh7VNZwo
56
56
  code_puppy/command_line/load_context_completion.py,sha256=a3JvLDeLLSYxVgTjAdqWzS4spjv6ccCrK2LKZgVJ1IM,2202
57
57
  code_puppy/command_line/mcp_completion.py,sha256=eKzW2O7gun7HoHekOW0XVXhNS5J2xCtK7aaWyA8bkZk,6952
58
58
  code_puppy/command_line/model_picker_completion.py,sha256=nDnlf0qFCG2zAm_mWW2eMYwVC7eROVQrFe92hZqOKa8,6810
59
- code_puppy/command_line/model_settings_menu.py,sha256=-GDJyvkFeEIs-fYTvkBPxyVjmMo9CJRrwUq_IuiEbqY,31935
59
+ code_puppy/command_line/model_settings_menu.py,sha256=O5nPp_OyShFcXzpSmsCeYsnnVNrSwcTBFY9bzcayvj0,32263
60
60
  code_puppy/command_line/motd.py,sha256=OoNxwewsckexSgJ5H5y40IawP-TzqlqY-rqFUdRbIhs,2186
61
61
  code_puppy/command_line/pin_command_completion.py,sha256=juSvdqRpk7AdfkPy1DJx5NzfEUU5KYGlChvP0hisM18,11667
62
62
  code_puppy/command_line/prompt_toolkit_completion.py,sha256=x4Of32g8oH9ckhx-P6BigV7HUUhhjL8xkvK03uq9HRw,27308
@@ -130,7 +130,7 @@ code_puppy/plugins/claude_code_oauth/__init__.py,sha256=mCcOU-wM7LNCDjr-w-WLPzom
130
130
  code_puppy/plugins/claude_code_oauth/config.py,sha256=DjGySCkvjSGZds6DYErLMAi3TItt8iSLGvyJN98nSEM,2013
131
131
  code_puppy/plugins/claude_code_oauth/register_callbacks.py,sha256=0NeX1hhkYIlVfPmjZ1xmcf1yueDAJh_FMUmvJlxSO-E,10057
132
132
  code_puppy/plugins/claude_code_oauth/test_plugin.py,sha256=yQy4EeZl4bjrcog1d8BjknoDTRK75mRXXvkSQJYSSEM,9286
133
- code_puppy/plugins/claude_code_oauth/utils.py,sha256=uxNRrvtmyG_zZxcvCyZIU1fib8wV5KeorHgVv0RWS9s,13394
133
+ code_puppy/plugins/claude_code_oauth/utils.py,sha256=wDaOU21zB3y6PWkuMXwE4mFjQuffyDae-vXysPTS-w8,13438
134
134
  code_puppy/plugins/customizable_commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
135
135
  code_puppy/plugins/customizable_commands/register_callbacks.py,sha256=zVMfIzr--hVn0IOXxIicbmgj2s-HZUgtrOc0NCDOnDw,5183
136
136
  code_puppy/plugins/example_custom_command/README.md,sha256=5c5Zkm7CW6BDSfe3WoLU7GW6t5mjjYAbu9-_pu-b3p4,8244
@@ -159,10 +159,10 @@ code_puppy/tools/browser/browser_scripts.py,sha256=sNb8eLEyzhasy5hV4B9OjM8yIVMLV
159
159
  code_puppy/tools/browser/browser_workflows.py,sha256=nitW42vCf0ieTX1gLabozTugNQ8phtoFzZbiAhw1V90,6491
160
160
  code_puppy/tools/browser/camoufox_manager.py,sha256=RZjGOEftE5sI_tsercUyXFSZI2wpStXf-q0PdYh2G3I,8680
161
161
  code_puppy/tools/browser/vqa_agent.py,sha256=DBn9HKloILqJSTSdNZzH_PYWT0B2h9VwmY6akFQI_uU,2913
162
- code_puppy-0.0.318.data/data/code_puppy/models.json,sha256=nbMCW9SJxWptVEOeMrn_gfyDp-lsbM7Chczjl944GKA,3077
163
- code_puppy-0.0.318.data/data/code_puppy/models_dev_api.json,sha256=wHjkj-IM_fx1oHki6-GqtOoCrRMR0ScK0f-Iz0UEcy8,548187
164
- code_puppy-0.0.318.dist-info/METADATA,sha256=_7lhagjL8fQpd7zBbl8DQ1Z9qmHGRY2gbQ7E9jwNp54,28030
165
- code_puppy-0.0.318.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
166
- code_puppy-0.0.318.dist-info/entry_points.txt,sha256=Tp4eQC99WY3HOKd3sdvb22vZODRq0XkZVNpXOag_KdI,91
167
- code_puppy-0.0.318.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
168
- code_puppy-0.0.318.dist-info/RECORD,,
162
+ code_puppy-0.0.319.data/data/code_puppy/models.json,sha256=mTpmJH0UJlmX8M2KVPbxMWb99de3IxKXCWO-B23b6xo,3101
163
+ code_puppy-0.0.319.data/data/code_puppy/models_dev_api.json,sha256=wHjkj-IM_fx1oHki6-GqtOoCrRMR0ScK0f-Iz0UEcy8,548187
164
+ code_puppy-0.0.319.dist-info/METADATA,sha256=XgkIpN2_glvNl1BcGksFRRikU_PCKdR-eQkDAIkr1ms,28030
165
+ code_puppy-0.0.319.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
166
+ code_puppy-0.0.319.dist-info/entry_points.txt,sha256=Tp4eQC99WY3HOKd3sdvb22vZODRq0XkZVNpXOag_KdI,91
167
+ code_puppy-0.0.319.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
168
+ code_puppy-0.0.319.dist-info/RECORD,,