Skip to content

The agent that grows with you

ci: fix RUF017, RUF018, RUF022

Maciej Lisiewski74f1f17a7ef4
diff --git a/agent/acp_openai_bridge.py b/agent/acp_openai_bridge.py
index 16cf0c75014..66d8e8d9e5b 100644
--- a/agent/acp_openai_bridge.py
+++ b/agent/acp_openai_bridge.py
@@ -29,9 +29,15 @@ TOOL_CALL_CONTRACT = (
)
__all__ = [
- "TOOL_CALL_BLOCK_RE", "TOOL_CALL_JSON_RE", "TOOL_CALL_CONTRACT", "StreamChunks", "build_openai_tool_call",
- "tool_specs_from_openai_tools", "render_tool_bridge_sections", "extract_tool_calls_from_text",
+ "TOOL_CALL_BLOCK_RE",
+ "TOOL_CALL_CONTRACT",
+ "TOOL_CALL_JSON_RE",
+ "StreamChunks",
+ "build_openai_tool_call",
"completion_to_stream_chunks",
+ "extract_tool_calls_from_text",
+ "render_tool_bridge_sections",
+ "tool_specs_from_openai_tools",
]
diff --git a/agent/agent_runtime_helpers.py b/agent/agent_runtime_helpers.py
index 4a67918ab50..5d8879bf921 100644
--- a/agent/agent_runtime_helpers.py
+++ b/agent/agent_runtime_helpers.py
@@ -3827,13 +3827,29 @@ def force_close_tcp_sockets(client: Any) -> int:
__all__ = [
- "convert_to_trajectory_format", "sanitize_tool_call_arguments", "repair_message_sequence",
- "strip_think_blocks", "recover_with_credential_pool", "try_recover_primary_transport",
- "drop_thinking_only_and_merge_users", "restore_primary_runtime", "extract_reasoning",
- "dump_api_request_debug", "prompt_caching_disabled_from_config", "blank_cache_policy_stub",
- "plan_cache_sections_for_destination", "anthropic_prompt_cache_policy", "create_openai_client",
- "switch_model", "invoke_tool", "repair_tool_call", "sanitize_api_messages",
- "looks_like_codex_intermediate_ack", "copy_reasoning_content_for_api",
- "extract_api_error_context", "apply_pending_steer_to_tool_results", "_iter_pool_sockets",
+ "_iter_pool_sockets",
+ "anthropic_prompt_cache_policy",
+ "apply_pending_steer_to_tool_results",
+ "blank_cache_policy_stub",
+ "convert_to_trajectory_format",
+ "copy_reasoning_content_for_api",
+ "create_openai_client",
+ "drop_thinking_only_and_merge_users",
+ "dump_api_request_debug",
+ "extract_api_error_context",
+ "extract_reasoning",
"force_close_tcp_sockets",
+ "invoke_tool",
+ "looks_like_codex_intermediate_ack",
+ "plan_cache_sections_for_destination",
+ "prompt_caching_disabled_from_config",
+ "recover_with_credential_pool",
+ "repair_message_sequence",
+ "repair_tool_call",
+ "restore_primary_runtime",
+ "sanitize_api_messages",
+ "sanitize_tool_call_arguments",
+ "strip_think_blocks",
+ "switch_model",
+ "try_recover_primary_transport",
]
diff --git a/agent/azure_identity_adapter.py b/agent/azure_identity_adapter.py
index eb09e7716d4..443d1d0a641 100644
--- a/agent/azure_identity_adapter.py
+++ b/agent/azure_identity_adapter.py
@@ -337,7 +337,15 @@ def build_bearer_http_client(token_provider: Callable[[], str], **httpx_kwargs:
__all__ = [
- "EntraIdentityConfig", "SCOPE_AI_AZURE_DEFAULT", "build_bearer_http_client", "build_credential",
- "build_token_provider", "describe_active_credential", "has_azure_identity_credentials",
- "has_azure_identity_installed", "is_token_provider", "materialize_bearer_for_http", "reset_credential_cache",
+ "SCOPE_AI_AZURE_DEFAULT",
+ "EntraIdentityConfig",
+ "build_bearer_http_client",
+ "build_credential",
+ "build_token_provider",
+ "describe_active_credential",
+ "has_azure_identity_credentials",
+ "has_azure_identity_installed",
+ "is_token_provider",
+ "materialize_bearer_for_http",
+ "reset_credential_cache",
]
diff --git a/agent/background_review.py b/agent/background_review.py
index 3ccc84a9530..e15ae748346 100644
--- a/agent/background_review.py
+++ b/agent/background_review.py
@@ -1330,6 +1330,11 @@ def spawn_background_review_thread(
__all__ = [
- "_MEMORY_REVIEW_PROMPT", "_SKILL_REVIEW_PROMPT", "_COMBINED_REVIEW_PROMPT", "load_background_review_settings",
- "spawn_background_review_thread", "summarize_background_review_actions", "build_memory_write_metadata",
+ "_COMBINED_REVIEW_PROMPT",
+ "_MEMORY_REVIEW_PROMPT",
+ "_SKILL_REVIEW_PROMPT",
+ "build_memory_write_metadata",
+ "load_background_review_settings",
+ "spawn_background_review_thread",
+ "summarize_background_review_actions",
]
diff --git a/agent/chat_completion_helpers.py b/agent/chat_completion_helpers.py
index b0ce7b6e201..3d170f80518 100644
--- a/agent/chat_completion_helpers.py
+++ b/agent/chat_completion_helpers.py
@@ -4050,5 +4050,12 @@ def interruptible_streaming_api_call(agent, api_kwargs: dict, *, on_first_delta=
return _StreamingCall(agent, api_kwargs, on_first_delta).run()
-__all__ = ["interruptible_api_call", "build_api_kwargs", "build_assistant_message", "try_activate_fallback",
- "handle_max_iterations", "cleanup_task_resources", "interruptible_streaming_api_call"]
+__all__ = [
+ "build_api_kwargs",
+ "build_assistant_message",
+ "cleanup_task_resources",
+ "handle_max_iterations",
+ "interruptible_api_call",
+ "interruptible_streaming_api_call",
+ "try_activate_fallback",
+]
diff --git a/agent/codex_runtime.py b/agent/codex_runtime.py
index 00225296506..f26c921d213 100644
--- a/agent/codex_runtime.py
+++ b/agent/codex_runtime.py
@@ -1386,6 +1386,8 @@ def run_codex_stream(agent, api_kwargs: dict, client: Any = None, on_first_delta
__all__ = [
- "run_codex_app_server_turn", "run_codex_stream",
- "_consume_codex_event_stream", "make_codex_app_server_event_bridge",
+ "_consume_codex_event_stream",
+ "make_codex_app_server_event_bridge",
+ "run_codex_app_server_turn",
+ "run_codex_stream",
]
diff --git a/agent/conversation_compression.py b/agent/conversation_compression.py
index 10078eff365..092961c8f85 100644
--- a/agent/conversation_compression.py
+++ b/agent/conversation_compression.py
@@ -4566,9 +4566,15 @@ def try_shrink_image_parts_in_messages(api_messages: list, *, max_dimension: int
__all__ = [
- "COMPACTION_STATUS", "COMPACTION_DONE_STATUS", "COMPACTION_HEARTBEAT_STATUS", "COMPACTION_STATUS_MARKER", "is_compaction_progress_status",
- "check_compression_model_feasibility", "ensure_compression_feasibility_checked",
- "revalidate_compression_feasibility", "replay_compression_warning",
+ "COMPACTION_DONE_STATUS",
+ "COMPACTION_HEARTBEAT_STATUS",
+ "COMPACTION_STATUS",
+ "COMPACTION_STATUS_MARKER",
+ "check_compression_model_feasibility",
"compress_context",
+ "ensure_compression_feasibility_checked",
+ "is_compaction_progress_status",
+ "replay_compression_warning",
+ "revalidate_compression_feasibility",
"try_shrink_image_parts_in_messages",
]
diff --git a/agent/deadline.py b/agent/deadline.py
index 5dd11172f28..34ead7cb14a 100644
--- a/agent/deadline.py
+++ b/agent/deadline.py
@@ -30,8 +30,14 @@ from typing import Any, Awaitable, Callable, Optional, Protocol
logger = logging.getLogger(__name__)
__all__ = [
- "MAX_SAFE_TIMEOUT_S", "BoundedResult", "DeadlineExpired", "clamp_timeout", "resolve_timeout",
- "run_bounded_async", "run_bounded_sync", "kill_process_tree",
+ "MAX_SAFE_TIMEOUT_S",
+ "BoundedResult",
+ "DeadlineExpired",
+ "clamp_timeout",
+ "kill_process_tree",
+ "resolve_timeout",
+ "run_bounded_async",
+ "run_bounded_sync",
]
# Upper bound for any timeout handed to platform wait primitives.
diff --git a/agent/i18n.py b/agent/i18n.py
index 9ee5f1c29f3..05f875cb55e 100644
--- a/agent/i18n.py
+++ b/agent/i18n.py
@@ -244,6 +244,13 @@ def t(key: str, lang: str | None = None, **format_kwargs: Any) -> str:
__all__ = [
- "SUPPORTED_LANGUAGES", "DEFAULT_LANGUAGE", "t", "get_language", "reset_language_cache",
- "supported_languages", "resolve_language_id", "language_options", "surface_catalog",
+ "DEFAULT_LANGUAGE",
+ "SUPPORTED_LANGUAGES",
+ "get_language",
+ "language_options",
+ "reset_language_cache",
+ "resolve_language_id",
+ "supported_languages",
+ "surface_catalog",
+ "t",
]
diff --git a/agent/i18n_layers.py b/agent/i18n_layers.py
index 96e2df6d2ea..d6d9a801078 100644
--- a/agent/i18n_layers.py
+++ b/agent/i18n_layers.py
@@ -276,8 +276,26 @@ def registered_packs() -> tuple[PackEntry, ...]:
__all__ = [
- "CORE_SURFACE", "SURFACES", "PackEntry", "normalize_language_id", "is_language_id", "flatten",
- "non_text_leaves", "parse_locale_file", "load_locale_source", "scan_locale_dir", "register_pack",
- "unregister_pack", "pack_layer", "pack_languages", "pack_info", "overlay_dir", "overlay_layer",
- "overlay_languages", "surface_catalog", "layered_languages", "clear_cache", "registered_packs",
+ "CORE_SURFACE",
+ "SURFACES",
+ "PackEntry",
+ "clear_cache",
+ "flatten",
+ "is_language_id",
+ "layered_languages",
+ "load_locale_source",
+ "non_text_leaves",
+ "normalize_language_id",
+ "overlay_dir",
+ "overlay_languages",
+ "overlay_layer",
+ "pack_info",
+ "pack_languages",
+ "pack_layer",
+ "parse_locale_file",
+ "register_pack",
+ "registered_packs",
+ "scan_locale_dir",
+ "surface_catalog",
+ "unregister_pack",
]
diff --git a/agent/image_routing.py b/agent/image_routing.py
index 3fd83b40d92..763f20a5660 100644
--- a/agent/image_routing.py
+++ b/agent/image_routing.py
@@ -563,4 +563,4 @@ def build_native_content_parts(
return [{"type": "text", "text": combined_text}, *image_parts], skipped
-__all__ = ["decide_image_input_mode", "build_native_content_parts", "extract_image_refs"]
+__all__ = ["build_native_content_parts", "decide_image_input_mode", "extract_image_refs"]
diff --git a/agent/lsp/__init__.py b/agent/lsp/__init__.py
index e7f0338ee5d..8ceb6b35ef8 100644
--- a/agent/lsp/__init__.py
+++ b/agent/lsp/__init__.py
@@ -100,4 +100,4 @@ def _atexit_shutdown() -> None:
logger.debug("atexit LSP shutdown failed: %s", e)
-__all__ = ["get_service", "release_workspace", "shutdown_service", "LSPService"]
+__all__ = ["LSPService", "get_service", "release_workspace", "shutdown_service"]
diff --git a/agent/lsp/client.py b/agent/lsp/client.py
index 3115f317485..d6b39c4aa95 100644
--- a/agent/lsp/client.py
+++ b/agent/lsp/client.py
@@ -778,4 +778,4 @@ def _diagnostic_key(d: dict[str, Any]) -> str:
])
-__all__ = ["LSPClient", "file_uri", "uri_to_path", "INITIALIZE_TIMEOUT", "DIAGNOSTICS_DOCUMENT_WAIT", "DIAGNOSTICS_FULL_WAIT"]
+__all__ = ["DIAGNOSTICS_DOCUMENT_WAIT", "DIAGNOSTICS_FULL_WAIT", "INITIALIZE_TIMEOUT", "LSPClient", "file_uri", "uri_to_path"]
diff --git a/agent/lsp/eventlog.py b/agent/lsp/eventlog.py
index c85bdb2724a..8452680cc1d 100644
--- a/agent/lsp/eventlog.py
+++ b/agent/lsp/eventlog.py
@@ -173,8 +173,19 @@ def reset_announce_caches() -> None:
__all__ = [
- "event_log", "log_clean", "log_disabled", "log_active", "log_diagnostics", "log_no_project_root",
- "log_server_unavailable", "log_timeout", "log_server_error", "log_spawn_failed", "log_skipped_broken", "log_root_excluded",
- "log_untrusted_skipped", "log_reaped",
+ "event_log",
+ "log_active",
+ "log_clean",
+ "log_diagnostics",
+ "log_disabled",
+ "log_no_project_root",
+ "log_reaped",
+ "log_root_excluded",
+ "log_server_error",
+ "log_server_unavailable",
+ "log_skipped_broken",
+ "log_spawn_failed",
+ "log_timeout",
+ "log_untrusted_skipped",
"reset_announce_caches",
]
diff --git a/agent/lsp/install.py b/agent/lsp/install.py
index 01eece2e762..11d1aa075f5 100644
--- a/agent/lsp/install.py
+++ b/agent/lsp/install.py
@@ -321,4 +321,4 @@ def detect_status(pkg: str) -> str:
return "manual-only" if recipe and recipe.get("strategy") == "manual" else "missing"
-__all__ = ["INSTALL_RECIPES", "try_install", "detect_status", "hermes_lsp_bin_dir"]
+__all__ = ["INSTALL_RECIPES", "detect_status", "hermes_lsp_bin_dir", "try_install"]
diff --git a/agent/lsp/protocol.py b/agent/lsp/protocol.py
index 5e3e52465bf..1b45a71bf44 100644
--- a/agent/lsp/protocol.py
+++ b/agent/lsp/protocol.py
@@ -132,7 +132,15 @@ def classify_message(msg: dict) -> tuple[str, Any]:
__all__ = [
- "ERROR_CONTENT_MODIFIED", "ERROR_METHOD_NOT_FOUND", "LSPProtocolError", "LSPRequestError",
- "encode_message", "read_message", "make_request", "make_notification", "make_response",
- "make_error_response", "classify_message",
+ "ERROR_CONTENT_MODIFIED",
+ "ERROR_METHOD_NOT_FOUND",
+ "LSPProtocolError",
+ "LSPRequestError",
+ "classify_message",
+ "encode_message",
+ "make_error_response",
+ "make_notification",
+ "make_request",
+ "make_response",
+ "read_message",
]
diff --git a/agent/lsp/range_shift.py b/agent/lsp/range_shift.py
index e5cc6ac5096..c62803465dd 100644
--- a/agent/lsp/range_shift.py
+++ b/agent/lsp/range_shift.py
@@ -73,4 +73,4 @@ def shift_baseline(baseline: list[dict[str, Any]], shift: _Shift) -> list[dict[s
return [s for s in shifted if s is not None]
-__all__ = ["build_line_shift", "shift_diagnostic_range", "shift_baseline"]
+__all__ = ["build_line_shift", "shift_baseline", "shift_diagnostic_range"]
diff --git a/agent/lsp/reporter.py b/agent/lsp/reporter.py
index a05a64e8296..1c4b2ad0572 100644
--- a/agent/lsp/reporter.py
+++ b/agent/lsp/reporter.py
@@ -77,4 +77,4 @@ def truncate(s: str, *, limit: int = MAX_TOTAL_CHARS) -> str:
return elide(s, limit)
-__all__ = ["SEVERITY_NAMES", "DEFAULT_SEVERITIES", "MAX_PER_FILE", "format_diagnostic", "report_for_file", "truncate"]
+__all__ = ["DEFAULT_SEVERITIES", "MAX_PER_FILE", "SEVERITY_NAMES", "format_diagnostic", "report_for_file", "truncate"]
diff --git a/agent/lsp/servers.py b/agent/lsp/servers.py
index 48367382054..e61db5d6b19 100644
--- a/agent/lsp/servers.py
+++ b/agent/lsp/servers.py
@@ -524,5 +524,14 @@ def custom_servers(servers_cfg: Any) -> list[ServerDef]:
return out
-__all__ = ["ServerDef", "ServerContext", "SpawnSpec", "SERVERS", "UNTRUSTED_SAFE_SERVERS", "custom_servers",
- "find_server_for_file", "language_id_for", "LANGUAGE_BY_EXT"]
+__all__ = [
+ "LANGUAGE_BY_EXT",
+ "SERVERS",
+ "UNTRUSTED_SAFE_SERVERS",
+ "ServerContext",
+ "ServerDef",
+ "SpawnSpec",
+ "custom_servers",
+ "find_server_for_file",
+ "language_id_for",
+]
diff --git a/agent/lsp/workspace.py b/agent/lsp/workspace.py
index c18571c4fd6..400b15bee98 100644
--- a/agent/lsp/workspace.py
+++ b/agent/lsp/workspace.py
@@ -199,6 +199,12 @@ def clear_cache() -> None:
__all__ = [
- "find_git_worktree", "is_inside_workspace", "is_trusted_workspace", "nearest_root", "normalize_path",
- "operator_workspace_roots", "resolve_workspace_for_file", "clear_cache",
+ "clear_cache",
+ "find_git_worktree",
+ "is_inside_workspace",
+ "is_trusted_workspace",
+ "nearest_root",
+ "normalize_path",
+ "operator_workspace_roots",
+ "resolve_workspace_for_file",
]
diff --git a/agent/message_sanitization.py b/agent/message_sanitization.py
index d8d36dd8096..17c4969f60c 100644
--- a/agent/message_sanitization.py
+++ b/agent/message_sanitization.py
@@ -459,19 +459,15 @@ def _looks_like_corrupt_image_rejection(error_body: str) -> bool:
__all__ = [
- "_SURROGATE_RE", "close_interrupted_tool_sequence",
- "_sanitize_surrogates", "_sanitize_structure_surrogates", "_sanitize_messages_surrogates",
- "coerce_tool_name",
- "_escape_invalid_chars_in_json_strings", "_repair_tool_call_arguments",
- "_strip_non_ascii", "_sanitize_messages_non_ascii", "_sanitize_tools_non_ascii",
- "_strip_images_from_messages", "_sanitize_structure_non_ascii", "sanitize_outbound_kwargs",
- "strip_images_for_rejecting_model",
- # call_id policy owners
- "deterministic_call_id", "coalesce_tool_call_id", "tool_call_id_variants",
- "tool_result_id_variants", "uniquify_tool_call_ids", "normalize_provider_tool_call_ids",
- # reasoning_content policy owners
- "reasoning_echo_family", "matches_reasoning_echo_family", "needs_reasoning_echo",
- "stale_thinking_reaches_wire", "apply_reasoning_content_policy", "reapply_reasoning_echo",
+ "_SURROGATE_RE", "_escape_invalid_chars_in_json_strings", "_repair_tool_call_arguments",
+ "_sanitize_messages_non_ascii", "_sanitize_messages_surrogates", "_sanitize_structure_non_ascii",
+ "_sanitize_structure_surrogates", "_sanitize_surrogates", "_sanitize_tools_non_ascii",
+ "_strip_images_from_messages", "_strip_non_ascii", "apply_reasoning_content_policy",
+ "close_interrupted_tool_sequence", "coalesce_tool_call_id", "coerce_tool_name",
+ "deterministic_call_id", "matches_reasoning_echo_family", "needs_reasoning_echo",
+ "normalize_provider_tool_call_ids", "reapply_reasoning_echo", "reasoning_echo_family",
+ "sanitize_outbound_kwargs", "stale_thinking_reaches_wire", "strip_images_for_rejecting_model",
+ "tool_call_id_variants", "tool_result_id_variants", "uniquify_tool_call_ids",
]
diff --git a/agent/monitoring/__init__.py b/agent/monitoring/__init__.py
index 85f95932b97..43b19463823 100644
--- a/agent/monitoring/__init__.py
+++ b/agent/monitoring/__init__.py
@@ -14,4 +14,4 @@ from . import emitter, events
emit = emitter.emit
get_emitter = emitter.get_emitter
-__all__ = ["emitter", "events", "emit", "get_emitter"]
+__all__ = ["emit", "emitter", "events", "get_emitter"]
diff --git a/agent/monitoring/emitter.py b/agent/monitoring/emitter.py
index 9b0b136a909..87cc10fa622 100644
--- a/agent/monitoring/emitter.py
+++ b/agent/monitoring/emitter.py
@@ -164,4 +164,4 @@ def reset_emitter_for_tests(emitter: Optional[MonitoringEmitter] = None) -> None
_EMITTER = emitter
-__all__ = ["MonitoringEmitter", "get_emitter", "emit", "reset_emitter_for_tests"]
+__all__ = ["MonitoringEmitter", "emit", "get_emitter", "reset_emitter_for_tests"]
diff --git a/agent/monitoring/events.py b/agent/monitoring/events.py
index b396a8195b8..34da232a2c3 100644
--- a/agent/monitoring/events.py
+++ b/agent/monitoring/events.py
@@ -75,4 +75,4 @@ class CronExecutionEvent(_MonitoringEvent):
ts_ns: int = field(default_factory=time.time_ns)
-__all__ = ["GatewayHealthEvent", "GatewayDiagnosticEvent", "CronExecutionEvent"]
+__all__ = ["CronExecutionEvent", "GatewayDiagnosticEvent", "GatewayHealthEvent"]
diff --git a/agent/monitoring/gateway_health.py b/agent/monitoring/gateway_health.py
index ace95bddaf8..0a7e29134ce 100644
--- a/agent/monitoring/gateway_health.py
+++ b/agent/monitoring/gateway_health.py
@@ -326,6 +326,10 @@ class GatewayDiagnosticLogHandler(logging.Handler):
__all__ = [
- "GatewayMetric", "GatewayHealthSnapshot", "GatewayDiagnosticLogHandler",
- "build_gateway_health_snapshot", "classify_gateway_error", "source_logger_for_export",
+ "GatewayDiagnosticLogHandler",
+ "GatewayHealthSnapshot",
+ "GatewayMetric",
+ "build_gateway_health_snapshot",
+ "classify_gateway_error",
+ "source_logger_for_export",
]
diff --git a/agent/monitoring/otlp_exporter.py b/agent/monitoring/otlp_exporter.py
index 0c1cd4bfc07..f2150b32436 100644
--- a/agent/monitoring/otlp_exporter.py
+++ b/agent/monitoring/otlp_exporter.py
@@ -283,5 +283,11 @@ def start_streaming(
__all__ = [
- "OTLPUnavailable", "OTLPStreamer", "build_exporter", "export_batch", "is_available", "is_enabled", "start_streaming",
+ "OTLPStreamer",
+ "OTLPUnavailable",
+ "build_exporter",
+ "export_batch",
+ "is_available",
+ "is_enabled",
+ "start_streaming",
]
diff --git a/agent/monitoring/redaction.py b/agent/monitoring/redaction.py
index ebb1487501d..35ec3e7a8ad 100644
--- a/agent/monitoring/redaction.py
+++ b/agent/monitoring/redaction.py
@@ -42,4 +42,4 @@ def redact_bounded(raw: Any, *, limit: int = 500, empty: str = "[redacted]", una
return unavailable
-__all__ = ["redact_for_export", "redact_bounded"]
+__all__ = ["redact_bounded", "redact_for_export"]
diff --git a/agent/onboarding.py b/agent/onboarding.py
index ad78ab2ccf7..3dc1cc0e2dc 100644
--- a/agent/onboarding.py
+++ b/agent/onboarding.py
@@ -253,9 +253,22 @@ def mark_seen(config_path: Path, flag: str) -> bool:
__all__ = [
- "BUSY_INPUT_FLAG", "TOOL_PROGRESS_FLAG", "OPENCLAW_RESIDUE_FLAG", "PROFILE_BUILD_FLAG",
- "PLAIN_INTRO_NOTE", "SETUP_OFFER_NOTE", "first_contact_turn_note", "setup_command",
- "busy_input_hint_gateway", "busy_input_hint_cli", "tool_progress_hint_gateway", "tool_progress_hint_cli",
- "openclaw_residue_hint_cli", "detect_openclaw_residue", "profile_build_mode", "profile_build_directive",
- "is_seen", "mark_seen",
+ "BUSY_INPUT_FLAG",
+ "OPENCLAW_RESIDUE_FLAG",
+ "PLAIN_INTRO_NOTE",
+ "PROFILE_BUILD_FLAG",
+ "SETUP_OFFER_NOTE",
+ "TOOL_PROGRESS_FLAG",
+ "busy_input_hint_cli",
+ "busy_input_hint_gateway",
+ "detect_openclaw_residue",
+ "first_contact_turn_note",
+ "is_seen",
+ "mark_seen",
+ "openclaw_residue_hint_cli",
+ "profile_build_directive",
+ "profile_build_mode",
+ "setup_command",
+ "tool_progress_hint_cli",
+ "tool_progress_hint_gateway",
]
diff --git a/agent/pet/__init__.py b/agent/pet/__init__.py
index 64f3213084c..d27992dc670 100644
--- a/agent/pet/__init__.py
+++ b/agent/pet/__init__.py
@@ -14,4 +14,4 @@ effect on prompt caching.
from agent.pet.constants import DEFAULT_SCALE, FRAME_H, FRAME_W, FRAMES_PER_STATE, LOOP_MS, STATE_ROWS, PetState
from agent.pet.state import derive_pet_state
-__all__ = ["DEFAULT_SCALE", "FRAME_H", "FRAME_W", "FRAMES_PER_STATE", "LOOP_MS", "STATE_ROWS", "PetState", "derive_pet_state"]
+__all__ = ["DEFAULT_SCALE", "FRAMES_PER_STATE", "FRAME_H", "FRAME_W", "LOOP_MS", "STATE_ROWS", "PetState", "derive_pet_state"]
diff --git a/agent/plugin_llm.py b/agent/plugin_llm.py
index 310e35cae6d..1d08732a446 100644
--- a/agent/plugin_llm.py
+++ b/agent/plugin_llm.py
@@ -588,6 +588,13 @@ def make_plugin_llm_for_test(*, plugin_id: str, policy: _TrustPolicy, sync_calle
__all__ = [
- "PluginLlm", "PluginLlmTextInput", "PluginLlmImageInput", "PluginLlmInput", "PluginLlmUsage",
- "PluginLlmCompleteResult", "PluginLlmStructuredResult", "PluginLlmTrustError", "make_plugin_llm_for_test",
+ "PluginLlm",
+ "PluginLlmCompleteResult",
+ "PluginLlmImageInput",
+ "PluginLlmInput",
+ "PluginLlmStructuredResult",
+ "PluginLlmTextInput",
+ "PluginLlmTrustError",
+ "PluginLlmUsage",
+ "make_plugin_llm_for_test",
]
diff --git a/agent/process_bootstrap.py b/agent/process_bootstrap.py
index b23bcc64c62..9d2ede55b47 100644
--- a/agent/process_bootstrap.py
+++ b/agent/process_bootstrap.py
@@ -337,7 +337,14 @@ OpenAI = _OpenAIProxy()
__all__ = [
- "OpenAI", "_OpenAIProxy", "_load_openai_cls", "_SafeWriter", "_install_safe_stdio", "_get_proxy_from_env",
- "_get_proxy_for_base_url", "build_keepalive_http_client", "close_shared_transports",
+ "OpenAI",
+ "_OpenAIProxy",
+ "_SafeWriter",
+ "_get_proxy_for_base_url",
+ "_get_proxy_from_env",
+ "_install_safe_stdio",
+ "_load_openai_cls",
+ "build_keepalive_http_client",
+ "close_shared_transports",
"enable_happy_eyeballs_on_client",
]
diff --git a/agent/stream_diag.py b/agent/stream_diag.py
index 4ea8a2f997c..10af9ec5d71 100644
--- a/agent/stream_diag.py
+++ b/agent/stream_diag.py
@@ -230,11 +230,11 @@ def buffer_connect_exhausted_notice(agent: Any, error: BaseException, *, attempt
__all__ = [
"STREAM_DIAG_HEADERS",
- "connect_exhausted_notice",
"buffer_connect_exhausted_notice",
- "stream_diag_init",
- "stream_diag_capture_response",
+ "connect_exhausted_notice",
+ "emit_stream_drop",
"flatten_exception_chain",
"log_stream_retry",
- "emit_stream_drop",
+ "stream_diag_capture_response",
+ "stream_diag_init",
]
diff --git a/agent/system_prompt.py b/agent/system_prompt.py
index ca24d2784a3..a2ef790d4b5 100644
--- a/agent/system_prompt.py
+++ b/agent/system_prompt.py
@@ -869,5 +869,11 @@ def format_tools_for_system_message(agent: Any) -> str:
for t in agent.tools], ensure_ascii=False)
-__all__ = ["build_system_prompt_parts", "build_system_prompt", "invalidate_system_prompt",
- "platform_hint", "restore_plugin_prompt_sections", "format_tools_for_system_message"]
+__all__ = [
+ "build_system_prompt",
+ "build_system_prompt_parts",
+ "format_tools_for_system_message",
+ "invalidate_system_prompt",
+ "platform_hint",
+ "restore_plugin_prompt_sections",
+]
diff --git a/agent/think_scrubber.py b/agent/think_scrubber.py
index 5c35a6745f2..a76f14f02a7 100644
--- a/agent/think_scrubber.py
+++ b/agent/think_scrubber.py
@@ -13,7 +13,7 @@ from __future__ import annotations
import re
from typing import Tuple
-__all__ = ["StreamingThinkScrubber", "THINK_TAG_NAMES", "THINK_OPEN_TAGS", "THINK_CLOSE_TAGS"]
+__all__ = ["THINK_CLOSE_TAGS", "THINK_OPEN_TAGS", "THINK_TAG_NAMES", "StreamingThinkScrubber"]
# The one list of model reasoning tag names. Every surface that hides reasoning (this scrubber,
# the CLI stream filter, the gateway stream filter, the final-response regex stripper) binds to
diff --git a/agent/tool_dispatch_helpers.py b/agent/tool_dispatch_helpers.py
index 7bf493c7452..297cd635bf5 100644
--- a/agent/tool_dispatch_helpers.py
+++ b/agent/tool_dispatch_helpers.py
@@ -582,13 +582,29 @@ def _maybe_wrap_untrusted(name: str, content: Any) -> Any:
__all__ = [
- "_NEVER_PARALLEL_TOOLS", "_PARALLEL_SAFE_TOOLS", "_PATH_SCOPED_TOOLS", "_PATH_SCOPED_READERS",
- "_PATH_SCOPED_WRITERS", "_DESTRUCTIVE_PATTERNS", "_REDIRECT_OVERWRITE", "_context_pruned_argument_paths",
+ "_DESTRUCTIVE_PATTERNS",
+ "_NEVER_PARALLEL_TOOLS",
+ "_PARALLEL_SAFE_TOOLS",
+ "_PATH_SCOPED_READERS",
+ "_PATH_SCOPED_TOOLS",
+ "_PATH_SCOPED_WRITERS",
+ "_REDIRECT_OVERWRITE",
+ "_append_subdir_hint_to_multimodal",
+ "_canonical_path",
+ "_context_pruned_argument_paths",
+ "_detect_upstream_elision",
+ "_extract_error_preview",
+ "_extract_file_mutation_targets",
+ "_extract_landed_file_mutation_paths",
+ "_extract_parallel_scope_path",
+ "_extract_parallel_scope_paths",
"_is_destructive_command",
- "_plan_tool_batch_segments", "_should_parallelize_tool_batch", "_canonical_path",
- "_extract_parallel_scope_path", "_extract_parallel_scope_paths", "_paths_overlap",
- "_is_multimodal_tool_result", "_multimodal_text_summary", "_append_subdir_hint_to_multimodal",
- "_extract_file_mutation_targets", "_extract_landed_file_mutation_paths", "_extract_error_preview",
- "_trajectory_normalize_msg", "_detect_upstream_elision", "_maybe_append_elision_notice",
+ "_is_multimodal_tool_result",
+ "_maybe_append_elision_notice",
+ "_multimodal_text_summary",
+ "_paths_overlap",
+ "_plan_tool_batch_segments",
+ "_should_parallelize_tool_batch",
+ "_trajectory_normalize_msg",
"make_tool_result_message",
]
diff --git a/agent/tool_executor.py b/agent/tool_executor.py
index ca8ab97c85b..f0783edaa75 100644
--- a/agent/tool_executor.py
+++ b/agent/tool_executor.py
@@ -1936,6 +1936,6 @@ def execute_tool_calls_segmented(agent, assistant_message, messages: list, effec
__all__ = [
"execute_tool_calls_concurrent",
- "execute_tool_calls_sequential",
"execute_tool_calls_segmented",
+ "execute_tool_calls_sequential",
]
diff --git a/agent/turn_summary.py b/agent/turn_summary.py
index 3351c333c8b..74f25c441c4 100644
--- a/agent/turn_summary.py
+++ b/agent/turn_summary.py
@@ -16,9 +16,9 @@ from typing import Any
__all__ = [
"TurnSummaryCollector",
"TurnTally",
- "format_turn_summary",
- "format_token_flow",
"format_elapsed",
+ "format_token_flow",
+ "format_turn_summary",
]
diff --git a/agent/verify/__init__.py b/agent/verify/__init__.py
index d4f780d7f3b..728ceff30e7 100644
--- a/agent/verify/__init__.py
+++ b/agent/verify/__init__.py
@@ -10,6 +10,15 @@ from agent.verify.recipes import Recipe, detect_package_manager, detect_recipe
from agent.verify.runner import PhaseResult, ReadinessResult, VerifyResult, run_verify
__all__ = [
- "Recipe", "detect_recipe", "detect_package_manager", "load_manifest", "save_manifest",
- "load_or_detect", "manifest_path", "run_verify", "PhaseResult", "ReadinessResult", "VerifyResult",
+ "PhaseResult",
+ "ReadinessResult",
+ "Recipe",
+ "VerifyResult",
+ "detect_package_manager",
+ "detect_recipe",
+ "load_manifest",
+ "load_or_detect",
+ "manifest_path",
+ "run_verify",
+ "save_manifest",
]
diff --git a/cron/__init__.py b/cron/__init__.py
index 1c6f1fd5930..ad13295b2ca 100644
--- a/cron/__init__.py
+++ b/cron/__init__.py
@@ -25,15 +25,15 @@ from cron.jobs import (
from cron.scheduler import tick
__all__ = [
+ "JOBS_FILE",
"create_job",
"get_job",
"list_jobs",
- "remove_job",
- "update_job",
"pause_job",
- "resume_job",
- "trigger_job",
"rearm_oneshot",
+ "remove_job",
+ "resume_job",
"tick",
- "JOBS_FILE",
+ "trigger_job",
+ "update_job",
]
diff --git a/cron/blueprint_catalog.py b/cron/blueprint_catalog.py
index ce06b754804..219b2490faf 100644
--- a/cron/blueprint_catalog.py
+++ b/cron/blueprint_catalog.py
@@ -12,18 +12,18 @@ from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional
__all__ = [
- "BlueprintSlot",
- "AutomationBlueprint",
"CATALOG",
- "get_blueprint",
- "list_blueprints",
+ "WEEKDAY_PRESETS",
+ "AutomationBlueprint",
+ "BlueprintFillError",
+ "BlueprintSlot",
+ "blueprint_catalog_entry",
+ "blueprint_deeplink",
"blueprint_form_schema",
"blueprint_slash_command",
- "blueprint_deeplink",
- "blueprint_catalog_entry",
"fill_blueprint",
- "BlueprintFillError",
- "WEEKDAY_PRESETS",
+ "get_blueprint",
+ "list_blueprints",
]
diff --git a/cron/suggestion_catalog.py b/cron/suggestion_catalog.py
index 8eaa5cab06d..01ba3b57fdd 100644
--- a/cron/suggestion_catalog.py
+++ b/cron/suggestion_catalog.py
@@ -15,7 +15,7 @@ from dataclasses import dataclass
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional
-__all__ = ["CatalogEntry", "CATALOG", "seed_catalog_suggestions", "classify_items_script_path"]
+__all__ = ["CATALOG", "CatalogEntry", "classify_items_script_path", "seed_catalog_suggestions"]
def classify_items_script_path() -> str:
diff --git a/gateway/platforms/qqbot/__init__.py b/gateway/platforms/qqbot/__init__.py
index 0e8d34c1560..277e02fe1f6 100644
--- a/gateway/platforms/qqbot/__init__.py
+++ b/gateway/platforms/qqbot/__init__.py
@@ -14,12 +14,29 @@ from .keyboards import (
)
__all__ = [
- "QQAdapter", "QQCloseError", "check_qq_requirements", "_coerce_list", "_ssrf_redirect_guard",
- "BindStatus", "build_connect_url", "qr_register",
- "decrypt_secret", "generate_bind_key",
- "build_user_agent", "get_api_headers", "coerce_list",
- "ChunkedUploader", "UploadDailyLimitExceededError", "UploadFileTooLargeError",
- "ApprovalRequest", "InlineKeyboard", "InteractionEvent",
- "build_approval_keyboard", "build_approval_text", "build_update_prompt_keyboard",
- "parse_approval_button_data", "parse_interaction_event", "parse_update_prompt_button_data",
+ "ApprovalRequest",
+ "BindStatus",
+ "ChunkedUploader",
+ "InlineKeyboard",
+ "InteractionEvent",
+ "QQAdapter",
+ "QQCloseError",
+ "UploadDailyLimitExceededError",
+ "UploadFileTooLargeError",
+ "_coerce_list",
+ "_ssrf_redirect_guard",
+ "build_approval_keyboard",
+ "build_approval_text",
+ "build_connect_url",
+ "build_update_prompt_keyboard",
+ "build_user_agent",
+ "check_qq_requirements",
+ "coerce_list",
+ "decrypt_secret",
+ "generate_bind_key",
+ "get_api_headers",
+ "parse_approval_button_data",
+ "parse_interaction_event",
+ "parse_update_prompt_button_data",
+ "qr_register",
]
diff --git a/gateway/relay/media.py b/gateway/relay/media.py
index 4b957f41659..f9909514255 100644
--- a/gateway/relay/media.py
+++ b/gateway/relay/media.py
@@ -156,4 +156,4 @@ class RelayMediaClient:
return await asyncio.get_running_loop().run_in_executor(None, _get)
-__all__ = ["RelayMediaClient", "media_base_url", "MEDIA_MAX_BYTES"]
+__all__ = ["MEDIA_MAX_BYTES", "RelayMediaClient", "media_base_url"]
diff --git a/gateway/slash_access.py b/gateway/slash_access.py
index 5c8efb2269a..22b21014d44 100644
--- a/gateway/slash_access.py
+++ b/gateway/slash_access.py
@@ -130,7 +130,7 @@ def policy_for_source(gateway_config: Any, source: Any) -> SlashAccessPolicy:
return dm_policy if dm_policy.enabled and not group_policy.enabled else group_policy
-__all__ = ["SlashAccessPolicy", "policy_from_extra", "policy_for_source"]
+__all__ = ["SlashAccessPolicy", "policy_for_source", "policy_from_extra"]
diff --git a/gateway/stream_events.py b/gateway/stream_events.py
index 4902f22f36a..1a1e74c2b80 100644
--- a/gateway/stream_events.py
+++ b/gateway/stream_events.py
@@ -75,6 +75,12 @@ StreamEvent = Union[
]
__all__ = [
- "MessageChunk", "MessageStop", "Commentary", "ToolCallChunk",
- "ToolCallFinished", "LongToolHint", "GatewayNotice", "StreamEvent",
+ "Commentary",
+ "GatewayNotice",
+ "LongToolHint",
+ "MessageChunk",
+ "MessageStop",
+ "StreamEvent",
+ "ToolCallChunk",
+ "ToolCallFinished",
]
diff --git a/hermes_cli/_startup_fast.py b/hermes_cli/_startup_fast.py
index 658c106467b..c79e72404e7 100644
--- a/hermes_cli/_startup_fast.py
+++ b/hermes_cli/_startup_fast.py
@@ -28,17 +28,18 @@ import os
import sys
__all__ = [
- "project_root_str", "normalize_hermes_home_env",
- "ensure_project_root_on_path",
- "is_global_fast_version_argv",
- "is_container_startup_environment",
"active_profile_may_override_home",
"container_mode_may_be_active",
- "read_openai_version",
- "read_install_method",
+ "ensure_project_root_on_path",
+ "is_container_startup_environment",
+ "is_desktop_ssh_backend_argv",
+ "is_global_fast_version_argv",
+ "normalize_hermes_home_env",
"print_fast_version_info",
+ "project_root_str",
+ "read_install_method",
+ "read_openai_version",
"try_fast_version",
- "is_desktop_ssh_backend_argv",
]
diff --git a/hermes_cli/_subprocess_compat.py b/hermes_cli/_subprocess_compat.py
index 2896ed29b07..4d0a9a08ffd 100644
--- a/hermes_cli/_subprocess_compat.py
+++ b/hermes_cli/_subprocess_compat.py
@@ -17,26 +17,26 @@ from pathlib import Path
from typing import Mapping, NoReturn, Sequence
__all__ = [
+ "FILTER_DISCOVERY_FAILED",
"IS_WINDOWS",
- "resolve_node_command",
- "split_command_line",
- "restore_ambient_pythonpath",
- "suppress_platform_ver_console",
- "windows_detach_flags",
- "windows_detach_flags_without_breakaway",
- "windows_hide_flags",
- "windows_detach_popen_kwargs",
+ "NO_DRIVER_DIFF_FLAGS",
+ "NO_LAZY_FETCH_ENV",
"bounded_git_probe",
"bounded_probe_run",
- "selected_git_env",
"expose_pm_git",
"noninteractive_git_env",
"noninteractive_repo_git_env",
- "FILTER_DISCOVERY_FAILED",
- "NO_DRIVER_DIFF_FLAGS",
- "NO_LAZY_FETCH_ENV",
- "pid_is_hermes",
"pid_exists_stdlib",
+ "pid_is_hermes",
+ "resolve_node_command",
+ "restore_ambient_pythonpath",
+ "selected_git_env",
+ "split_command_line",
+ "suppress_platform_ver_console",
+ "windows_detach_flags",
+ "windows_detach_flags_without_breakaway",
+ "windows_detach_popen_kwargs",
+ "windows_hide_flags",
]
# Flags that neutralize *attribute-scoped* diff drivers on any diff-rendering git command. A
diff --git a/hermes_cli/bundled_app.py b/hermes_cli/bundled_app.py
index 8a3a26c7e8d..9e83b1515b2 100644
--- a/hermes_cli/bundled_app.py
+++ b/hermes_cli/bundled_app.py
@@ -26,9 +26,9 @@ from dataclasses import dataclass
from pathlib import Path
__all__ = [
+ "PAYLOAD_DIR_NAME",
"BundleLayout",
"NotBundledApp",
- "PAYLOAD_DIR_NAME",
"launch_detached",
"resolve_bundle_layout",
]
diff --git a/hermes_cli/credential_lifecycle.py b/hermes_cli/credential_lifecycle.py
index 49c15edb54f..0e88844b997 100644
--- a/hermes_cli/credential_lifecycle.py
+++ b/hermes_cli/credential_lifecycle.py
@@ -12,9 +12,10 @@ from __future__ import annotations
from typing import Any, Dict, List
__all__ = [
- "save_provider_env_credential",
+ "purge_env_credential_references",
"remove_provider_env_credential",
- "purge_env_credential_references"]
+ "save_provider_env_credential",
+]
def _providers_for_env_var(env_var: str) -> list[str]:
diff --git a/hermes_cli/dashboard_auth/__init__.py b/hermes_cli/dashboard_auth/__init__.py
index 17bd8a075e7..05941a68bdd 100644
--- a/hermes_cli/dashboard_auth/__init__.py
+++ b/hermes_cli/dashboard_auth/__init__.py
@@ -14,7 +14,20 @@ from hermes_cli.dashboard_auth.registry import (
list_session_providers, clear_providers)
__all__ = [
- "DashboardAuthProvider", "Session", "TokenPrincipal", "LoginStart", "InvalidCodeError",
- "InvalidCredentialsError", "ProviderError", "RefreshExpiredError", "assert_protocol_compliance",
- "classify_jwks_lookup_error", "register_provider", "get_provider", "list_providers",
- "list_token_providers", "list_session_providers", "clear_providers"]
+ "DashboardAuthProvider",
+ "InvalidCodeError",
+ "InvalidCredentialsError",
+ "LoginStart",
+ "ProviderError",
+ "RefreshExpiredError",
+ "Session",
+ "TokenPrincipal",
+ "assert_protocol_compliance",
+ "classify_jwks_lookup_error",
+ "clear_providers",
+ "get_provider",
+ "list_providers",
+ "list_session_providers",
+ "list_token_providers",
+ "register_provider",
+]
diff --git a/hermes_cli/goals.py b/hermes_cli/goals.py
index b7c1bed9f3e..d7d2aafe65a 100644
--- a/hermes_cli/goals.py
+++ b/hermes_cli/goals.py
@@ -1749,11 +1749,27 @@ def run_kanban_goal_loop(
__all__ = [
- "GoalState", "GoalContract", "GoalGate", "GoalManager", "parse_contract", "draft_contract", "run_gate",
- "CONTINUATION_PROMPT_TEMPLATE", "CONTINUATION_PROMPT_WITH_SUBGOALS_TEMPLATE",
- "CONTINUATION_PROMPT_WITH_CONTRACT_TEMPLATE", "JUDGE_USER_PROMPT_TEMPLATE",
- "JUDGE_USER_PROMPT_WITH_SUBGOALS_TEMPLATE", "JUDGE_USER_PROMPT_WITH_CONTRACT_TEMPLATE",
- "DRAFT_CONTRACT_SYSTEM_PROMPT", "KANBAN_GOAL_CONTINUATION_TEMPLATE", "KANBAN_GOAL_FINALIZE_TEMPLATE",
- "DEFAULT_MAX_TURNS", "load_goal", "save_goal", "clear_goal", "migrate_goal_to_session", "judge_goal",
+ "CONTINUATION_PROMPT_TEMPLATE",
+ "CONTINUATION_PROMPT_WITH_CONTRACT_TEMPLATE",
+ "CONTINUATION_PROMPT_WITH_SUBGOALS_TEMPLATE",
+ "DEFAULT_MAX_TURNS",
+ "DRAFT_CONTRACT_SYSTEM_PROMPT",
+ "JUDGE_USER_PROMPT_TEMPLATE",
+ "JUDGE_USER_PROMPT_WITH_CONTRACT_TEMPLATE",
+ "JUDGE_USER_PROMPT_WITH_SUBGOALS_TEMPLATE",
+ "KANBAN_GOAL_CONTINUATION_TEMPLATE",
+ "KANBAN_GOAL_FINALIZE_TEMPLATE",
+ "GoalContract",
+ "GoalGate",
+ "GoalManager",
+ "GoalState",
+ "clear_goal",
+ "draft_contract",
+ "judge_goal",
+ "load_goal",
+ "migrate_goal_to_session",
+ "parse_contract",
+ "run_gate",
"run_kanban_goal_loop",
+ "save_goal",
]
diff --git a/hermes_cli/heartbeat.py b/hermes_cli/heartbeat.py
index 8644bc22f66..02f1963df1e 100644
--- a/hermes_cli/heartbeat.py
+++ b/hermes_cli/heartbeat.py
@@ -267,6 +267,14 @@ def migrate_heartbeat_to_session(old_session_id: str, new_session_id: str) -> bo
__all__ = [
- "HeartbeatState", "HeartbeatManager", "parse_interval", "format_interval", "load_heartbeat", "save_heartbeat",
- "migrate_heartbeat_to_session", "HEARTBEAT_PROMPT_TEMPLATE", "MIN_INTERVAL_SECONDS", "POLL_SECONDS",
+ "HEARTBEAT_PROMPT_TEMPLATE",
+ "MIN_INTERVAL_SECONDS",
+ "POLL_SECONDS",
+ "HeartbeatManager",
+ "HeartbeatState",
+ "format_interval",
+ "load_heartbeat",
+ "migrate_heartbeat_to_session",
+ "parse_interval",
+ "save_heartbeat",
]
diff --git a/hermes_cli/loops.py b/hermes_cli/loops.py
index 839609b760b..de4f4e07ae1 100644
--- a/hermes_cli/loops.py
+++ b/hermes_cli/loops.py
@@ -717,9 +717,22 @@ def dispatch_loop_command(
__all__ = [
- "LoopState", "LoopManager", "parse_loop_args", "parse_interval_token", "format_interval",
- "response_signals_complete", "goal_blocks_loop_tick", "load_loop", "save_loop", "clear_loop",
- "list_active_loops", "migrate_loop_to_session", "dispatch_loop_command", "LOOP_COMPLETE_MARKER",
- "WAKEUP_PROMPT_TEMPLATE", "WAKEUP_PROMPT_WITH_UNTIL_TEMPLATE", "DEFAULT_MIN_INTERVAL_SECONDS",
"DEFAULT_MAX_TICKS",
+ "DEFAULT_MIN_INTERVAL_SECONDS",
+ "LOOP_COMPLETE_MARKER",
+ "WAKEUP_PROMPT_TEMPLATE",
+ "WAKEUP_PROMPT_WITH_UNTIL_TEMPLATE",
+ "LoopManager",
+ "LoopState",
+ "clear_loop",
+ "dispatch_loop_command",
+ "format_interval",
+ "goal_blocks_loop_tick",
+ "list_active_loops",
+ "load_loop",
+ "migrate_loop_to_session",
+ "parse_interval_token",
+ "parse_loop_args",
+ "response_signals_complete",
+ "save_loop",
]
diff --git a/hermes_cli/proxy/adapters/__init__.py b/hermes_cli/proxy/adapters/__init__.py
index 13a187055c8..fd2cfb22ccd 100644
--- a/hermes_cli/proxy/adapters/__init__.py
+++ b/hermes_cli/proxy/adapters/__init__.py
@@ -19,4 +19,4 @@ def get_adapter(name: str) -> UpstreamAdapter:
return ADAPTERS[key]()
-__all__ = ["UpstreamAdapter", "ADAPTERS", "get_adapter"]
+__all__ = ["ADAPTERS", "UpstreamAdapter", "get_adapter"]
diff --git a/hermes_cli/proxy/cli.py b/hermes_cli/proxy/cli.py
index 4c9ab4ab9ba..794ebeba90e 100644
--- a/hermes_cli/proxy/cli.py
+++ b/hermes_cli/proxy/cli.py
@@ -112,4 +112,4 @@ def cmd_proxy(args: Any) -> int:
return 0
-__all__ = ["cmd_proxy", "cmd_proxy_start", "cmd_proxy_status", "cmd_proxy_list_providers"]
+__all__ = ["cmd_proxy", "cmd_proxy_list_providers", "cmd_proxy_start", "cmd_proxy_status"]
diff --git a/hermes_cli/proxy/server.py b/hermes_cli/proxy/server.py
index aef6500c87a..e3d9d6b2aa3 100644
--- a/hermes_cli/proxy/server.py
+++ b/hermes_cli/proxy/server.py
@@ -300,4 +300,4 @@ async def run_server(
await runner.cleanup()
-__all__ = ["create_app", "run_server", "DEFAULT_HOST", "DEFAULT_PORT", "AIOHTTP_AVAILABLE"]
+__all__ = ["AIOHTTP_AVAILABLE", "DEFAULT_HOST", "DEFAULT_PORT", "create_app", "run_server"]
diff --git a/hermes_cli/slash_exec.py b/hermes_cli/slash_exec.py
index 363d94e0d89..ba01c1e11c2 100644
--- a/hermes_cli/slash_exec.py
+++ b/hermes_cli/slash_exec.py
@@ -13,8 +13,14 @@ from typing import Any
from agent.i18n import t
-__all__ = ["CommandContext", "CommandReply", "EXECUTORS", "execute_command", "resolve_executor",
- "run_execute"]
+__all__ = [
+ "EXECUTORS",
+ "CommandContext",
+ "CommandReply",
+ "execute_command",
+ "resolve_executor",
+ "run_execute",
+]
@dataclass(frozen=True)
diff --git a/hermes_cli/win_pty_bridge.py b/hermes_cli/win_pty_bridge.py
index 5dff638cfd2..aa01d97456d 100644
--- a/hermes_cli/win_pty_bridge.py
+++ b/hermes_cli/win_pty_bridge.py
@@ -18,7 +18,7 @@ except ImportError: # pragma: no cover - non-Windows or pywinpty missing
_log = logging.getLogger(__name__)
-__all__ = ["WinPtyBridge", "PtyUnavailableError"]
+__all__ = ["PtyUnavailableError", "WinPtyBridge"]
# Same clamp ceiling as the POSIX bridge so a broken winsize probe never reaches the resize call.
diff --git a/hermes_platform/declaration.py b/hermes_platform/declaration.py
index 58d6e40bbe8..73114637d1c 100644
--- a/hermes_platform/declaration.py
+++ b/hermes_platform/declaration.py
@@ -11,17 +11,17 @@ from hermes_platform.resolver.app import LOCATION_KINDS, AppDef, AppLocation
__all__ = [
"AppSpec",
- "RequiresSpec",
"Declaration",
"DeclarationError",
+ "RequiresSpec",
+ "clear",
"gpu_label",
+ "lookup",
"parse_app",
- "parse_requires",
"parse_declaration",
+ "parse_requires",
"register",
"unregister",
- "lookup",
- "clear",
]
diff --git a/plugins/google_meet/node/__init__.py b/plugins/google_meet/node/__init__.py
index e623bf85271..3620d7747c8 100644
--- a/plugins/google_meet/node/__init__.py
+++ b/plugins/google_meet/node/__init__.py
@@ -17,5 +17,15 @@ from plugins.google_meet.node.registry import NodeRegistry
from plugins.google_meet.node.server import NodeServer
__all__ = [
- "NodeClient", "NodeServer", "NodeRegistry", "protocol", "make_request", "make_response",
- "make_error", "encode", "decode", "validate_request", "VALID_REQUEST_TYPES"]
+ "VALID_REQUEST_TYPES",
+ "NodeClient",
+ "NodeRegistry",
+ "NodeServer",
+ "decode",
+ "encode",
+ "make_error",
+ "make_request",
+ "make_response",
+ "protocol",
+ "validate_request",
+]
diff --git a/plugins/plugin_utils.py b/plugins/plugin_utils.py
index 914cacae7dc..d69adf59ab6 100644
--- a/plugins/plugin_utils.py
+++ b/plugins/plugin_utils.py
@@ -11,7 +11,7 @@ import functools
import threading
from typing import Callable, Generic, Optional, TypeVar
-__all__ = ["lazy_singleton", "SingletonSlot"]
+__all__ = ["SingletonSlot", "lazy_singleton"]
T = TypeVar("T")
diff --git a/ruff.strict.toml b/ruff.strict.toml
index bd55a76dd29..6845bf4e257 100644
--- a/ruff.strict.toml
+++ b/ruff.strict.toml
@@ -420,11 +420,11 @@ select = [
# "RUF013",
# "RUF015",
"RUF016",
- # "RUF017",
- # "RUF018",
+ "RUF017",
+ "RUF018",
"RUF019",
"RUF020",
- # "RUF022",
+ "RUF022",
"RUF023",
"RUF024",
"RUF026",
diff --git a/scripts/bundles/native.py b/scripts/bundles/native.py
index acbf722dd08..7a4cdc492f1 100644
--- a/scripts/bundles/native.py
+++ b/scripts/bundles/native.py
@@ -54,7 +54,7 @@ def _arch_guard(store_dir: Path) -> list[str]:
from pm.uv_cache_prune import lock_package_names, prune_uv_cache_to_lock
-__all__ = ["prune_uv_cache_to_lock", "lock_package_names", "stage_uv_cache"]
+__all__ = ["lock_package_names", "prune_uv_cache_to_lock", "stage_uv_cache"]
def stage_uv_cache(source: Path, destination: Path) -> None:
diff --git a/tests/e2e/core/mcp_plugins/_helpers.py b/tests/e2e/core/mcp_plugins/_helpers.py
index f8828ededaa..84413fdb1b6 100644
--- a/tests/e2e/core/mcp_plugins/_helpers.py
+++ b/tests/e2e/core/mcp_plugins/_helpers.py
@@ -37,9 +37,28 @@ TURN_TIMEOUT = 240.0
_SECRET_ENV_SUFFIXES = ("_API_KEY", "_TOKEN", "_SECRET", "_ACCESS_KEY")
_PASSTHROUGH_ENV = frozenset({"PATH", "LANG", "LANGUAGE", "USER", "LOGNAME", "SHELL", "TMPDIR", "TZ"})
-__all__ = ["FINAL", "E2EHome", "HttpMcpServer", "KnownSymptom", "build_home", "stdio_server",
- "http_server_cfg", "script", "call_tool", "run_chat_q", "inbound", "calls_received", "tool_results",
- "tool_name", "tool_names", "payload", "symptom", "kill_tagged", "tagged_pids", "wait_until"]
+__all__ = [
+ "FINAL",
+ "E2EHome",
+ "HttpMcpServer",
+ "KnownSymptom",
+ "build_home",
+ "call_tool",
+ "calls_received",
+ "http_server_cfg",
+ "inbound",
+ "kill_tagged",
+ "payload",
+ "run_chat_q",
+ "script",
+ "stdio_server",
+ "symptom",
+ "tagged_pids",
+ "tool_name",
+ "tool_names",
+ "tool_results",
+ "wait_until",
+]
def tool_name(server: str, tool: str) -> str:
diff --git a/tests/fakes/providers/vertex.py b/tests/fakes/providers/vertex.py
index a21829c4026..c3993ee9bea 100644
--- a/tests/fakes/providers/vertex.py
+++ b/tests/fakes/providers/vertex.py
@@ -703,7 +703,22 @@ def signatures_on_wire(body: dict[str, Any]) -> list[str]:
__all__ = [
- "MODEL", "PROJECT", "REGION", "SA_EMBEDDED_PROJECT", "hermes_setup",
- "Call", "Drop", "Fail", "FakeVertex", "GRPC_STATUS", "Say", "ServiceAccount", "TokenPolicy",
- "make_service_account", "make_tls_material", "signatures_on_wire", "validate_chat_body", "verify_jwt_assertion",
+ "GRPC_STATUS",
+ "MODEL",
+ "PROJECT",
+ "REGION",
+ "SA_EMBEDDED_PROJECT",
+ "Call",
+ "Drop",
+ "Fail",
+ "FakeVertex",
+ "Say",
+ "ServiceAccount",
+ "TokenPolicy",
+ "hermes_setup",
+ "make_service_account",
+ "make_tls_material",
+ "signatures_on_wire",
+ "validate_chat_body",
+ "verify_jwt_assertion",
]
diff --git a/tests/hermes_cli/test_multiplex_cli_cache_scope.py b/tests/hermes_cli/test_multiplex_cli_cache_scope.py
index 273d622a434..ee5a4e297ba 100644
--- a/tests/hermes_cli/test_multiplex_cli_cache_scope.py
+++ b/tests/hermes_cli/test_multiplex_cli_cache_scope.py
@@ -8,6 +8,7 @@ its payload depends on the Authorization header or URL so a leaked entry is obse
from __future__ import annotations
import io
+import itertools
import json
import os
import threading
@@ -197,9 +198,9 @@ def test_banner_skills_are_the_routed_profiles(homes):
banner._available_skills_cache = None
try:
with _Scoped(a):
- assert sorted(sum(banner.get_available_skills().values(), [])) == ["skill_a"]
+ assert sorted(itertools.chain.from_iterable(banner.get_available_skills().values())) == ["skill_a"]
with _Scoped(b):
- assert sorted(sum(banner.get_available_skills().values(), [])) == ["skill_b"]
+ assert sorted(itertools.chain.from_iterable(banner.get_available_skills().values())) == ["skill_b"]
finally:
banner._available_skills_cache = None
diff --git a/tests/hermes_state/test_rewind_surfaces_invariant.py b/tests/hermes_state/test_rewind_surfaces_invariant.py
index a356d8cd768..d6f18824a7a 100644
--- a/tests/hermes_state/test_rewind_surfaces_invariant.py
+++ b/tests/hermes_state/test_rewind_surfaces_invariant.py
@@ -84,7 +84,8 @@ def test_every_surface_persists_the_same_active_set(db, n, rich):
_seed(db, sid, rich=rich)
assert _rewind_via(surface, db, sid, n)
rows = [(role, content, active) for _id, role, content, active in _active_rows(db, sid)]
- assert rows == (expected := expected or rows), surface
+ expected = expected or rows
+ assert rows == expected, surface
active = [(r, c) for r, c, a in expected if a]
if not rich:
assert [c for _r, c in active] == [f"q{i}" if k == 0 else f"a{i}" for i in range(1, 4 - n) for k in (0, 1)]
diff --git a/tools/blueprints.py b/tools/blueprints.py
index 382c2aebe2d..721107870de 100644
--- a/tools/blueprints.py
+++ b/tools/blueprints.py
@@ -16,8 +16,16 @@ from typing import Any, Dict, List, Optional
logger = logging.getLogger(__name__)
-__all__ = ["BlueprintSpec", "parse_blueprint", "blueprint_spec_for_installed", "blueprint_to_job_spec",
- "create_blueprint_job", "register_blueprint_suggestion", "export_blueprint", "BlueprintError"]
+__all__ = [
+ "BlueprintError",
+ "BlueprintSpec",
+ "blueprint_spec_for_installed",
+ "blueprint_to_job_spec",
+ "create_blueprint_job",
+ "export_blueprint",
+ "parse_blueprint",
+ "register_blueprint_suggestion",
+]
class BlueprintError(ValueError):
diff --git a/tools/browser_supervisor.py b/tools/browser_supervisor.py
index 250db29ef2d..6f5b022239d 100644
--- a/tools/browser_supervisor.py
+++ b/tools/browser_supervisor.py
@@ -564,4 +564,4 @@ class _SupervisorRegistry:
SUPERVISOR_REGISTRY = _SupervisorRegistry()
-__all__ = ["CDPSupervisor", "SUPERVISOR_REGISTRY", "SupervisorSnapshot", "_SupervisorRegistry"]
+__all__ = ["SUPERVISOR_REGISTRY", "CDPSupervisor", "SupervisorSnapshot", "_SupervisorRegistry"]
diff --git a/tools/computer_use_tool.py b/tools/computer_use_tool.py
index 8ddd93390cb..4a5a8b76364 100644
--- a/tools/computer_use_tool.py
+++ b/tools/computer_use_tool.py
@@ -26,4 +26,4 @@ registry.register(
)
-__all__ = ["handle_computer_use", "release_computer_use_session", "set_approval_callback", "check_computer_use_requirements"]
+__all__ = ["check_computer_use_requirements", "handle_computer_use", "release_computer_use_session", "set_approval_callback"]
diff --git a/tools/connectors/gateway/__init__.py b/tools/connectors/gateway/__init__.py
index 42c3c7af3d1..f3e3c24337b 100644
--- a/tools/connectors/gateway/__init__.py
+++ b/tools/connectors/gateway/__init__.py
@@ -57,12 +57,12 @@ from tools.connectors.gateway.names import (
__all__ = [
"CONNECTOR_BATCH_SENTINEL",
"CONNECTOR_NAME_PREFIX",
+ "MAX_CALLS_PER_DISPATCH",
"ConnectorConfig",
"ConnectorName",
"GatewayAuthError",
"GatewayUnavailable",
"IdempotencyConflict",
- "MAX_CALLS_PER_DISPATCH",
"ToolGatewayError",
"connectors_available",
"format_connector_name",
diff --git a/tools/connectors/gateway/errors.py b/tools/connectors/gateway/errors.py
index 4b194dd9b7e..f01af3f7591 100644
--- a/tools/connectors/gateway/errors.py
+++ b/tools/connectors/gateway/errors.py
@@ -10,10 +10,10 @@ from typing import Any, Mapping, Optional
from tools.connectors.turn import CARD, LINK, SIDE
__all__ = [
+ "SIDE_AGENT_HINT",
"GatewayAuthError",
"GatewayUnavailable",
"IdempotencyConflict",
- "SIDE_AGENT_HINT",
"ToolGatewayError",
"parse_gateway_error",
"render_connection_required",
diff --git a/tools/file_state.py b/tools/file_state.py
index e8b45f64cd3..a3e278fef82 100644
--- a/tools/file_state.py
+++ b/tools/file_state.py
@@ -251,10 +251,11 @@ def known_reads(task_id: str) -> list[str]:
__all__ = [
"FileStateRegistry",
- "get_registry",
- "record_read",
- "note_write",
"check_stale",
+ "get_registry",
+ "known_reads",
"lock_path",
+ "note_write",
+ "record_read",
"writes_since",
- "known_reads"]
+]
diff --git a/tools/hook_output_spill.py b/tools/hook_output_spill.py
index 32269a084d1..8ec23fc4459 100644
--- a/tools/hook_output_spill.py
+++ b/tools/hook_output_spill.py
@@ -113,5 +113,11 @@ def spill_if_oversized(
return "\n".join(parts)
-__all__ = ["DEFAULT_MAX_CHARS", "DEFAULT_PREVIEW_HEAD", "DEFAULT_PREVIEW_TAIL", "DEFAULT_ENABLED",
- "get_spill_config", "spill_if_oversized"]
+__all__ = [
+ "DEFAULT_ENABLED",
+ "DEFAULT_MAX_CHARS",
+ "DEFAULT_PREVIEW_HEAD",
+ "DEFAULT_PREVIEW_TAIL",
+ "get_spill_config",
+ "spill_if_oversized",
+]
diff --git a/tools/plugin_guard.py b/tools/plugin_guard.py
index 63afca42b6b..b1a091f81c1 100644
--- a/tools/plugin_guard.py
+++ b/tools/plugin_guard.py
@@ -365,4 +365,8 @@ def should_allow_plugin_install(
__all__ = [
- "scan_plugin", "should_allow_plugin_install", "format_scan_report", "PLUGIN_SCANNER_VERSION"]
+ "PLUGIN_SCANNER_VERSION",
+ "format_scan_report",
+ "scan_plugin",
+ "should_allow_plugin_install",
+]
diff --git a/tools/plugin_guard_context.py b/tools/plugin_guard_context.py
index 211b9c60242..54ff6fba390 100644
--- a/tools/plugin_guard_context.py
+++ b/tools/plugin_guard_context.py
@@ -463,10 +463,26 @@ def is_google_installed_app_secret(finding: Finding, line: str) -> bool:
__all__ = [
- "STEP_DOWN", "DOC_PROSE_EXTENSIONS", "TEST_TREE_DIRS", "LITERAL_INERT_PATTERN_IDS",
- "is_doc_prose", "is_ci_workflow", "is_agent_facing", "prose_cap", "is_self_uninstall_doc", "is_test_tree",
- "is_inert_fixture_line", "is_base64_media",
- "is_regex_alternation_token", "is_data_decode", "is_loopback_only", "is_pip_install_in_prose_literal",
- "is_hex_in_char_class", "logical_line", "is_loopback_continuation", "is_json_prose_value", "is_coin_name_only",
+ "DOC_PROSE_EXTENSIONS",
+ "LITERAL_INERT_PATTERN_IDS",
+ "STEP_DOWN",
+ "TEST_TREE_DIRS",
+ "is_agent_facing",
+ "is_base64_media",
+ "is_ci_workflow",
+ "is_coin_name_only",
+ "is_data_decode",
+ "is_doc_prose",
"is_google_installed_app_secret",
+ "is_hex_in_char_class",
+ "is_inert_fixture_line",
+ "is_json_prose_value",
+ "is_loopback_continuation",
+ "is_loopback_only",
+ "is_pip_install_in_prose_literal",
+ "is_regex_alternation_token",
+ "is_self_uninstall_doc",
+ "is_test_tree",
+ "logical_line",
+ "prose_cap",
]
diff --git a/tools/threat_patterns.py b/tools/threat_patterns.py
index 5ebb51285e7..54c3a6dcea6 100644
--- a/tools/threat_patterns.py
+++ b/tools/threat_patterns.py
@@ -159,4 +159,4 @@ def first_threat_message(content: str, scope: str = "strict") -> Optional[str]:
f"injection or exfiltration payloads.")
-__all__ = ["INVISIBLE_CHARS", "MAX_SCAN_CHARS", "scan_for_threats", "first_threat_message"]
+__all__ = ["INVISIBLE_CHARS", "MAX_SCAN_CHARS", "first_threat_message", "scan_for_threats"]
diff --git a/tools/tool_search.py b/tools/tool_search.py
index d04ccebaac9..3c52c3ae342 100644
--- a/tools/tool_search.py
+++ b/tools/tool_search.py
@@ -587,11 +587,32 @@ def resolve_underlying_call(args: dict[str, Any]) -> tuple[Optional[str], dict[s
__all__ = [
- "TOOL_SEARCH_NAME", "TOOL_DESCRIBE_NAME", "TOOL_CALL_NAME", "BRIDGE_TOOL_NAMES",
- "ToolSearchConfig", "CatalogEntry", "AssemblyResult", "load_config", "is_deferrable_tool_name",
- "classify_tools", "estimate_tokens_from_schemas", "should_activate", "build_catalog",
- "build_catalog_listing_with_form", "listing_token_budget", "search_catalog",
- "bridge_tool_schemas", "assemble_tool_defs", "is_bridge_tool", "dispatch_tool_search",
- "dispatch_tool_describe", "resolve_underlying_call", "scoped_deferrable_names",
- "out_of_scope_reason", "validate_deferred_call_args", "normalize_tool_call_entries",
- "CONNECTOR_BATCH_SENTINEL", "is_connector_name"]
+ "BRIDGE_TOOL_NAMES",
+ "CONNECTOR_BATCH_SENTINEL",
+ "TOOL_CALL_NAME",
+ "TOOL_DESCRIBE_NAME",
+ "TOOL_SEARCH_NAME",
+ "AssemblyResult",
+ "CatalogEntry",
+ "ToolSearchConfig",
+ "assemble_tool_defs",
+ "bridge_tool_schemas",
+ "build_catalog",
+ "build_catalog_listing_with_form",
+ "classify_tools",
+ "dispatch_tool_describe",
+ "dispatch_tool_search",
+ "estimate_tokens_from_schemas",
+ "is_bridge_tool",
+ "is_connector_name",
+ "is_deferrable_tool_name",
+ "listing_token_budget",
+ "load_config",
+ "normalize_tool_call_entries",
+ "out_of_scope_reason",
+ "resolve_underlying_call",
+ "scoped_deferrable_names",
+ "search_catalog",
+ "should_activate",
+ "validate_deferred_call_args",
+]