code-puppy 0.0.928__tar.gz → 0.0.930__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.928 → code_puppy-0.0.930}/PKG-INFO +3 -3
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_diagnostics.py +13 -3
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_runtime.py +4 -1
- code_puppy-0.0.930/code_puppy/agents/_token_limit_hint.py +64 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/event_stream_handler.py +2 -1
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/cli_runner.py +2 -3
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/model_settings_defs.py +3 -2
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/config.py +20 -8
- code_puppy-0.0.930/code_puppy/messaging/safe_console.py +72 -0
- code_puppy-0.0.930/code_puppy/messaging/safe_stream.py +79 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/model_factory.py +2 -1
- code_puppy-0.0.930/code_puppy/models_dev_family.py +77 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/display.py +11 -3
- {code_puppy-0.0.928 → code_puppy-0.0.930}/pyproject.toml +3 -3
- {code_puppy-0.0.928 → code_puppy-0.0.930}/.gitignore +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/LICENSE +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/README.md +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/__main__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/_plugin_i18n_lifecycle.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/_pydantic_tool_helpers.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/_pydantic_video_patch.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agent_completion_inbox.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agent_execution_context.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_builder.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_code_mode.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_code_mode_guidance.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_code_mode_session.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_compaction.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_foreign_thinking.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_history.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_key_listeners.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_model_message_transform.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_non_streaming_render.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_output_limits.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_run_signals.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_steer_processor.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_subagent_recursion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_tty_modes.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_windows_console.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/_wire_tool_names.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/agent_code_puppy.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/agent_creator_agent.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/agent_helios.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/agent_manager.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/agent_model_judge.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/agent_planning.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/agent_qa_kitten.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/agent_web_retriever.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/base_agent.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/json_agent.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/retry_checkpoint.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/retry_profiles.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/run_invocation.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/run_stats.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/smooth_stream.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/stream_status.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/subagent_stream_handler.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/agents/thinking_output.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/asyncio_cleanup.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/atomic_io.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/atomic_json.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/ca_bundle.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/callbacks.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/capabilities/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/capabilities/compaction.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/capabilities/eager_timing.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/chatgpt_codex_client.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/claude_cache_client.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/claude_oauth_transport.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/claude_thinking_display.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/add_model_details.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/add_model_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/add_model_menus.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/add_model_vllm.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/agent_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/attachments.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/autosave_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/autosave_search.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/clipboard.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/colors_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/command_handler.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/command_registry.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/completers.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/completion_cache.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/config_apply.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/config_commands.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/core_commands.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/file_index.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/file_path_completion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/help_catalog.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/help_overlay.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/image_utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/load_context_completion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/base.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/catalog_server_installer.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/custom_server_form.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/custom_server_installer.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/edit_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/handler.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/help_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/install_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/install_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/list_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/logs_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/mcp_servers_store.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/remove_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/restart_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/search_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/silence_warning_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/start_all_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/start_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/status_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/stop_all_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/stop_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/trust_command.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp/wizard_utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp_binding_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/mcp_completion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/menu_session.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/model_picker_completion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/model_settings_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/onboarding_slides.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/onboarding_wizard.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/pagination.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/pin_command_completion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/refresh_models.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/session_browser.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/session_browser_data.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/session_commands.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/set_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/set_menu_catalog.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/set_menu_schema.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/set_menu_settings.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/set_menu_shims.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/set_menu_values.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/shell_passthrough.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/skills_completion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/tui_style.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/uc_menu.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/command_line/utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/config_file.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/context_accounting.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/diagnostics.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/error_logging.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/events/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/events/bridge.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/file_completion_io.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/file_completion_tokens.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/gemini_code_assist.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/gemini_common.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/gemini_model.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/README.md +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/aliases.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/engine.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/executor.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/matcher.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/models.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/registry.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/hook_engine/validator.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/http_retry.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/http_utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/httpx2_utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/audit.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/catalog.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/formats.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/interpolation.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/locale.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/locales/en-US.json +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/locales/es.json +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/locales/fr-CA.json +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/plugin_catalog.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/plurals.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/pseudo.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/i18n/translate.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/kennel_provider.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/keymap.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/list_filtering.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/main.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/malloc_noise_guard.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/agent_bindings.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/async_lifecycle.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/blocking_startup.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/circuit_breaker.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/config_wizard.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/dashboard.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/error_isolation.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/examples/retry_example.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/health_monitor.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/http_auth.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/managed_server.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/manager.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/manager_lifecycle.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/mcp_logs.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/project_config.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/registry.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/retry_manager.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/server_registry_catalog.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/status_tracker.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/system_tools.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/tool_arg_coercion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_/toolset_utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_prompts/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/mcp_prompts/hook_creator.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/bar_painters.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/bar_rendering.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/bottom_bar.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/bus.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/chords.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/commands.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_actions.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_completion.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_display.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_history.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_keys.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_paste.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_queue.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_submission.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/editor_undo.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/external_editor.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/identity_line.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/idle_status.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/inline_bar.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/line_editor.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/markdown_patches.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/menu_lifecycle.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/message_queue.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/messages.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/pause_controller.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/prompt_prefix_style.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/queue_console.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/renderers.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/rich_renderer.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/run_ui.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/run_ui_wiring.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/speculation_line.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/speculation_stats.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/speculation_toggle.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/spinner/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/status_line.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/subagent_console.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/theme_accent.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/tool_output.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/messaging/transcript_guard.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/model_descriptions.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/model_switching.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/model_utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/models.json +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/models_dev_api.json +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/models_dev_parser.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/observability.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/platform_utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/plugins/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/plugins/config.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/plugins/oauth_pasteback.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/plugins/oauth_puppy_html.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/plugins/trust.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/plugins/trust_notice.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/private_inference.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/provider_credentials.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/provider_identity.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/pydantic_patches.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/reopenable_async_client.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/round_robin_model.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/secret_store.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/secret_store_backends.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/session_format_migration.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/session_lifecycle.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/session_migration.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/session_storage.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/session_surrogate_unpickler.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/shared_credentials.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/skill_provider.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/splash.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/status_display.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/steer_metadata.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/terminal_utils.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/token_usage.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/_browser_registry.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/_lazy.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/agent_tools.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/approval_feedback.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/constants.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/demo_tui.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/handler.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/models.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/registration.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/renderers.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/terminal_ui.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/theme.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ask_user_question/tui_loop.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/__init__.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_control.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_interactions.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_locator_resolver.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_locators.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_manager.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_navigation.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_page_snapshot.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_screenshot.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_scripts.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_semantic_interactions.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/browser_workflows.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/browser/tool_registry.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/command_runner.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/common.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/file_modifications.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/file_operations.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/file_permission_state.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/fs_access.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/image_tools.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/io_backends.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/model_tools.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/ripgrep.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/shell_backgrounding.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/skills_tools.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/subagent_context.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/subagent_invocation.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/subagent_usage_metrics.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/tools_content.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/universal_constructor.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/tools/win_shell_io.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/undo_manager.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/universal_constructor_provider.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/version_checker.py +0 -0
- {code_puppy-0.0.928 → code_puppy-0.0.930}/code_puppy/zai_model.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: code-puppy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.930
|
|
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
|
|
@@ -20,7 +20,7 @@ Requires-Dist: anthropic<2,>=1.0.0
|
|
|
20
20
|
Requires-Dist: anyio>=4.7.0
|
|
21
21
|
Requires-Dist: azure-identity>=1.15.0
|
|
22
22
|
Requires-Dist: boto3>=1.43.9
|
|
23
|
-
Requires-Dist: code-puppy-core-plugins>=0.0.
|
|
23
|
+
Requires-Dist: code-puppy-core-plugins>=0.0.95
|
|
24
24
|
Requires-Dist: httpx2>=2.7
|
|
25
25
|
Requires-Dist: httpx[http2]>=0.24.1
|
|
26
26
|
Requires-Dist: json-repair>=0.46.2
|
|
@@ -46,7 +46,7 @@ Requires-Dist: websockets>=14.0
|
|
|
46
46
|
Provides-Extra: bedrock
|
|
47
47
|
Requires-Dist: boto3>=1.35.0; extra == 'bedrock'
|
|
48
48
|
Provides-Extra: computer-use
|
|
49
|
-
Requires-Dist: code-puppy-core-plugins[computer-use]>=0.0.
|
|
49
|
+
Requires-Dist: code-puppy-core-plugins[computer-use]>=0.0.95; extra == 'computer-use'
|
|
50
50
|
Provides-Extra: durable
|
|
51
51
|
Requires-Dist: dbos>=2.11.0; extra == 'durable'
|
|
52
52
|
Description-Content-Type: text/markdown
|
|
@@ -13,12 +13,13 @@ guarded; diagnostic emit must never itself raise.
|
|
|
13
13
|
|
|
14
14
|
from __future__ import annotations
|
|
15
15
|
|
|
16
|
-
from typing import Any
|
|
16
|
+
from typing import Any, Optional
|
|
17
17
|
|
|
18
18
|
from rich.text import Text
|
|
19
19
|
|
|
20
|
+
from code_puppy.agents._token_limit_hint import token_limit_hint
|
|
20
21
|
from code_puppy.error_logging import log_error
|
|
21
|
-
from code_puppy.messaging import emit_info
|
|
22
|
+
from code_puppy.messaging import emit_info, emit_warning
|
|
22
23
|
|
|
23
24
|
# Python 3.11+ builtin; graceful fallback for 3.10
|
|
24
25
|
try:
|
|
@@ -104,7 +105,9 @@ def _needs_deep_diagnostics(exc: BaseException) -> bool:
|
|
|
104
105
|
return any(trigger in msg for trigger in DIAGNOSTIC_TRIGGERS)
|
|
105
106
|
|
|
106
107
|
|
|
107
|
-
def emit_exception_diagnostics(
|
|
108
|
+
def emit_exception_diagnostics(
|
|
109
|
+
exc: BaseException, group_id: str, model_name: Optional[str] = None
|
|
110
|
+
) -> None:
|
|
108
111
|
"""Emit terminal diagnostics for ``exc``, bounded and defensive.
|
|
109
112
|
|
|
110
113
|
Cheap path (always): one-line summary + log file write.
|
|
@@ -119,6 +122,13 @@ def emit_exception_diagnostics(exc: BaseException, group_id: str) -> None:
|
|
|
119
122
|
except Exception: # pragma: no cover - emit should never fail
|
|
120
123
|
pass
|
|
121
124
|
|
|
125
|
+
try:
|
|
126
|
+
hint = token_limit_hint(exc, model_name)
|
|
127
|
+
if hint:
|
|
128
|
+
emit_warning(hint, group_id=group_id)
|
|
129
|
+
except Exception: # pragma: no cover - a hint must never cascade
|
|
130
|
+
pass
|
|
131
|
+
|
|
122
132
|
# File logging is independent of terminal output and stays on the cheap path.
|
|
123
133
|
try:
|
|
124
134
|
log_error(
|
|
@@ -82,6 +82,7 @@ from code_puppy.agents._run_signals import (
|
|
|
82
82
|
reset_pause_state_at_run_start,
|
|
83
83
|
sigint_should_cancel,
|
|
84
84
|
)
|
|
85
|
+
from code_puppy.agents._token_limit_hint import resolve_model_name
|
|
85
86
|
from code_puppy.agents.event_stream_handler import event_stream_handler
|
|
86
87
|
from code_puppy.agents.run_invocation import ModelCall, run_with_exception_retry
|
|
87
88
|
from code_puppy.callbacks import (
|
|
@@ -1006,7 +1007,9 @@ async def _run_with_mcp_impl(
|
|
|
1006
1007
|
group_id=group_id,
|
|
1007
1008
|
)
|
|
1008
1009
|
for exc in unexpected:
|
|
1009
|
-
emit_exception_diagnostics(
|
|
1010
|
+
emit_exception_diagnostics(
|
|
1011
|
+
exc, group_id=group_id, model_name=resolve_model_name(agent)
|
|
1012
|
+
)
|
|
1010
1013
|
# Re-raise, else the bare except* would silently mask all errors
|
|
1011
1014
|
# and run_with_mcp() would look like success.
|
|
1012
1015
|
if unexpected:
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Turn pydantic-ai's output-budget exhaustion error into an actionable hint."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from typing import Any, Iterator, Optional
|
|
7
|
+
|
|
8
|
+
from rich.markup import escape
|
|
9
|
+
|
|
10
|
+
_TOKEN_LIMIT_PATTERN = re.compile(
|
|
11
|
+
r"Model token limit \(([^)]+)\) exceeded before any response was generated"
|
|
12
|
+
)
|
|
13
|
+
_MAX_CHAIN_DEPTH = 5
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _walk_chain(exc: BaseException) -> Iterator[BaseException]:
|
|
17
|
+
seen: set[int] = set()
|
|
18
|
+
current: Optional[BaseException] = exc
|
|
19
|
+
for _ in range(_MAX_CHAIN_DEPTH):
|
|
20
|
+
if current is None or id(current) in seen:
|
|
21
|
+
return
|
|
22
|
+
seen.add(id(current))
|
|
23
|
+
yield current
|
|
24
|
+
current = current.__cause__ or current.__context__
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _safe_text(value: Any) -> Optional[str]:
|
|
28
|
+
try:
|
|
29
|
+
return str(value)
|
|
30
|
+
except Exception:
|
|
31
|
+
return None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def resolve_model_name(agent: Any) -> Optional[str]:
|
|
35
|
+
"""Best-effort model name for diagnostics; never raises."""
|
|
36
|
+
try:
|
|
37
|
+
return agent.get_model_name()
|
|
38
|
+
except Exception:
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def token_limit_hint(exc: BaseException, model_name: Optional[str]) -> Optional[str]:
|
|
43
|
+
"""Rich-markup hint when ``exc`` is an output-budget exhaustion, else ``None``."""
|
|
44
|
+
for link in _walk_chain(exc):
|
|
45
|
+
text = _safe_text(link)
|
|
46
|
+
match = _TOKEN_LIMIT_PATTERN.search(text) if text else None
|
|
47
|
+
if match:
|
|
48
|
+
break
|
|
49
|
+
else:
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
name = _safe_text(model_name) if model_name else None
|
|
53
|
+
subject = f"[bold]{escape(name)}[/bold]" if name else "The model"
|
|
54
|
+
cap = match.group(1)
|
|
55
|
+
budget = f"{cap}-token" if cap.isdigit() else "provider-default"
|
|
56
|
+
return (
|
|
57
|
+
f"{subject} used its entire {budget} output budget before "
|
|
58
|
+
"producing a response (reasoning counts against it). Run "
|
|
59
|
+
"[cyan]/model_settings[/cyan], select this model, and raise "
|
|
60
|
+
"[cyan]Max Output Tokens[/cyan]."
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
__all__ = ["resolve_model_name", "token_limit_hint"]
|
|
@@ -29,6 +29,7 @@ from code_puppy.config import (
|
|
|
29
29
|
get_subagent_verbose,
|
|
30
30
|
get_suppress_thinking_messages,
|
|
31
31
|
)
|
|
32
|
+
from code_puppy.messaging.safe_console import SafeConsole
|
|
32
33
|
from code_puppy.tools.display import erase_progress_line
|
|
33
34
|
from code_puppy.tools.subagent_context import is_subagent
|
|
34
35
|
|
|
@@ -87,7 +88,7 @@ def get_streaming_console() -> Console:
|
|
|
87
88
|
"""
|
|
88
89
|
if _streaming_console is not None:
|
|
89
90
|
return _streaming_console
|
|
90
|
-
return
|
|
91
|
+
return SafeConsole()
|
|
91
92
|
|
|
92
93
|
|
|
93
94
|
def _should_suppress_output() -> bool:
|
|
@@ -18,8 +18,6 @@ import sys
|
|
|
18
18
|
import traceback
|
|
19
19
|
from pathlib import Path
|
|
20
20
|
|
|
21
|
-
from rich.console import Console
|
|
22
|
-
|
|
23
21
|
from code_puppy import __version__, callbacks, get_core_plugins_version, plugins
|
|
24
22
|
from code_puppy.agents import get_current_agent
|
|
25
23
|
from code_puppy.asyncio_cleanup import install_httpcore2_shutdown_filter
|
|
@@ -278,9 +276,10 @@ async def main():
|
|
|
278
276
|
get_global_queue,
|
|
279
277
|
get_message_bus,
|
|
280
278
|
)
|
|
279
|
+
from code_puppy.messaging.safe_console import SafeConsole
|
|
281
280
|
|
|
282
281
|
# Create a shared console for both renderers
|
|
283
|
-
display_console =
|
|
282
|
+
display_console = SafeConsole()
|
|
284
283
|
|
|
285
284
|
# Legacy renderer for backward compatibility (emits via get_global_queue)
|
|
286
285
|
message_queue = get_global_queue()
|
|
@@ -62,8 +62,9 @@ SETTING_DEFINITIONS: Dict[str, Dict] = {
|
|
|
62
62
|
"name": "Max Output Tokens",
|
|
63
63
|
"description": (
|
|
64
64
|
"Output-token cap sent as max_tokens. Default comes from the model's "
|
|
65
|
-
"catalog entry (filled from models.dev by /add_model), else
|
|
66
|
-
"context length clamped to
|
|
65
|
+
"catalog entry (filled from models.dev by /add_model), else models.dev "
|
|
66
|
+
"or a known sibling model, else 15% of context length clamped to "
|
|
67
|
+
"2048-65536."
|
|
67
68
|
),
|
|
68
69
|
"type": "numeric",
|
|
69
70
|
"min": 256,
|
|
@@ -550,15 +550,18 @@ def _models_dev_output_tokens(
|
|
|
550
550
|
model_config: Catalog entry; its ``name`` is the bare model id.
|
|
551
551
|
|
|
552
552
|
Returns:
|
|
553
|
-
The cap when models.dev vouches for it,
|
|
554
|
-
|
|
555
|
-
|
|
553
|
+
The cap when models.dev vouches for it, or an inferred one for an
|
|
554
|
+
unindexed Claude model (see ``models_dev_family``); else ``None`` so
|
|
555
|
+
the caller falls through to the heuristic. Never raises: an ambiguous
|
|
556
|
+
or unknown model yields ``None``.
|
|
556
557
|
"""
|
|
557
558
|
name = str(model_config.get("name") or "")
|
|
558
559
|
if not name:
|
|
559
560
|
return None
|
|
560
561
|
try:
|
|
562
|
+
from code_puppy.models_dev_family import infer_family_output_cap
|
|
561
563
|
from code_puppy.models_dev_parser import (
|
|
564
|
+
LimitMatchKind,
|
|
562
565
|
get_registry,
|
|
563
566
|
index_limits,
|
|
564
567
|
match_limits,
|
|
@@ -567,14 +570,21 @@ def _models_dev_output_tokens(
|
|
|
567
570
|
registry = get_registry()
|
|
568
571
|
if registry is None:
|
|
569
572
|
return None
|
|
570
|
-
|
|
573
|
+
models = list(registry.get_models())
|
|
574
|
+
by_key, by_name = index_limits(models)
|
|
571
575
|
# Mirrors extra_model_key() over a "provider/model" alias so the
|
|
572
576
|
# provider-scoped match applies whenever we can identify the provider.
|
|
573
577
|
key = model_name.replace("/", "-").replace(":", "-")
|
|
574
578
|
match = match_limits(by_key, by_name, key, name)
|
|
575
|
-
if match.limits is None:
|
|
576
|
-
return
|
|
577
|
-
|
|
579
|
+
if match.limits is not None:
|
|
580
|
+
return _coerce_positive_int(match.limits.max_output)
|
|
581
|
+
if match.kind is LimitMatchKind.UNMATCHED:
|
|
582
|
+
return _coerce_positive_int(
|
|
583
|
+
infer_family_output_cap(
|
|
584
|
+
name, str(model_config.get("type") or ""), models
|
|
585
|
+
)
|
|
586
|
+
)
|
|
587
|
+
return None
|
|
578
588
|
except Exception:
|
|
579
589
|
return None
|
|
580
590
|
|
|
@@ -594,7 +604,9 @@ def get_model_max_output_tokens(
|
|
|
594
604
|
3. ``limit.output`` for that model id from models.dev, so entries that
|
|
595
605
|
predate ``/add_model`` stamping limits (or were written by hand) still
|
|
596
606
|
get a real cap rather than a guess.
|
|
597
|
-
4.
|
|
607
|
+
4. For unindexed Claude models, the cap of the newest known sibling of the
|
|
608
|
+
same family that is not newer than the model (best-effort inference).
|
|
609
|
+
5. Heuristic: 15% of ``context_length``, clamped to [2048, 65536].
|
|
598
610
|
|
|
599
611
|
Args:
|
|
600
612
|
model_name: Model key; defaults to the current global model.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""Rich ``Console`` that keeps rendering from killing the run on a dead handle."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import IO, Optional
|
|
6
|
+
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
|
|
9
|
+
from code_puppy.messaging.safe_stream import (
|
|
10
|
+
SafeTextStream,
|
|
11
|
+
ensure_safe_text_stream,
|
|
12
|
+
is_dead_handle_error,
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class SafeConsole(Console):
|
|
17
|
+
"""Console that goes silent after its output handle dies.
|
|
18
|
+
|
|
19
|
+
``_check_buffer`` is the one render entry point shared by every supported
|
|
20
|
+
Rich version, including the legacy-Windows renderer that bypasses
|
|
21
|
+
``file.write``. ``file`` is wrapped lazily rather than once at construction
|
|
22
|
+
because Rich resolves ``sys.stdout`` on each access when no file is given,
|
|
23
|
+
and the transcript guard swaps ``sys.stdout`` at runtime.
|
|
24
|
+
|
|
25
|
+
The latch is permanent for the console's lifetime and, once set, nothing
|
|
26
|
+
is rendered or recorded. Pending segments are only discarded at the
|
|
27
|
+
outermost buffer level so ``capture()`` and nested ``with console:`` blocks
|
|
28
|
+
keep their content.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
_dead = False
|
|
32
|
+
_safe_view: Optional[tuple[IO[str], SafeTextStream]] = None
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def file(self) -> IO[str]:
|
|
36
|
+
raw = Console.file.fget(self) # type: ignore[attr-defined]
|
|
37
|
+
cached = self._safe_view
|
|
38
|
+
if cached is not None and cached[0] is raw:
|
|
39
|
+
return cached[1] # type: ignore[return-value]
|
|
40
|
+
safe = ensure_safe_text_stream(raw)
|
|
41
|
+
self._safe_view = (raw, safe) # type: ignore[assignment]
|
|
42
|
+
return safe # type: ignore[return-value]
|
|
43
|
+
|
|
44
|
+
@file.setter
|
|
45
|
+
def file(self, new_file: IO[str]) -> None:
|
|
46
|
+
Console.file.fset(self, new_file) # type: ignore[attr-defined]
|
|
47
|
+
|
|
48
|
+
def _check_buffer(self) -> None:
|
|
49
|
+
with self._lock:
|
|
50
|
+
if self._dead:
|
|
51
|
+
self._discard_pending()
|
|
52
|
+
return
|
|
53
|
+
try:
|
|
54
|
+
super()._check_buffer()
|
|
55
|
+
except OSError as exc:
|
|
56
|
+
if not is_dead_handle_error(exc):
|
|
57
|
+
raise
|
|
58
|
+
self._mark_dead()
|
|
59
|
+
|
|
60
|
+
def on_broken_pipe(self) -> None:
|
|
61
|
+
self._mark_dead()
|
|
62
|
+
|
|
63
|
+
def _mark_dead(self) -> None:
|
|
64
|
+
self._dead = True
|
|
65
|
+
self._discard_pending()
|
|
66
|
+
|
|
67
|
+
def _discard_pending(self) -> None:
|
|
68
|
+
if not self._buffer_index:
|
|
69
|
+
del self._buffer[:]
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
__all__ = ["SafeConsole"]
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"""Output proxies that survive a dead stdout handle.
|
|
2
|
+
|
|
3
|
+
A detached or closed terminal answers ``isatty()`` and then fails every
|
|
4
|
+
``write``/``flush`` with ``EINVAL``/``EPIPE``/``EBADF``. Display code should
|
|
5
|
+
degrade to silence instead of aborting the agent run, but only for that
|
|
6
|
+
specific failure: any other ``OSError`` (disk full, quota, ...) still raises.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import errno
|
|
12
|
+
from typing import Any, Iterable, TextIO
|
|
13
|
+
|
|
14
|
+
_DEAD_ERRNOS = frozenset({errno.EINVAL, errno.EPIPE, errno.EBADF})
|
|
15
|
+
# ERROR_INVALID_HANDLE, ERROR_BROKEN_PIPE, ERROR_NO_DATA
|
|
16
|
+
_DEAD_WINERRORS = frozenset({6, 109, 232})
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def is_dead_handle_error(exc: BaseException) -> bool:
|
|
20
|
+
"""True when ``exc`` means the output handle is gone for good."""
|
|
21
|
+
if not isinstance(exc, OSError):
|
|
22
|
+
return False
|
|
23
|
+
if isinstance(exc, BrokenPipeError):
|
|
24
|
+
return True
|
|
25
|
+
return (
|
|
26
|
+
exc.errno in _DEAD_ERRNOS or getattr(exc, "winerror", None) in _DEAD_WINERRORS
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SafeTextStream:
|
|
31
|
+
"""Text-stream proxy that goes silent once the wrapped handle is dead.
|
|
32
|
+
|
|
33
|
+
Everything except ``write``/``writelines``/``flush`` delegates to the
|
|
34
|
+
wrapped stream, so ``isatty``/``fileno``/``encoding`` behave as before.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def __init__(self, wrapped: TextIO) -> None:
|
|
38
|
+
self._wrapped = wrapped
|
|
39
|
+
self._dead = False
|
|
40
|
+
|
|
41
|
+
def write(self, text: str) -> int:
|
|
42
|
+
if self._dead:
|
|
43
|
+
return len(text)
|
|
44
|
+
try:
|
|
45
|
+
return self._wrapped.write(text)
|
|
46
|
+
except OSError as exc:
|
|
47
|
+
if not is_dead_handle_error(exc):
|
|
48
|
+
raise
|
|
49
|
+
self._dead = True
|
|
50
|
+
return len(text)
|
|
51
|
+
|
|
52
|
+
def writelines(self, lines: Iterable[str]) -> None:
|
|
53
|
+
for line in lines:
|
|
54
|
+
self.write(line)
|
|
55
|
+
|
|
56
|
+
def flush(self) -> None:
|
|
57
|
+
if self._dead:
|
|
58
|
+
return
|
|
59
|
+
try:
|
|
60
|
+
self._wrapped.flush()
|
|
61
|
+
except OSError as exc:
|
|
62
|
+
if not is_dead_handle_error(exc):
|
|
63
|
+
raise
|
|
64
|
+
self._dead = True
|
|
65
|
+
|
|
66
|
+
def __getattr__(self, name: str) -> Any:
|
|
67
|
+
if name == "_wrapped":
|
|
68
|
+
raise AttributeError(name)
|
|
69
|
+
return getattr(self._wrapped, name)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def ensure_safe_text_stream(stream: TextIO) -> TextIO:
|
|
73
|
+
"""Wrap ``stream`` in a :class:`SafeTextStream` unless it already is one."""
|
|
74
|
+
if isinstance(stream, SafeTextStream):
|
|
75
|
+
return stream
|
|
76
|
+
return SafeTextStream(stream) # type: ignore[return-value]
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
__all__ = ["SafeTextStream", "ensure_safe_text_stream", "is_dead_handle_error"]
|
|
@@ -319,7 +319,8 @@ def make_model_settings(
|
|
|
319
319
|
- GPT-5 models: reasoning_effort and verbosity (non-codex only)
|
|
320
320
|
- Claude/Anthropic models: extended_thinking and budget_tokens
|
|
321
321
|
- ``max_tokens`` resolved via :func:`config.get_model_max_output_tokens`
|
|
322
|
-
(per-model override > catalog ``max_output_tokens`` >
|
|
322
|
+
(per-model override > catalog ``max_output_tokens`` > models.dev >
|
|
323
|
+
known-sibling inference > 15% heuristic)
|
|
323
324
|
|
|
324
325
|
Args:
|
|
325
326
|
model_name: The name of the model to create settings for.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Best-effort output-cap inference for Claude models models.dev has not indexed.
|
|
2
|
+
|
|
3
|
+
The bundled models.dev snapshot lags behind new Claude releases, and a guessed
|
|
4
|
+
15%-of-context cap starves adaptive-thinking models of output budget. A model
|
|
5
|
+
of a known family borrows the cap of the newest *known* sibling that is not
|
|
6
|
+
newer than itself. This is an inference, not a guarantee.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import re
|
|
12
|
+
from collections import defaultdict
|
|
13
|
+
from typing import Iterable, Optional
|
|
14
|
+
|
|
15
|
+
from code_puppy.models_dev_parser import ModelInfo
|
|
16
|
+
|
|
17
|
+
ANTHROPIC_CATALOG_TYPES = frozenset({"anthropic", "custom_anthropic"})
|
|
18
|
+
ANTHROPIC_PROVIDER_ID = "anthropic"
|
|
19
|
+
|
|
20
|
+
_FAMILIES = frozenset({"opus", "sonnet", "haiku"})
|
|
21
|
+
_SNAPSHOT_SUFFIX = re.compile(r"\d{8}|latest")
|
|
22
|
+
|
|
23
|
+
Version = tuple[int, ...]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def parse_claude_alias(model_id: str) -> Optional[tuple[str, Version]]:
|
|
27
|
+
"""Split a Claude id into ``(family, version)``, whichever order it uses.
|
|
28
|
+
|
|
29
|
+
Handles ``claude-opus-5-5``, ``claude-5-opus``, ``claude-3-7-sonnet-latest``
|
|
30
|
+
and dated snapshot ids. Anything else (unknown family, stray words) is
|
|
31
|
+
``None``.
|
|
32
|
+
"""
|
|
33
|
+
parts = str(model_id).lower().split("-")
|
|
34
|
+
if len(parts) < 2 or parts[0] != "claude":
|
|
35
|
+
return None
|
|
36
|
+
rest = parts[1:]
|
|
37
|
+
if _SNAPSHOT_SUFFIX.fullmatch(rest[-1]):
|
|
38
|
+
rest = rest[:-1]
|
|
39
|
+
families = [part for part in rest if part in _FAMILIES]
|
|
40
|
+
numbers = [part for part in rest if part not in _FAMILIES]
|
|
41
|
+
if len(families) != 1 or not numbers or not all(n.isdigit() for n in numbers):
|
|
42
|
+
return None
|
|
43
|
+
return families[0], tuple(int(n) for n in numbers)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def infer_family_output_cap(
|
|
47
|
+
model_id: str, catalog_type: str, models: Iterable[ModelInfo]
|
|
48
|
+
) -> Optional[int]:
|
|
49
|
+
"""Output cap of the newest known Anthropic sibling not newer than ``model_id``.
|
|
50
|
+
|
|
51
|
+
Returns ``None`` when the entry is not Anthropic-backed, the id is not a
|
|
52
|
+
recognisable Claude alias, no older-or-equal sibling is known, or the
|
|
53
|
+
siblings at the chosen version disagree on the cap.
|
|
54
|
+
"""
|
|
55
|
+
if catalog_type not in ANTHROPIC_CATALOG_TYPES:
|
|
56
|
+
return None
|
|
57
|
+
target = parse_claude_alias(model_id)
|
|
58
|
+
if target is None:
|
|
59
|
+
return None
|
|
60
|
+
family, target_version = target
|
|
61
|
+
|
|
62
|
+
caps_by_version: dict[Version, set[int]] = defaultdict(set)
|
|
63
|
+
for model in models:
|
|
64
|
+
if model.provider_id != ANTHROPIC_PROVIDER_ID or model.max_output <= 0:
|
|
65
|
+
continue
|
|
66
|
+
sibling = parse_claude_alias(model.model_id)
|
|
67
|
+
if sibling is None or sibling[0] != family or sibling[1] > target_version:
|
|
68
|
+
continue
|
|
69
|
+
caps_by_version[sibling[1]].add(model.max_output)
|
|
70
|
+
|
|
71
|
+
if not caps_by_version:
|
|
72
|
+
return None
|
|
73
|
+
caps = caps_by_version[max(caps_by_version)]
|
|
74
|
+
return next(iter(caps)) if len(caps) == 1 else None
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
__all__ = ["infer_family_output_cap", "parse_claude_alias"]
|
|
@@ -11,10 +11,12 @@ from rich.control import Control
|
|
|
11
11
|
from rich.segment import ControlType
|
|
12
12
|
|
|
13
13
|
from code_puppy.config import get_banner_color, get_output_level, get_subagent_verbose
|
|
14
|
+
from code_puppy.messaging.safe_stream import is_dead_handle_error
|
|
14
15
|
from code_puppy.tools.subagent_context import is_subagent
|
|
15
16
|
|
|
16
|
-
#: EL2 (erase entire line) + CR. Rich drops control segments on
|
|
17
|
-
#: non-terminal output
|
|
17
|
+
#: EL2 (erase entire line) + CR. Only POSIX Rich drops control segments on
|
|
18
|
+
#: non-terminal output; its legacy-Windows renderer writes the CR regardless,
|
|
19
|
+
#: so ``erase_progress_line`` checks ``is_terminal`` itself.
|
|
18
20
|
_ERASE_LINE_CONTROL = Control(
|
|
19
21
|
(ControlType.ERASE_IN_LINE, 2), ControlType.CARRIAGE_RETURN
|
|
20
22
|
)
|
|
@@ -29,7 +31,13 @@ def erase_progress_line(console: Console) -> None:
|
|
|
29
31
|
cells) left right-edge ghost tails like ``s)`` in the transcript.
|
|
30
32
|
Erase-in-line clears the whole row regardless of length.
|
|
31
33
|
"""
|
|
32
|
-
console.
|
|
34
|
+
if not console.is_terminal:
|
|
35
|
+
return
|
|
36
|
+
try:
|
|
37
|
+
console.control(_ERASE_LINE_CONTROL)
|
|
38
|
+
except OSError as exc:
|
|
39
|
+
if not is_dead_handle_error(exc):
|
|
40
|
+
raise
|
|
33
41
|
|
|
34
42
|
|
|
35
43
|
def render_markdown(content: str, console: Console) -> None:
|
|
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "code-puppy"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.930"
|
|
8
8
|
description = "Code generation agent"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11,<3.15"
|
|
11
11
|
dependencies = [
|
|
12
|
-
"code-puppy-core-plugins>=0.0.
|
|
12
|
+
"code-puppy-core-plugins>=0.0.95",
|
|
13
13
|
"logfire>=4.0",
|
|
14
14
|
"pydantic-ai-slim[openai,anthropic,mcp]==2.51.0",
|
|
15
15
|
"pydantic-ai-harness[code-mode]==0.35.0",
|
|
@@ -66,7 +66,7 @@ classifiers = [
|
|
|
66
66
|
bedrock = ["boto3>=1.35.0"]
|
|
67
67
|
durable = ["dbos>=2.11.0"]
|
|
68
68
|
computer-use = [
|
|
69
|
-
"code-puppy-core-plugins[computer-use]>=0.0.
|
|
69
|
+
"code-puppy-core-plugins[computer-use]>=0.0.95",
|
|
70
70
|
]
|
|
71
71
|
|
|
72
72
|
[project.urls]
|
|
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
|