From 9bc3d6e352758c1fb73b8f5eb35b4c588ec63abc Mon Sep 17 00:00:00 2001 From: hongmingwang-moleculeai Date: Tue, 28 Apr 2026 20:45:53 -0700 Subject: [PATCH] Potential fix for pull request finding 'Unused global variable' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- workspace/executor_helpers.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/workspace/executor_helpers.py b/workspace/executor_helpers.py index 19b5769f..ad98ab33 100644 --- a/workspace/executor_helpers.py +++ b/workspace/executor_helpers.py @@ -336,6 +336,24 @@ _CLI_A2A_COMMAND_KEYWORDS: dict[str, str | None] = { } +def _validate_cli_a2a_command_keywords() -> None: + """Keep CLI instruction text aligned with command keyword mapping.""" + missing = [ + (tool_name, keyword) + for tool_name, keyword in _CLI_A2A_COMMAND_KEYWORDS.items() + if keyword is not None and keyword not in _A2A_INSTRUCTIONS_CLI + ] + if missing: + details = ", ".join(f"{tool_name}={keyword!r}" for tool_name, keyword in missing) + raise ValueError( + "CLI A2A command mapping is out of sync with _A2A_INSTRUCTIONS_CLI: " + f"{details}" + ) + + +_validate_cli_a2a_command_keywords() + + def _render_section(heading: str, specs, footer: str = "") -> str: """Render a section: heading, per-tool bullet, per-tool when_to_use, footer.""" parts = [heading, ""]