code-puppy 0.0.195__tar.gz → 0.0.196__tar.gz
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-0.0.195 → code_puppy-0.0.196}/PKG-INFO +1 -1
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/command_handler.py +34 -3
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/config.py +37 -16
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/session_storage.py +15 -6
- {code_puppy-0.0.195 → code_puppy-0.0.196}/pyproject.toml +1 -1
- {code_puppy-0.0.195 → code_puppy-0.0.196}/.gitignore +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/LICENSE +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/README.md +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/__main__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_c_reviewer.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_code_puppy.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_code_reviewer.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_cpp_reviewer.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_creator_agent.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_golang_reviewer.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_javascript_reviewer.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_manager.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_python_reviewer.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_qa_expert.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_qa_kitten.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_security_auditor.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/agent_typescript_reviewer.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/base_agent.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/agents/json_agent.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/callbacks.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/file_path_completion.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/load_context_completion.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/add_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/base.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/handler.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/help_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/install_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/list_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/logs_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/remove_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/restart_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/search_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/start_all_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/start_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/status_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/stop_all_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/stop_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/test_command.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/utils.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/mcp/wizard_utils.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/model_picker_completion.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/motd.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/prompt_toolkit_completion.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/utils.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/http_utils.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/main.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/async_lifecycle.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/blocking_startup.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/captured_stdio_server.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/circuit_breaker.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/config_wizard.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/dashboard.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/error_isolation.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/examples/retry_example.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/health_monitor.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/managed_server.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/manager.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/registry.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/retry_manager.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/server_registry_catalog.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/status_tracker.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/mcp_/system_tools.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/messaging/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/messaging/message_queue.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/messaging/queue_console.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/messaging/renderers.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/messaging/spinner/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/messaging/spinner/console_spinner.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/messaging/spinner/spinner_base.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/messaging/spinner/textual_spinner.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/model_factory.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/models.json +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/plugins/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/plugins/example_custom_command/register_callbacks.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/reopenable_async_client.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/round_robin_model.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/status_display.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/summarization_agent.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/agent_tools.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/browser_control.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/browser_interactions.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/browser_locators.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/browser_navigation.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/browser_screenshot.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/browser_scripts.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/browser_workflows.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/camoufox_manager.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/browser/vqa_agent.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/command_runner.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/common.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/file_modifications.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/file_operations.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tools/tools_content.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/app.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/chat_view.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/command_history_modal.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/copy_button.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/custom_widgets.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/human_input_modal.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/input_area.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/sidebar.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/status_bar.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/messages.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/models/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/models/chat_message.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/models/command_history.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/models/enums.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/screens/__init__.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/screens/help.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/screens/mcp_install_wizard.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/screens/settings.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/screens/tools.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui_state.py +0 -0
- {code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/version_checker.py +0 -0
@@ -82,7 +82,7 @@ def get_commands_help():
|
|
82
82
|
help_lines.append(
|
83
83
|
Text("/set", style="cyan")
|
84
84
|
+ Text(
|
85
|
-
" Set puppy config key-values (e.g., /set yolo_mode true, /set auto_save_session true
|
85
|
+
" Set puppy config key-values (e.g., /set yolo_mode true, /set auto_save_session true)"
|
86
86
|
)
|
87
87
|
)
|
88
88
|
help_lines.append(
|
@@ -336,6 +336,30 @@ def handle_command(command: str):
|
|
336
336
|
)
|
337
337
|
return True
|
338
338
|
|
339
|
+
if command.startswith("/session"):
|
340
|
+
# /session id -> show current autosave id
|
341
|
+
# /session new -> rotate autosave id
|
342
|
+
tokens = command.split()
|
343
|
+
from code_puppy.config import (
|
344
|
+
AUTOSAVE_DIR,
|
345
|
+
get_current_autosave_id,
|
346
|
+
get_current_autosave_session_name,
|
347
|
+
rotate_autosave_id,
|
348
|
+
)
|
349
|
+
if len(tokens) == 1 or tokens[1] == "id":
|
350
|
+
sid = get_current_autosave_id()
|
351
|
+
emit_info(
|
352
|
+
f"[bold magenta]Autosave Session[/bold magenta]: {sid}\n"
|
353
|
+
f"Files prefix: {Path(AUTOSAVE_DIR) / get_current_autosave_session_name()}"
|
354
|
+
)
|
355
|
+
return True
|
356
|
+
if tokens[1] == "new":
|
357
|
+
new_sid = rotate_autosave_id()
|
358
|
+
emit_success(f"New autosave session id: {new_sid}")
|
359
|
+
return True
|
360
|
+
emit_warning("Usage: /session [id|new]")
|
361
|
+
return True
|
362
|
+
|
339
363
|
if command.startswith("/set"):
|
340
364
|
# Syntax: /set KEY=VALUE or /set KEY VALUE
|
341
365
|
from code_puppy.config import set_config_value
|
@@ -361,7 +385,6 @@ def handle_command(command: str):
|
|
361
385
|
session_help = (
|
362
386
|
"\n[yellow]Session Management[/yellow]"
|
363
387
|
"\n [cyan]auto_save_session[/cyan] Auto-save chat after every response (true/false)"
|
364
|
-
"\n [cyan]max_saved_sessions[/cyan] Cap how many auto-saves to keep (0 = unlimited)"
|
365
388
|
)
|
366
389
|
emit_warning(
|
367
390
|
f"Usage: /set KEY=VALUE or /set KEY VALUE\nConfig keys: {', '.join(config_keys)}\n[dim]Note: compaction_strategy can be 'summarization' or 'truncation'[/dim]{session_help}"
|
@@ -712,9 +735,17 @@ def handle_command(command: str):
|
|
712
735
|
agent.set_message_history(history)
|
713
736
|
total_tokens = sum(agent.estimate_tokens_for_message(m) for m in history)
|
714
737
|
|
738
|
+
# Rotate autosave id to avoid overwriting any existing autosave
|
739
|
+
try:
|
740
|
+
from code_puppy.config import rotate_autosave_id
|
741
|
+
new_id = rotate_autosave_id()
|
742
|
+
autosave_info = f"\n[dim]Autosave session rotated to: {new_id}[/dim]"
|
743
|
+
except Exception:
|
744
|
+
autosave_info = ""
|
745
|
+
|
715
746
|
emit_success(
|
716
747
|
f"✅ Context loaded: {len(history)} messages ({total_tokens} tokens)\n"
|
717
|
-
f"📁 From: {session_path}"
|
748
|
+
f"📁 From: {session_path}{autosave_info}"
|
718
749
|
)
|
719
750
|
return True
|
720
751
|
|
@@ -3,8 +3,9 @@ import datetime
|
|
3
3
|
import json
|
4
4
|
import os
|
5
5
|
import pathlib
|
6
|
+
from typing import Optional
|
6
7
|
|
7
|
-
from code_puppy.session_storage import
|
8
|
+
from code_puppy.session_storage import save_session
|
8
9
|
|
9
10
|
CONFIG_DIR = os.path.join(os.path.expanduser("~"), ".code_puppy")
|
10
11
|
CONFIG_FILE = os.path.join(CONFIG_DIR, "puppy.cfg")
|
@@ -19,6 +20,9 @@ AUTOSAVE_DIR = os.path.join(CONFIG_DIR, "autosaves")
|
|
19
20
|
DEFAULT_SECTION = "puppy"
|
20
21
|
REQUIRED_KEYS = ["puppy_name", "owner_name"]
|
21
22
|
|
23
|
+
# Runtime-only autosave session ID (per-process)
|
24
|
+
_CURRENT_AUTOSAVE_ID: Optional[str] = None
|
25
|
+
|
22
26
|
# Cache containers for model validation and defaults
|
23
27
|
_model_validation_cache = {}
|
24
28
|
_default_model_cache = None
|
@@ -702,22 +706,40 @@ def set_max_saved_sessions(max_sessions: int):
|
|
702
706
|
set_config_value("max_saved_sessions", str(max_sessions))
|
703
707
|
|
704
708
|
|
705
|
-
def
|
706
|
-
"""
|
707
|
-
|
708
|
-
if
|
709
|
-
|
709
|
+
def get_current_autosave_id() -> str:
|
710
|
+
"""Get or create the current autosave session ID for this process."""
|
711
|
+
global _CURRENT_AUTOSAVE_ID
|
712
|
+
if not _CURRENT_AUTOSAVE_ID:
|
713
|
+
# Use a full timestamp so tests and UX can predict the name if needed
|
714
|
+
_CURRENT_AUTOSAVE_ID = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')
|
715
|
+
return _CURRENT_AUTOSAVE_ID
|
710
716
|
|
711
|
-
autosave_dir = pathlib.Path(AUTOSAVE_DIR)
|
712
|
-
removed_sessions = cleanup_sessions(autosave_dir, max_sessions)
|
713
|
-
if not removed_sessions:
|
714
|
-
return
|
715
717
|
|
716
|
-
|
718
|
+
def rotate_autosave_id() -> str:
|
719
|
+
"""Force a new autosave session ID and return it."""
|
720
|
+
global _CURRENT_AUTOSAVE_ID
|
721
|
+
_CURRENT_AUTOSAVE_ID = datetime.datetime.now().strftime('%Y%m%d_%H%M%S')
|
722
|
+
return _CURRENT_AUTOSAVE_ID
|
723
|
+
|
717
724
|
|
718
|
-
|
719
|
-
for
|
720
|
-
|
725
|
+
def get_current_autosave_session_name() -> str:
|
726
|
+
"""Return the full session name used for autosaves (no file extension)."""
|
727
|
+
return f"auto_session_{get_current_autosave_id()}"
|
728
|
+
|
729
|
+
|
730
|
+
def set_current_autosave_from_session_name(session_name: str) -> str:
|
731
|
+
"""Set the current autosave ID based on a full session name.
|
732
|
+
|
733
|
+
Accepts names like 'auto_session_YYYYMMDD_HHMMSS' and extracts the ID part.
|
734
|
+
Returns the ID that was set.
|
735
|
+
"""
|
736
|
+
global _CURRENT_AUTOSAVE_ID
|
737
|
+
prefix = "auto_session_"
|
738
|
+
if session_name.startswith(prefix):
|
739
|
+
_CURRENT_AUTOSAVE_ID = session_name[len(prefix):]
|
740
|
+
else:
|
741
|
+
_CURRENT_AUTOSAVE_ID = session_name
|
742
|
+
return _CURRENT_AUTOSAVE_ID
|
721
743
|
|
722
744
|
|
723
745
|
def auto_save_session_if_enabled() -> bool:
|
@@ -739,7 +761,7 @@ def auto_save_session_if_enabled() -> bool:
|
|
739
761
|
return False
|
740
762
|
|
741
763
|
now = datetime.datetime.now()
|
742
|
-
session_name =
|
764
|
+
session_name = get_current_autosave_session_name()
|
743
765
|
autosave_dir = pathlib.Path(AUTOSAVE_DIR)
|
744
766
|
|
745
767
|
metadata = save_session(
|
@@ -755,7 +777,6 @@ def auto_save_session_if_enabled() -> bool:
|
|
755
777
|
f"🐾 [dim]Auto-saved session: {metadata.message_count} messages ({metadata.total_tokens} tokens)[/dim]"
|
756
778
|
)
|
757
779
|
|
758
|
-
_cleanup_old_sessions()
|
759
780
|
return True
|
760
781
|
|
761
782
|
except Exception as exc: # pragma: no cover - defensive logging
|
@@ -96,6 +96,12 @@ def load_session(session_name: str, base_dir: Path) -> SessionHistory:
|
|
96
96
|
return pickle.load(pickle_file)
|
97
97
|
|
98
98
|
|
99
|
+
def list_sessions(base_dir: Path) -> List[str]:
|
100
|
+
if not base_dir.exists():
|
101
|
+
return []
|
102
|
+
return sorted(path.stem for path in base_dir.glob("*.pkl"))
|
103
|
+
|
104
|
+
|
99
105
|
def cleanup_sessions(base_dir: Path, max_sessions: int) -> List[str]:
|
100
106
|
if max_sessions <= 0:
|
101
107
|
return []
|
@@ -126,12 +132,6 @@ def cleanup_sessions(base_dir: Path, max_sessions: int) -> List[str]:
|
|
126
132
|
return removed_sessions
|
127
133
|
|
128
134
|
|
129
|
-
def list_sessions(base_dir: Path) -> List[str]:
|
130
|
-
if not base_dir.exists():
|
131
|
-
return []
|
132
|
-
return sorted(path.stem for path in base_dir.glob("*.pkl"))
|
133
|
-
|
134
|
-
|
135
135
|
async def restore_autosave_interactively(base_dir: Path) -> None:
|
136
136
|
"""Prompt the user to load an autosave session from base_dir, if any exist.
|
137
137
|
|
@@ -232,6 +232,15 @@ async def restore_autosave_interactively(base_dir: Path) -> None:
|
|
232
232
|
|
233
233
|
agent = get_current_agent()
|
234
234
|
agent.set_message_history(history)
|
235
|
+
|
236
|
+
# Set current autosave session id so subsequent autosaves overwrite this session
|
237
|
+
try:
|
238
|
+
from code_puppy.config import set_current_autosave_from_session_name
|
239
|
+
|
240
|
+
set_current_autosave_from_session_name(chosen_name)
|
241
|
+
except Exception:
|
242
|
+
pass
|
243
|
+
|
235
244
|
total_tokens = sum(agent.estimate_tokens_for_message(msg) for msg in history)
|
236
245
|
|
237
246
|
session_path = base_dir / f"{chosen_name}.pkl"
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/load_context_completion.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/model_picker_completion.py
RENAMED
File without changes
|
File without changes
|
{code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/command_line/prompt_toolkit_completion.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{code_puppy-0.0.195 → code_puppy-0.0.196}/code_puppy/tui/components/command_history_modal.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|