code-puppy 0.0.190__py3-none-any.whl → 0.0.192__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.
- code_puppy/agents/base_agent.py +6 -2
- code_puppy/command_line/command_handler.py +34 -0
- code_puppy/command_line/prompt_toolkit_completion.py +3 -5
- code_puppy/config.py +21 -0
- {code_puppy-0.0.190.dist-info → code_puppy-0.0.192.dist-info}/METADATA +1 -1
- {code_puppy-0.0.190.dist-info → code_puppy-0.0.192.dist-info}/RECORD +10 -10
- {code_puppy-0.0.190.data → code_puppy-0.0.192.data}/data/code_puppy/models.json +0 -0
- {code_puppy-0.0.190.dist-info → code_puppy-0.0.192.dist-info}/WHEEL +0 -0
- {code_puppy-0.0.190.dist-info → code_puppy-0.0.192.dist-info}/entry_points.txt +0 -0
- {code_puppy-0.0.190.dist-info → code_puppy-0.0.192.dist-info}/licenses/LICENSE +0 -0
code_puppy/agents/base_agent.py
CHANGED
@@ -31,9 +31,11 @@ from code_puppy.config import (
|
|
31
31
|
get_compaction_strategy,
|
32
32
|
get_compaction_threshold,
|
33
33
|
get_global_model_name,
|
34
|
+
get_openai_reasoning_effort,
|
34
35
|
get_protected_token_count,
|
35
36
|
get_value,
|
36
|
-
load_mcp_server_configs,
|
37
|
+
load_mcp_server_configs,
|
38
|
+
get_message_limit,
|
37
39
|
)
|
38
40
|
from code_puppy.mcp_ import ServerConfig, get_mcp_manager
|
39
41
|
from code_puppy.messaging import (
|
@@ -829,7 +831,9 @@ class BaseAgent(ABC):
|
|
829
831
|
|
830
832
|
model_settings: ModelSettings = ModelSettings(**model_settings_dict)
|
831
833
|
if "gpt-5" in model_name:
|
832
|
-
model_settings_dict["openai_reasoning_effort"] =
|
834
|
+
model_settings_dict["openai_reasoning_effort"] = (
|
835
|
+
get_openai_reasoning_effort()
|
836
|
+
)
|
833
837
|
model_settings_dict["extra_body"] = {"verbosity": "low"}
|
834
838
|
model_settings = OpenAIModelSettings(**model_settings_dict)
|
835
839
|
|
@@ -42,6 +42,10 @@ def get_commands_help():
|
|
42
42
|
help_lines.append(
|
43
43
|
Text("/model, /m", style="cyan") + Text(" <model> Set active model")
|
44
44
|
)
|
45
|
+
help_lines.append(
|
46
|
+
Text("/reasoning", style="cyan")
|
47
|
+
+ Text(" <low|medium|high> Set OpenAI reasoning effort for GPT-5 models")
|
48
|
+
)
|
45
49
|
help_lines.append(
|
46
50
|
Text("/pin_model", style="cyan")
|
47
51
|
+ Text(" <agent> <model> Pin a specific model to an agent")
|
@@ -267,6 +271,7 @@ def handle_command(command: str):
|
|
267
271
|
from code_puppy.config import (
|
268
272
|
get_compaction_strategy,
|
269
273
|
get_compaction_threshold,
|
274
|
+
get_openai_reasoning_effort,
|
270
275
|
get_owner_name,
|
271
276
|
get_protected_token_count,
|
272
277
|
get_puppy_name,
|
@@ -294,11 +299,40 @@ def handle_command(command: str):
|
|
294
299
|
[bold]protected_tokens:[/bold] [cyan]{protected_tokens:,}[/cyan] recent tokens preserved
|
295
300
|
[bold]compaction_threshold:[/bold] [cyan]{compaction_threshold:.1%}[/cyan] context usage triggers compaction
|
296
301
|
[bold]compaction_strategy:[/bold] [cyan]{compaction_strategy}[/cyan] (summarization or truncation)
|
302
|
+
[bold]reasoning_effort:[/bold] [cyan]{get_openai_reasoning_effort()}[/cyan]
|
297
303
|
|
298
304
|
"""
|
299
305
|
emit_info(status_msg)
|
300
306
|
return True
|
301
307
|
|
308
|
+
if command.startswith("/reasoning"):
|
309
|
+
tokens = command.split()
|
310
|
+
if len(tokens) != 2:
|
311
|
+
emit_warning("Usage: /reasoning <low|medium|high>")
|
312
|
+
return True
|
313
|
+
|
314
|
+
effort = tokens[1]
|
315
|
+
try:
|
316
|
+
from code_puppy.config import set_openai_reasoning_effort
|
317
|
+
|
318
|
+
set_openai_reasoning_effort(effort)
|
319
|
+
except ValueError as exc:
|
320
|
+
emit_error(str(exc))
|
321
|
+
return True
|
322
|
+
|
323
|
+
from code_puppy.config import get_openai_reasoning_effort
|
324
|
+
|
325
|
+
normalized_effort = get_openai_reasoning_effort()
|
326
|
+
|
327
|
+
from code_puppy.agents.agent_manager import get_current_agent
|
328
|
+
|
329
|
+
agent = get_current_agent()
|
330
|
+
agent.reload_code_generation_agent()
|
331
|
+
emit_success(
|
332
|
+
f"Reasoning effort set to '{normalized_effort}' and active agent reloaded"
|
333
|
+
)
|
334
|
+
return True
|
335
|
+
|
302
336
|
if command.startswith("/set"):
|
303
337
|
# Syntax: /set KEY=VALUE or /set KEY VALUE
|
304
338
|
from code_puppy.config import set_config_value
|
@@ -14,6 +14,7 @@ from prompt_toolkit import PromptSession
|
|
14
14
|
from prompt_toolkit.completion import Completer, Completion, merge_completers
|
15
15
|
from prompt_toolkit.formatted_text import FormattedText
|
16
16
|
from prompt_toolkit.history import FileHistory
|
17
|
+
from prompt_toolkit.filters import is_searching
|
17
18
|
from prompt_toolkit.key_binding import KeyBindings
|
18
19
|
from prompt_toolkit.keys import Keys
|
19
20
|
from prompt_toolkit.styles import Style
|
@@ -207,12 +208,9 @@ async def get_input_with_combined_completion(
|
|
207
208
|
event.app.current_buffer.insert_text("\n")
|
208
209
|
|
209
210
|
# Override the default enter behavior to check for shift
|
210
|
-
@bindings.add("enter")
|
211
|
+
@bindings.add("enter", filter=~is_searching)
|
211
212
|
def _(event):
|
212
|
-
"""Accept input
|
213
|
-
# Check if shift is pressed - this comes from key press event data
|
214
|
-
# Using a key sequence like Alt+Enter is more reliable than detecting shift
|
215
|
-
# So we'll use the default behavior for Enter
|
213
|
+
"""Accept input only when we're not in an interactive search buffer."""
|
216
214
|
event.current_buffer.validate_and_handle()
|
217
215
|
|
218
216
|
@bindings.add(Keys.Escape)
|
code_puppy/config.py
CHANGED
@@ -120,6 +120,7 @@ def get_config_keys():
|
|
120
120
|
"compaction_threshold",
|
121
121
|
"message_limit",
|
122
122
|
"allow_recursion",
|
123
|
+
"openai_reasoning_effort",
|
123
124
|
]
|
124
125
|
config = configparser.ConfigParser()
|
125
126
|
config.read(CONFIG_FILE)
|
@@ -366,6 +367,26 @@ def set_puppy_token(token: str):
|
|
366
367
|
set_config_value("puppy_token", token)
|
367
368
|
|
368
369
|
|
370
|
+
def get_openai_reasoning_effort() -> str:
|
371
|
+
"""Return the configured OpenAI reasoning effort (low, medium, high)."""
|
372
|
+
allowed_values = {"low", "medium", "high"}
|
373
|
+
configured = (get_value("openai_reasoning_effort") or "medium").strip().lower()
|
374
|
+
if configured not in allowed_values:
|
375
|
+
return "medium"
|
376
|
+
return configured
|
377
|
+
|
378
|
+
|
379
|
+
def set_openai_reasoning_effort(value: str) -> None:
|
380
|
+
"""Persist the OpenAI reasoning effort ensuring it remains within allowed values."""
|
381
|
+
allowed_values = {"low", "medium", "high"}
|
382
|
+
normalized = (value or "").strip().lower()
|
383
|
+
if normalized not in allowed_values:
|
384
|
+
raise ValueError(
|
385
|
+
f"Invalid reasoning effort '{value}'. Allowed: {', '.join(sorted(allowed_values))}"
|
386
|
+
)
|
387
|
+
set_config_value("openai_reasoning_effort", normalized)
|
388
|
+
|
389
|
+
|
369
390
|
def normalize_command_history():
|
370
391
|
"""
|
371
392
|
Normalize the command history file by converting old format timestamps to the new format.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
code_puppy/__init__.py,sha256=ehbM1-wMjNmOXk_DBhhJECFyBv2dRHwwo7ucjHeM68E,107
|
2
2
|
code_puppy/__main__.py,sha256=pDVssJOWP8A83iFkxMLY9YteHYat0EyWDQqMkKHpWp4,203
|
3
3
|
code_puppy/callbacks.py,sha256=ukSgVFaEO68o6J09qFwDrnmNanrVv3toTLQhS504Meo,6162
|
4
|
-
code_puppy/config.py,sha256=
|
4
|
+
code_puppy/config.py,sha256=xAFt2_8z_YrDrq8j-hATgj0ZCEZ9QPu206uJ5-F8FP0,21522
|
5
5
|
code_puppy/http_utils.py,sha256=YLd8Y16idbI32JGeBXG8n5rT4o4X_zxk9FgUvK9XFo8,8248
|
6
6
|
code_puppy/main.py,sha256=PATGAZLxigQ1kp6UIsWgzPTmYHO6EbgaJa6f7OXgWrk,21667
|
7
7
|
code_puppy/model_factory.py,sha256=qI10PM27SOdgeeJk_ncWDEKtWealCRyJLLmxedLpH2s,15410
|
@@ -26,15 +26,15 @@ code_puppy/agents/agent_qa_expert.py,sha256=wCGXzuAVElT5c-QigQVb8JX9Gw0JmViCUQQn
|
|
26
26
|
code_puppy/agents/agent_qa_kitten.py,sha256=5PeFFSwCFlTUvP6h5bGntx0xv5NmRwBiw0HnMqY8nLI,9107
|
27
27
|
code_puppy/agents/agent_security_auditor.py,sha256=ADafi2x4gqXw6m-Nch5vjiKjO0Urcbj0x4zxHti3gDw,3712
|
28
28
|
code_puppy/agents/agent_typescript_reviewer.py,sha256=EDY1mFkVpuJ1BPXsJFu2wQ2pfAV-90ipc_8w9ymrKPg,4054
|
29
|
-
code_puppy/agents/base_agent.py,sha256=
|
29
|
+
code_puppy/agents/base_agent.py,sha256=1eLgJ98va4m8BhHatUeJpnYKM-m35kr36wYo2mYL1-g,39058
|
30
30
|
code_puppy/agents/json_agent.py,sha256=KPS1q-Rr3b5ekem4i3wtu8eLJRDd5nSPiZ8duJ_tn0U,4630
|
31
31
|
code_puppy/command_line/__init__.py,sha256=y7WeRemfYppk8KVbCGeAIiTuiOszIURCDjOMZv_YRmU,45
|
32
|
-
code_puppy/command_line/command_handler.py,sha256=
|
32
|
+
code_puppy/command_line/command_handler.py,sha256=i5VR_d8OErBLV8IFvkFkS0m34Xy2Pe0BH5G1wBrkOSQ,31016
|
33
33
|
code_puppy/command_line/file_path_completion.py,sha256=gw8NpIxa6GOpczUJRyh7VNZwoXKKn-yvCqit7h2y6Gg,2931
|
34
34
|
code_puppy/command_line/load_context_completion.py,sha256=6eZxV6Bs-EFwZjN93V8ZDZUC-6RaWxvtZk-04Wtikyw,2240
|
35
35
|
code_puppy/command_line/model_picker_completion.py,sha256=vYNCZS1QWu6fxF__hTwpc7jwH7h_48wUxrnITawc83E,4140
|
36
36
|
code_puppy/command_line/motd.py,sha256=PEdkp3ZnydVfvd7mNJylm8YyFNUKg9jmY6uwkA1em8c,2152
|
37
|
-
code_puppy/command_line/prompt_toolkit_completion.py,sha256=
|
37
|
+
code_puppy/command_line/prompt_toolkit_completion.py,sha256=NbagxHj950ADRncqXuVM8gAwqdrfKeGfC0x6-IhrsXM,9860
|
38
38
|
code_puppy/command_line/utils.py,sha256=7eyxDHjPjPB9wGDJQQcXV_zOsGdYsFgI0SGCetVmTqE,1251
|
39
39
|
code_puppy/command_line/mcp/__init__.py,sha256=0-OQuwjq_pLiTVJ1_NrirVwdRerghyKs_MTZkwPC7YY,315
|
40
40
|
code_puppy/command_line/mcp/add_command.py,sha256=lZ09RpFDIeghX1zhc2YIAqBASs5Ra52x5YAasUKvqJg,6409
|
@@ -120,9 +120,9 @@ code_puppy/tui/screens/help.py,sha256=eJuPaOOCp7ZSUlecearqsuX6caxWv7NQszUh0tZJjB
|
|
120
120
|
code_puppy/tui/screens/mcp_install_wizard.py,sha256=vObpQwLbXjQsxmSg-WCasoev1usEi0pollKnL0SHu9U,27693
|
121
121
|
code_puppy/tui/screens/settings.py,sha256=-WLldnKyWVKUYVPJcfOn1UU6eP9t8lLPUAVI317SOOM,10685
|
122
122
|
code_puppy/tui/screens/tools.py,sha256=3pr2Xkpa9Js6Yhf1A3_wQVRzFOui-KDB82LwrsdBtyk,1715
|
123
|
-
code_puppy-0.0.
|
124
|
-
code_puppy-0.0.
|
125
|
-
code_puppy-0.0.
|
126
|
-
code_puppy-0.0.
|
127
|
-
code_puppy-0.0.
|
128
|
-
code_puppy-0.0.
|
123
|
+
code_puppy-0.0.192.data/data/code_puppy/models.json,sha256=dClUciCo2RlVDs0ZAQCIur8MOavZUEAXHEecn0uPa-4,1629
|
124
|
+
code_puppy-0.0.192.dist-info/METADATA,sha256=tMiyhp7pbUGTxoltFcDm7oBTgEBXsaN2d9dJ9zeYPLI,19985
|
125
|
+
code_puppy-0.0.192.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
126
|
+
code_puppy-0.0.192.dist-info/entry_points.txt,sha256=Tp4eQC99WY3HOKd3sdvb22vZODRq0XkZVNpXOag_KdI,91
|
127
|
+
code_puppy-0.0.192.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
|
128
|
+
code_puppy-0.0.192.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|