code-puppy 0.0.345__tar.gz → 0.0.346__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.345 → code_puppy-0.0.346}/PKG-INFO +23 -1
- {code_puppy-0.0.345 → code_puppy-0.0.346}/README.md +21 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/base_agent.py +129 -37
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/cli_runner.py +35 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/config_commands.py +10 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/config.py +23 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/summarization_agent.py +11 -1
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/agent_tools.py +55 -11
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/vqa_agent.py +7 -1
- {code_puppy-0.0.345 → code_puppy-0.0.346}/pyproject.toml +2 -1
- {code_puppy-0.0.345 → code_puppy-0.0.346}/.gitignore +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/LICENSE +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/__main__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_c_reviewer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_code_puppy.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_code_reviewer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_cpp_reviewer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_creator_agent.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_golang_reviewer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_javascript_reviewer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_manager.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_planning.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_python_programmer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_python_reviewer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_qa_expert.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_qa_kitten.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_security_auditor.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/agent_typescript_reviewer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/json_agent.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/agents/prompt_reviewer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/callbacks.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/chatgpt_codex_client.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/claude_cache_client.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/add_model_menu.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/attachments.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/autosave_menu.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/clipboard.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/colors_menu.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/command_handler.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/command_registry.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/core_commands.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/diff_menu.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/file_path_completion.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/load_context_completion.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/base.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/catalog_server_installer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/custom_server_form.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/custom_server_installer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/edit_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/handler.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/help_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/install_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/install_menu.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/list_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/logs_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/remove_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/restart_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/search_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/start_all_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/start_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/status_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/stop_all_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/stop_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/test_command.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp/wizard_utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/mcp_completion.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/model_picker_completion.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/model_settings_menu.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/motd.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/onboarding_slides.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/onboarding_wizard.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/pin_command_completion.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/prompt_toolkit_completion.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/session_commands.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/command_line/utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/error_logging.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/gemini_code_assist.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/http_utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/keymap.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/main.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/async_lifecycle.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/blocking_startup.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/captured_stdio_server.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/circuit_breaker.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/config_wizard.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/dashboard.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/error_isolation.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/examples/retry_example.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/health_monitor.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/managed_server.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/manager.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/mcp_logs.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/registry.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/retry_manager.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/server_registry_catalog.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/status_tracker.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/mcp_/system_tools.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/bus.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/commands.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/markdown_patches.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/message_queue.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/messages.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/queue_console.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/renderers.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/rich_renderer.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/spinner/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/spinner/console_spinner.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/messaging/spinner/spinner_base.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/model_factory.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/model_utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/models.json +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/models_dev_api.json +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/models_dev_parser.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/accounts.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/antigravity_model.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/config.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/constants.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/oauth.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/register_callbacks.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/storage.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/test_plugin.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/token.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/transport.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/antigravity_oauth/utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/chatgpt_oauth/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/chatgpt_oauth/config.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/chatgpt_oauth/oauth_flow.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/chatgpt_oauth/register_callbacks.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/chatgpt_oauth/test_plugin.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/chatgpt_oauth/utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/claude_code_oauth/README.md +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/claude_code_oauth/SETUP.md +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/claude_code_oauth/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/claude_code_oauth/config.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/claude_code_oauth/register_callbacks.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/claude_code_oauth/test_plugin.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/claude_code_oauth/utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/customizable_commands/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/customizable_commands/register_callbacks.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/example_custom_command/README.md +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/example_custom_command/register_callbacks.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/file_permission_handler/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/file_permission_handler/register_callbacks.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/oauth_puppy_html.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/shell_safety/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/shell_safety/agent_shell_safety.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/shell_safety/command_cache.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/plugins/shell_safety/register_callbacks.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/prompts/codex_system_prompt.md +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/pydantic_patches.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/reopenable_async_client.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/round_robin_model.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/session_storage.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/status_display.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/terminal_utils.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/__init__.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/browser_control.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/browser_interactions.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/browser_locators.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/browser_navigation.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/browser_screenshot.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/browser_scripts.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/browser_workflows.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/browser/camoufox_manager.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/command_runner.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/common.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/file_modifications.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/file_operations.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/tools/tools_content.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/uvx_detection.py +0 -0
- {code_puppy-0.0.345 → code_puppy-0.0.346}/code_puppy/version_checker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-puppy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.346
|
|
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
|
|
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
16
16
|
Classifier: Topic :: Software Development :: Code Generators
|
|
17
17
|
Requires-Python: <3.14,>=3.11
|
|
18
18
|
Requires-Dist: camoufox>=0.4.11
|
|
19
|
+
Requires-Dist: dbos>=2.5.0
|
|
19
20
|
Requires-Dist: fastapi>=0.111.0
|
|
20
21
|
Requires-Dist: httpx[http2]>=0.24.1
|
|
21
22
|
Requires-Dist: json-repair>=0.46.2
|
|
@@ -173,6 +174,27 @@ These providers are automatically configured with correct OpenAI-compatible endp
|
|
|
173
174
|
- **⚠️ Unsupported Providers** - Providers like Amazon Bedrock and Google Vertex that require special authentication are clearly marked
|
|
174
175
|
- **⚠️ No Tool Calling** - Models without tool calling support show a big warning since they can't use Code Puppy's file/shell tools
|
|
175
176
|
|
|
177
|
+
### Durable Execution
|
|
178
|
+
|
|
179
|
+
Code Puppy now supports **[DBOS](https://github.com/dbos-inc/dbos-transact-py)** durable execution.
|
|
180
|
+
|
|
181
|
+
When enabled, every agent is automatically wrapped as a `DBOSAgent`, checkpointing key interactions (including agent inputs, LLM responses, MCP calls, and tool calls) in a database for durability and recovery.
|
|
182
|
+
|
|
183
|
+
You can toggle DBOS via either of these options:
|
|
184
|
+
|
|
185
|
+
- CLI config (persists): `/set enable_dbos true` (or `false` to disable)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
Config takes precedence if set; otherwise the environment variable is used.
|
|
189
|
+
|
|
190
|
+
### Configuration
|
|
191
|
+
|
|
192
|
+
The following environment variables control DBOS behavior:
|
|
193
|
+
- `DBOS_CONDUCTOR_KEY`: If set, Code Puppy connects to the [DBOS Management Console](https://console.dbos.dev/). Make sure you first register an app named `dbos-code-puppy` on the console to generate a Conductor key. Default: `None`.
|
|
194
|
+
- `DBOS_LOG_LEVEL`: Logging verbosity: `CRITICAL`, `ERROR`, `WARNING`, `INFO`, or `DEBUG`. Default: `ERROR`.
|
|
195
|
+
- `DBOS_SYSTEM_DATABASE_URL`: Database URL used by DBOS. Can point to a local SQLite file or a Postgres instance. Example: `postgresql://postgres:dbos@localhost:5432/postgres`. Default: `dbos_store.sqlite` file in the config directory.
|
|
196
|
+
- `DBOS_APP_VERSION`: If set, Code Puppy uses it as the [DBOS application version](https://docs.dbos.dev/architecture#application-and-workflow-versions) and automatically tries to recover pending workflows for this version. Default: Code Puppy version + Unix timestamp in millisecond (disable automatic recovery).
|
|
197
|
+
|
|
176
198
|
### Custom Commands
|
|
177
199
|
Create markdown files in `.claude/commands/`, `.github/prompts/`, or `.agents/commands/` to define custom slash commands. The filename becomes the command name and the content runs as a prompt.
|
|
178
200
|
|
|
@@ -133,6 +133,27 @@ These providers are automatically configured with correct OpenAI-compatible endp
|
|
|
133
133
|
- **⚠️ Unsupported Providers** - Providers like Amazon Bedrock and Google Vertex that require special authentication are clearly marked
|
|
134
134
|
- **⚠️ No Tool Calling** - Models without tool calling support show a big warning since they can't use Code Puppy's file/shell tools
|
|
135
135
|
|
|
136
|
+
### Durable Execution
|
|
137
|
+
|
|
138
|
+
Code Puppy now supports **[DBOS](https://github.com/dbos-inc/dbos-transact-py)** durable execution.
|
|
139
|
+
|
|
140
|
+
When enabled, every agent is automatically wrapped as a `DBOSAgent`, checkpointing key interactions (including agent inputs, LLM responses, MCP calls, and tool calls) in a database for durability and recovery.
|
|
141
|
+
|
|
142
|
+
You can toggle DBOS via either of these options:
|
|
143
|
+
|
|
144
|
+
- CLI config (persists): `/set enable_dbos true` (or `false` to disable)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
Config takes precedence if set; otherwise the environment variable is used.
|
|
148
|
+
|
|
149
|
+
### Configuration
|
|
150
|
+
|
|
151
|
+
The following environment variables control DBOS behavior:
|
|
152
|
+
- `DBOS_CONDUCTOR_KEY`: If set, Code Puppy connects to the [DBOS Management Console](https://console.dbos.dev/). Make sure you first register an app named `dbos-code-puppy` on the console to generate a Conductor key. Default: `None`.
|
|
153
|
+
- `DBOS_LOG_LEVEL`: Logging verbosity: `CRITICAL`, `ERROR`, `WARNING`, `INFO`, or `DEBUG`. Default: `ERROR`.
|
|
154
|
+
- `DBOS_SYSTEM_DATABASE_URL`: Database URL used by DBOS. Can point to a local SQLite file or a Postgres instance. Example: `postgresql://postgres:dbos@localhost:5432/postgres`. Default: `dbos_store.sqlite` file in the config directory.
|
|
155
|
+
- `DBOS_APP_VERSION`: If set, Code Puppy uses it as the [DBOS application version](https://docs.dbos.dev/architecture#application-and-workflow-versions) and automatically tries to recover pending workflows for this version. Default: Code Puppy version + Unix timestamp in millisecond (disable automatic recovery).
|
|
156
|
+
|
|
136
157
|
### Custom Commands
|
|
137
158
|
Create markdown files in `.claude/commands/`, `.github/prompts/`, or `.agents/commands/` to define custom slash commands. The filename becomes the command name and the content runs as a prompt.
|
|
138
159
|
|
|
@@ -24,6 +24,7 @@ from typing import (
|
|
|
24
24
|
import mcp
|
|
25
25
|
import pydantic
|
|
26
26
|
import pydantic_ai.models
|
|
27
|
+
from dbos import DBOS, SetWorkflowID
|
|
27
28
|
from pydantic_ai import Agent as PydanticAgent
|
|
28
29
|
from pydantic_ai import (
|
|
29
30
|
BinaryContent,
|
|
@@ -34,6 +35,7 @@ from pydantic_ai import (
|
|
|
34
35
|
UsageLimitExceeded,
|
|
35
36
|
UsageLimits,
|
|
36
37
|
)
|
|
38
|
+
from pydantic_ai.durable_exec.dbos import DBOSAgent
|
|
37
39
|
from pydantic_ai.messages import (
|
|
38
40
|
ModelMessage,
|
|
39
41
|
ModelRequest,
|
|
@@ -54,6 +56,7 @@ from code_puppy.config import (
|
|
|
54
56
|
get_global_model_name,
|
|
55
57
|
get_message_limit,
|
|
56
58
|
get_protected_token_count,
|
|
59
|
+
get_use_dbos,
|
|
57
60
|
get_value,
|
|
58
61
|
)
|
|
59
62
|
from code_puppy.error_logging import log_error
|
|
@@ -1209,25 +1212,56 @@ class BaseAgent(ABC):
|
|
|
1209
1212
|
|
|
1210
1213
|
self._last_model_name = resolved_model_name
|
|
1211
1214
|
# expose for run_with_mcp
|
|
1215
|
+
# Wrap it with DBOS, but handle MCP servers separately to avoid serialization issues
|
|
1212
1216
|
global _reload_count
|
|
1213
1217
|
_reload_count += 1
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1218
|
+
if get_use_dbos():
|
|
1219
|
+
# Don't pass MCP servers to the agent constructor when using DBOS
|
|
1220
|
+
# This prevents the "cannot pickle async_generator object" error
|
|
1221
|
+
# MCP servers will be handled separately in run_with_mcp
|
|
1222
|
+
agent_without_mcp = PydanticAgent(
|
|
1223
|
+
model=model,
|
|
1224
|
+
instructions=instructions,
|
|
1225
|
+
output_type=str,
|
|
1226
|
+
retries=3,
|
|
1227
|
+
toolsets=[], # Don't include MCP servers here
|
|
1228
|
+
history_processors=[self.message_history_accumulator],
|
|
1229
|
+
model_settings=model_settings,
|
|
1230
|
+
)
|
|
1231
|
+
|
|
1232
|
+
# Register regular tools (non-MCP) on the new agent
|
|
1233
|
+
agent_tools = self.get_available_tools()
|
|
1234
|
+
register_tools_for_agent(agent_without_mcp, agent_tools)
|
|
1235
|
+
|
|
1236
|
+
# Wrap with DBOS
|
|
1237
|
+
dbos_agent = DBOSAgent(
|
|
1238
|
+
agent_without_mcp, name=f"{self.name}-{_reload_count}"
|
|
1239
|
+
)
|
|
1240
|
+
self.pydantic_agent = dbos_agent
|
|
1241
|
+
self._code_generation_agent = dbos_agent
|
|
1227
1242
|
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1243
|
+
# Store filtered MCP servers separately for runtime use
|
|
1244
|
+
self._mcp_servers = filtered_mcp_servers
|
|
1245
|
+
else:
|
|
1246
|
+
# Normal path without DBOS - include filtered MCP servers in the agent
|
|
1247
|
+
# Re-create agent with filtered MCP servers
|
|
1248
|
+
p_agent = PydanticAgent(
|
|
1249
|
+
model=model,
|
|
1250
|
+
instructions=instructions,
|
|
1251
|
+
output_type=str,
|
|
1252
|
+
retries=3,
|
|
1253
|
+
toolsets=filtered_mcp_servers,
|
|
1254
|
+
history_processors=[self.message_history_accumulator],
|
|
1255
|
+
model_settings=model_settings,
|
|
1256
|
+
)
|
|
1257
|
+
# Register regular tools on the agent
|
|
1258
|
+
agent_tools = self.get_available_tools()
|
|
1259
|
+
register_tools_for_agent(p_agent, agent_tools)
|
|
1260
|
+
|
|
1261
|
+
self.pydantic_agent = p_agent
|
|
1262
|
+
self._code_generation_agent = p_agent
|
|
1263
|
+
self._mcp_servers = filtered_mcp_servers
|
|
1264
|
+
self._mcp_servers = mcp_servers
|
|
1231
1265
|
return self._code_generation_agent
|
|
1232
1266
|
|
|
1233
1267
|
def _create_agent_with_output_type(self, output_type: Type[Any]) -> PydanticAgent:
|
|
@@ -1241,7 +1275,7 @@ class BaseAgent(ABC):
|
|
|
1241
1275
|
output_type: The Pydantic model or type for structured output.
|
|
1242
1276
|
|
|
1243
1277
|
Returns:
|
|
1244
|
-
A configured PydanticAgent with the custom output_type.
|
|
1278
|
+
A configured PydanticAgent (or DBOSAgent wrapper) with the custom output_type.
|
|
1245
1279
|
"""
|
|
1246
1280
|
from code_puppy.model_utils import prepare_prompt_for_model
|
|
1247
1281
|
from code_puppy.tools import register_tools_for_agent
|
|
@@ -1268,19 +1302,38 @@ class BaseAgent(ABC):
|
|
|
1268
1302
|
global _reload_count
|
|
1269
1303
|
_reload_count += 1
|
|
1270
1304
|
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1305
|
+
if get_use_dbos():
|
|
1306
|
+
temp_agent = PydanticAgent(
|
|
1307
|
+
model=model,
|
|
1308
|
+
instructions=instructions,
|
|
1309
|
+
output_type=output_type,
|
|
1310
|
+
retries=3,
|
|
1311
|
+
toolsets=[],
|
|
1312
|
+
history_processors=[self.message_history_accumulator],
|
|
1313
|
+
model_settings=model_settings,
|
|
1314
|
+
)
|
|
1315
|
+
agent_tools = self.get_available_tools()
|
|
1316
|
+
register_tools_for_agent(temp_agent, agent_tools)
|
|
1317
|
+
dbos_agent = DBOSAgent(
|
|
1318
|
+
temp_agent, name=f"{self.name}-structured-{_reload_count}"
|
|
1319
|
+
)
|
|
1320
|
+
return dbos_agent
|
|
1321
|
+
else:
|
|
1322
|
+
temp_agent = PydanticAgent(
|
|
1323
|
+
model=model,
|
|
1324
|
+
instructions=instructions,
|
|
1325
|
+
output_type=output_type,
|
|
1326
|
+
retries=3,
|
|
1327
|
+
toolsets=mcp_servers,
|
|
1328
|
+
history_processors=[self.message_history_accumulator],
|
|
1329
|
+
model_settings=model_settings,
|
|
1330
|
+
)
|
|
1331
|
+
agent_tools = self.get_available_tools()
|
|
1332
|
+
register_tools_for_agent(temp_agent, agent_tools)
|
|
1333
|
+
return temp_agent
|
|
1283
1334
|
|
|
1335
|
+
# It's okay to decorate it with DBOS.step even if not using DBOS; the decorator is a no-op in that case.
|
|
1336
|
+
@DBOS.step()
|
|
1284
1337
|
def message_history_accumulator(self, ctx: RunContext, messages: List[Any]):
|
|
1285
1338
|
_message_history = self.get_message_history()
|
|
1286
1339
|
message_history_hashes = set([self.hash_message(m) for m in _message_history])
|
|
@@ -1788,14 +1841,49 @@ class BaseAgent(ABC):
|
|
|
1788
1841
|
|
|
1789
1842
|
usage_limits = UsageLimits(request_limit=get_message_limit())
|
|
1790
1843
|
|
|
1791
|
-
# MCP servers
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1844
|
+
# Handle MCP servers - add them temporarily when using DBOS
|
|
1845
|
+
if (
|
|
1846
|
+
get_use_dbos()
|
|
1847
|
+
and hasattr(self, "_mcp_servers")
|
|
1848
|
+
and self._mcp_servers
|
|
1849
|
+
):
|
|
1850
|
+
# Temporarily add MCP servers to the DBOS agent using internal _toolsets
|
|
1851
|
+
original_toolsets = pydantic_agent._toolsets
|
|
1852
|
+
pydantic_agent._toolsets = original_toolsets + self._mcp_servers
|
|
1853
|
+
pydantic_agent._toolsets = original_toolsets + self._mcp_servers
|
|
1854
|
+
|
|
1855
|
+
try:
|
|
1856
|
+
# Set the workflow ID for DBOS context so DBOS and Code Puppy ID match
|
|
1857
|
+
with SetWorkflowID(group_id):
|
|
1858
|
+
result_ = await pydantic_agent.run(
|
|
1859
|
+
prompt_payload,
|
|
1860
|
+
message_history=self.get_message_history(),
|
|
1861
|
+
usage_limits=usage_limits,
|
|
1862
|
+
event_stream_handler=self._event_stream_handler,
|
|
1863
|
+
**kwargs,
|
|
1864
|
+
)
|
|
1865
|
+
finally:
|
|
1866
|
+
# Always restore original toolsets
|
|
1867
|
+
pydantic_agent._toolsets = original_toolsets
|
|
1868
|
+
elif get_use_dbos():
|
|
1869
|
+
# DBOS without MCP servers
|
|
1870
|
+
with SetWorkflowID(group_id):
|
|
1871
|
+
result_ = await pydantic_agent.run(
|
|
1872
|
+
prompt_payload,
|
|
1873
|
+
message_history=self.get_message_history(),
|
|
1874
|
+
usage_limits=usage_limits,
|
|
1875
|
+
event_stream_handler=self._event_stream_handler,
|
|
1876
|
+
**kwargs,
|
|
1877
|
+
)
|
|
1878
|
+
else:
|
|
1879
|
+
# Non-DBOS path (MCP servers are already included)
|
|
1880
|
+
result_ = await pydantic_agent.run(
|
|
1881
|
+
prompt_payload,
|
|
1882
|
+
message_history=self.get_message_history(),
|
|
1883
|
+
usage_limits=usage_limits,
|
|
1884
|
+
event_stream_handler=self._event_stream_handler,
|
|
1885
|
+
**kwargs,
|
|
1886
|
+
)
|
|
1799
1887
|
return result_
|
|
1800
1888
|
except* UsageLimitExceeded as ule:
|
|
1801
1889
|
emit_info(f"Usage limit exceeded: {str(ule)}", group_id=group_id)
|
|
@@ -1811,8 +1899,12 @@ class BaseAgent(ABC):
|
|
|
1811
1899
|
)
|
|
1812
1900
|
except* asyncio.exceptions.CancelledError:
|
|
1813
1901
|
emit_info("Cancelled")
|
|
1902
|
+
if get_use_dbos():
|
|
1903
|
+
await DBOS.cancel_workflow_async(group_id)
|
|
1814
1904
|
except* InterruptedError as ie:
|
|
1815
1905
|
emit_info(f"Interrupted: {str(ie)}")
|
|
1906
|
+
if get_use_dbos():
|
|
1907
|
+
await DBOS.cancel_workflow_async(group_id)
|
|
1816
1908
|
except* Exception as other_error:
|
|
1817
1909
|
# Filter out CancelledError and UsageLimitExceeded from the exception group - let it propagate
|
|
1818
1910
|
remaining_exceptions = []
|
|
@@ -12,9 +12,11 @@ import argparse
|
|
|
12
12
|
import asyncio
|
|
13
13
|
import os
|
|
14
14
|
import sys
|
|
15
|
+
import time
|
|
15
16
|
import traceback
|
|
16
17
|
from pathlib import Path
|
|
17
18
|
|
|
19
|
+
from dbos import DBOS, DBOSConfig
|
|
18
20
|
from rich.console import Console
|
|
19
21
|
|
|
20
22
|
from code_puppy import __version__, callbacks, plugins
|
|
@@ -24,8 +26,10 @@ from code_puppy.command_line.clipboard import get_clipboard_manager
|
|
|
24
26
|
from code_puppy.config import (
|
|
25
27
|
AUTOSAVE_DIR,
|
|
26
28
|
COMMAND_HISTORY_FILE,
|
|
29
|
+
DBOS_DATABASE_URL,
|
|
27
30
|
ensure_config_exists,
|
|
28
31
|
finalize_autosave_session,
|
|
32
|
+
get_use_dbos,
|
|
29
33
|
initialize_command_history_file,
|
|
30
34
|
save_command_to_history,
|
|
31
35
|
)
|
|
@@ -283,6 +287,33 @@ async def main():
|
|
|
283
287
|
|
|
284
288
|
await callbacks.on_startup()
|
|
285
289
|
|
|
290
|
+
# Initialize DBOS if not disabled
|
|
291
|
+
if get_use_dbos():
|
|
292
|
+
# Append a Unix timestamp in ms to the version for uniqueness
|
|
293
|
+
dbos_app_version = os.environ.get(
|
|
294
|
+
"DBOS_APP_VERSION", f"{current_version}-{int(time.time() * 1000)}"
|
|
295
|
+
)
|
|
296
|
+
dbos_config: DBOSConfig = {
|
|
297
|
+
"name": "dbos-code-puppy",
|
|
298
|
+
"system_database_url": DBOS_DATABASE_URL,
|
|
299
|
+
"run_admin_server": False,
|
|
300
|
+
"conductor_key": os.environ.get(
|
|
301
|
+
"DBOS_CONDUCTOR_KEY"
|
|
302
|
+
), # Optional, if set in env, connect to conductor
|
|
303
|
+
"log_level": os.environ.get(
|
|
304
|
+
"DBOS_LOG_LEVEL", "ERROR"
|
|
305
|
+
), # Default to ERROR level to suppress verbose logs
|
|
306
|
+
"application_version": dbos_app_version, # Match DBOS app version to Code Puppy version
|
|
307
|
+
}
|
|
308
|
+
try:
|
|
309
|
+
DBOS(config=dbos_config)
|
|
310
|
+
DBOS.launch()
|
|
311
|
+
except Exception as e:
|
|
312
|
+
emit_error(f"Error initializing DBOS: {e}")
|
|
313
|
+
sys.exit(1)
|
|
314
|
+
else:
|
|
315
|
+
pass
|
|
316
|
+
|
|
286
317
|
global shutdown_flag
|
|
287
318
|
shutdown_flag = False
|
|
288
319
|
try:
|
|
@@ -307,6 +338,8 @@ async def main():
|
|
|
307
338
|
if bus_renderer:
|
|
308
339
|
bus_renderer.stop()
|
|
309
340
|
await callbacks.on_shutdown()
|
|
341
|
+
if get_use_dbos():
|
|
342
|
+
DBOS.destroy()
|
|
310
343
|
|
|
311
344
|
|
|
312
345
|
async def interactive_mode(message_renderer, initial_command: str = None) -> None:
|
|
@@ -874,6 +907,8 @@ def main_entry():
|
|
|
874
907
|
except KeyboardInterrupt:
|
|
875
908
|
# Note: Using sys.stderr for crash output - messaging system may not be available
|
|
876
909
|
sys.stderr.write(traceback.format_exc())
|
|
910
|
+
if get_use_dbos():
|
|
911
|
+
DBOS.destroy()
|
|
877
912
|
return 0
|
|
878
913
|
finally:
|
|
879
914
|
# Reset terminal on Unix-like systems (not Windows)
|
|
@@ -43,6 +43,7 @@ def handle_show_command(command: str) -> bool:
|
|
|
43
43
|
get_protected_token_count,
|
|
44
44
|
get_puppy_name,
|
|
45
45
|
get_temperature,
|
|
46
|
+
get_use_dbos,
|
|
46
47
|
get_yolo_mode,
|
|
47
48
|
)
|
|
48
49
|
from code_puppy.keymap import get_cancel_agent_display_name
|
|
@@ -71,6 +72,7 @@ def handle_show_command(command: str) -> bool:
|
|
|
71
72
|
[bold]default_agent:[/bold] [cyan]{default_agent}[/cyan]
|
|
72
73
|
[bold]model:[/bold] [green]{model}[/green]
|
|
73
74
|
[bold]YOLO_MODE:[/bold] {"[red]ON[/red]" if yolo_mode else "[yellow]off[/yellow]"}
|
|
75
|
+
[bold]DBOS:[/bold] {"[green]enabled[/green]" if get_use_dbos() else "[yellow]disabled[/yellow]"} (toggle: /set enable_dbos true|false)
|
|
74
76
|
[bold]auto_save_session:[/bold] {"[green]enabled[/green]" if auto_save else "[yellow]disabled[/yellow]"}
|
|
75
77
|
[bold]protected_tokens:[/bold] [cyan]{protected_tokens:,}[/cyan] recent tokens preserved
|
|
76
78
|
[bold]compaction_threshold:[/bold] [cyan]{compaction_threshold:.1%}[/cyan] context usage triggers compaction
|
|
@@ -211,6 +213,14 @@ def handle_set_command(command: str) -> bool:
|
|
|
211
213
|
)
|
|
212
214
|
return True
|
|
213
215
|
if key:
|
|
216
|
+
# Check if we're toggling DBOS enablement
|
|
217
|
+
if key == "enable_dbos":
|
|
218
|
+
emit_info(
|
|
219
|
+
Text.from_markup(
|
|
220
|
+
"[yellow]⚠️ DBOS configuration changed. Please restart Code Puppy for this change to take effect.[/yellow]"
|
|
221
|
+
)
|
|
222
|
+
)
|
|
223
|
+
|
|
214
224
|
# Validate cancel_agent_key before setting
|
|
215
225
|
if key == "cancel_agent_key":
|
|
216
226
|
from code_puppy.keymap import VALID_CANCEL_KEYS
|
|
@@ -47,6 +47,7 @@ MODELS_FILE = os.path.join(DATA_DIR, "models.json")
|
|
|
47
47
|
EXTRA_MODELS_FILE = os.path.join(DATA_DIR, "extra_models.json")
|
|
48
48
|
AGENTS_DIR = os.path.join(DATA_DIR, "agents")
|
|
49
49
|
CONTEXTS_DIR = os.path.join(DATA_DIR, "contexts")
|
|
50
|
+
_DEFAULT_SQLITE_FILE = os.path.join(DATA_DIR, "dbos_store.sqlite")
|
|
50
51
|
|
|
51
52
|
# OAuth plugin model files (XDG_DATA_HOME)
|
|
52
53
|
GEMINI_MODELS_FILE = os.path.join(DATA_DIR, "gemini_models.json")
|
|
@@ -59,6 +60,21 @@ AUTOSAVE_DIR = os.path.join(CACHE_DIR, "autosaves")
|
|
|
59
60
|
|
|
60
61
|
# State files (XDG_STATE_HOME)
|
|
61
62
|
COMMAND_HISTORY_FILE = os.path.join(STATE_DIR, "command_history.txt")
|
|
63
|
+
DBOS_DATABASE_URL = os.environ.get(
|
|
64
|
+
"DBOS_SYSTEM_DATABASE_URL", f"sqlite:///{_DEFAULT_SQLITE_FILE}"
|
|
65
|
+
)
|
|
66
|
+
# DBOS enable switch is controlled solely via puppy.cfg using key 'enable_dbos'.
|
|
67
|
+
# Default: False (DBOS disabled) unless explicitly enabled.
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def get_use_dbos() -> bool:
|
|
71
|
+
"""Return True if DBOS should be used based on 'enable_dbos' (default False)."""
|
|
72
|
+
cfg_val = get_value("enable_dbos")
|
|
73
|
+
if cfg_val is None:
|
|
74
|
+
return False
|
|
75
|
+
return str(cfg_val).strip().lower() in {"1", "true", "yes", "on"}
|
|
76
|
+
|
|
77
|
+
|
|
62
78
|
DEFAULT_SECTION = "puppy"
|
|
63
79
|
REQUIRED_KEYS = ["puppy_name", "owner_name"]
|
|
64
80
|
|
|
@@ -193,6 +209,8 @@ def get_config_keys():
|
|
|
193
209
|
"default_agent",
|
|
194
210
|
"temperature",
|
|
195
211
|
]
|
|
212
|
+
# Add DBOS control key
|
|
213
|
+
default_keys.append("enable_dbos")
|
|
196
214
|
# Add cancel agent key configuration
|
|
197
215
|
default_keys.append("cancel_agent_key")
|
|
198
216
|
# Add banner color keys
|
|
@@ -1029,6 +1047,11 @@ def set_http2(enabled: bool) -> None:
|
|
|
1029
1047
|
set_config_value("http2", "true" if enabled else "false")
|
|
1030
1048
|
|
|
1031
1049
|
|
|
1050
|
+
def set_enable_dbos(enabled: bool) -> None:
|
|
1051
|
+
"""Enable DBOS via config (true enables, default false)."""
|
|
1052
|
+
set_config_value("enable_dbos", "true" if enabled else "false")
|
|
1053
|
+
|
|
1054
|
+
|
|
1032
1055
|
def get_message_limit(default: int = 1000) -> int:
|
|
1033
1056
|
"""
|
|
1034
1057
|
Returns the user-configured message/request limit for the agent.
|
|
@@ -4,7 +4,10 @@ from typing import List
|
|
|
4
4
|
|
|
5
5
|
from pydantic_ai import Agent
|
|
6
6
|
|
|
7
|
-
from code_puppy.config import
|
|
7
|
+
from code_puppy.config import (
|
|
8
|
+
get_global_model_name,
|
|
9
|
+
get_use_dbos,
|
|
10
|
+
)
|
|
8
11
|
from code_puppy.model_factory import ModelFactory, make_model_settings
|
|
9
12
|
|
|
10
13
|
# Keep a module-level agent reference to avoid rebuilding per call
|
|
@@ -103,6 +106,13 @@ def reload_summarization_agent():
|
|
|
103
106
|
retries=1, # Fewer retries for summarization
|
|
104
107
|
model_settings=model_settings,
|
|
105
108
|
)
|
|
109
|
+
if get_use_dbos():
|
|
110
|
+
from pydantic_ai.durable_exec.dbos import DBOSAgent
|
|
111
|
+
|
|
112
|
+
global _reload_count
|
|
113
|
+
_reload_count += 1
|
|
114
|
+
dbos_agent = DBOSAgent(agent, name=f"summarization-agent-{_reload_count}")
|
|
115
|
+
return dbos_agent
|
|
106
116
|
return agent
|
|
107
117
|
|
|
108
118
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# agent_tools.py
|
|
2
2
|
import asyncio
|
|
3
3
|
import hashlib
|
|
4
|
+
import itertools
|
|
4
5
|
import json
|
|
5
6
|
import pickle
|
|
6
7
|
import re
|
|
@@ -9,6 +10,7 @@ from datetime import datetime
|
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from typing import List, Set
|
|
11
12
|
|
|
13
|
+
from dbos import DBOS, SetWorkflowID
|
|
12
14
|
from pydantic import BaseModel
|
|
13
15
|
|
|
14
16
|
# Import Agent from pydantic_ai to create temporary agents for invocation
|
|
@@ -18,6 +20,7 @@ from pydantic_ai.messages import ModelMessage
|
|
|
18
20
|
from code_puppy.config import (
|
|
19
21
|
DATA_DIR,
|
|
20
22
|
get_message_limit,
|
|
23
|
+
get_use_dbos,
|
|
21
24
|
)
|
|
22
25
|
from code_puppy.messaging import (
|
|
23
26
|
SubAgentInvocationMessage,
|
|
@@ -34,6 +37,27 @@ from code_puppy.tools.common import generate_group_id
|
|
|
34
37
|
# Set to track active subagent invocation tasks
|
|
35
38
|
_active_subagent_tasks: Set[asyncio.Task] = set()
|
|
36
39
|
|
|
40
|
+
# Atomic counter for DBOS workflow IDs - ensures uniqueness even in rapid back-to-back calls
|
|
41
|
+
# itertools.count() is thread-safe for next() calls
|
|
42
|
+
_dbos_workflow_counter = itertools.count()
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _generate_dbos_workflow_id(base_id: str) -> str:
|
|
46
|
+
"""Generate a unique DBOS workflow ID by appending an atomic counter.
|
|
47
|
+
|
|
48
|
+
DBOS requires workflow IDs to be unique across all executions.
|
|
49
|
+
This function ensures uniqueness by combining the base_id with
|
|
50
|
+
an atomically incrementing counter.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
base_id: The base identifier (e.g., group_id from generate_group_id)
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
A unique workflow ID in format: {base_id}-wf-{counter}
|
|
57
|
+
"""
|
|
58
|
+
counter = next(_dbos_workflow_counter)
|
|
59
|
+
return f"{base_id}-wf-{counter}"
|
|
60
|
+
|
|
37
61
|
|
|
38
62
|
def _generate_session_hash_suffix() -> str:
|
|
39
63
|
"""Generate a short SHA1 hash suffix based on current timestamp for uniqueness.
|
|
@@ -444,11 +468,9 @@ def register_invoke_agent(agent):
|
|
|
444
468
|
instructions = prepared.instructions
|
|
445
469
|
prompt = prepared.user_prompt
|
|
446
470
|
|
|
471
|
+
subagent_name = f"temp-invoke-agent-{session_id}"
|
|
447
472
|
model_settings = make_model_settings(model_name)
|
|
448
473
|
|
|
449
|
-
# Load MCP servers so sub-agents have access to the same tools as the main agent
|
|
450
|
-
mcp_servers = agent_config.load_mcp_servers()
|
|
451
|
-
|
|
452
474
|
temp_agent = Agent(
|
|
453
475
|
model=model,
|
|
454
476
|
instructions=instructions,
|
|
@@ -456,7 +478,6 @@ def register_invoke_agent(agent):
|
|
|
456
478
|
retries=3,
|
|
457
479
|
history_processors=[agent_config.message_history_accumulator],
|
|
458
480
|
model_settings=model_settings,
|
|
459
|
-
toolsets=mcp_servers if mcp_servers else [],
|
|
460
481
|
)
|
|
461
482
|
|
|
462
483
|
# Register the tools that the agent needs
|
|
@@ -465,21 +486,44 @@ def register_invoke_agent(agent):
|
|
|
465
486
|
agent_tools = agent_config.get_available_tools()
|
|
466
487
|
register_tools_for_agent(temp_agent, agent_tools)
|
|
467
488
|
|
|
489
|
+
if get_use_dbos():
|
|
490
|
+
from pydantic_ai.durable_exec.dbos import DBOSAgent
|
|
491
|
+
|
|
492
|
+
dbos_agent = DBOSAgent(temp_agent, name=subagent_name)
|
|
493
|
+
temp_agent = dbos_agent
|
|
494
|
+
|
|
468
495
|
# Run the temporary agent with the provided prompt as an asyncio task
|
|
469
496
|
# Pass the message_history from the session to continue the conversation
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
497
|
+
workflow_id = None # Track for potential cancellation
|
|
498
|
+
if get_use_dbos():
|
|
499
|
+
# Generate a unique workflow ID for DBOS - ensures no collisions in back-to-back calls
|
|
500
|
+
workflow_id = _generate_dbos_workflow_id(group_id)
|
|
501
|
+
with SetWorkflowID(workflow_id):
|
|
502
|
+
task = asyncio.create_task(
|
|
503
|
+
temp_agent.run(
|
|
504
|
+
prompt,
|
|
505
|
+
message_history=message_history,
|
|
506
|
+
usage_limits=UsageLimits(request_limit=get_message_limit()),
|
|
507
|
+
)
|
|
508
|
+
)
|
|
509
|
+
_active_subagent_tasks.add(task)
|
|
510
|
+
else:
|
|
511
|
+
task = asyncio.create_task(
|
|
512
|
+
temp_agent.run(
|
|
513
|
+
prompt,
|
|
514
|
+
message_history=message_history,
|
|
515
|
+
usage_limits=UsageLimits(request_limit=get_message_limit()),
|
|
516
|
+
)
|
|
475
517
|
)
|
|
476
|
-
|
|
477
|
-
_active_subagent_tasks.add(task)
|
|
518
|
+
_active_subagent_tasks.add(task)
|
|
478
519
|
|
|
479
520
|
try:
|
|
480
521
|
result = await task
|
|
481
522
|
finally:
|
|
482
523
|
_active_subagent_tasks.discard(task)
|
|
524
|
+
if task.cancelled():
|
|
525
|
+
if get_use_dbos() and workflow_id:
|
|
526
|
+
DBOS.cancel_workflow(workflow_id)
|
|
483
527
|
|
|
484
528
|
# Extract the response from the result
|
|
485
529
|
response = result.output
|
|
@@ -7,7 +7,7 @@ from functools import lru_cache
|
|
|
7
7
|
from pydantic import BaseModel, Field
|
|
8
8
|
from pydantic_ai import Agent, BinaryContent
|
|
9
9
|
|
|
10
|
-
from code_puppy.config import get_vqa_model_name
|
|
10
|
+
from code_puppy.config import get_use_dbos, get_vqa_model_name
|
|
11
11
|
from code_puppy.model_factory import ModelFactory
|
|
12
12
|
|
|
13
13
|
|
|
@@ -50,6 +50,12 @@ def _load_vqa_agent(model_name: str) -> Agent[None, VisualAnalysisResult]:
|
|
|
50
50
|
retries=2,
|
|
51
51
|
)
|
|
52
52
|
|
|
53
|
+
if get_use_dbos():
|
|
54
|
+
from pydantic_ai.durable_exec.dbos import DBOSAgent
|
|
55
|
+
|
|
56
|
+
dbos_agent = DBOSAgent(vqa_agent, name="vqa-agent")
|
|
57
|
+
return dbos_agent
|
|
58
|
+
|
|
53
59
|
return vqa_agent
|
|
54
60
|
|
|
55
61
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "code-puppy"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.346"
|
|
8
8
|
description = "Code generation agent"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11,<3.14"
|
|
@@ -26,6 +26,7 @@ dependencies = [
|
|
|
26
26
|
"tenacity>=8.2.0",
|
|
27
27
|
"playwright>=1.40.0",
|
|
28
28
|
"camoufox>=0.4.11",
|
|
29
|
+
"dbos>=2.5.0",
|
|
29
30
|
"uvicorn>=0.30.0",
|
|
30
31
|
"fastapi>=0.111.0",
|
|
31
32
|
"termflow-md>=0.1.6",
|
|
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
|