The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(google-workspace): emit [] for empty Python-backend Gmail searches
youyou59608b5e0d4e
diff --git a/skills/productivity/google-workspace/scripts/google_api.py b/skills/productivity/google-workspace/scripts/google_api.pyindex 320ee5a3f31..5a9d0839f67 100644--- a/skills/productivity/google-workspace/scripts/google_api.py+++ b/skills/productivity/google-workspace/scripts/google_api.py@@ -314,9 +314,6 @@ def gmail_search(args):userId="me", q=args.query, maxResults=args.max).execute()messages = results.get("messages", [])- if not messages:- print("No messages found.")- returnoutput = []for msg_meta in messages:diff --git a/tests/skills/test_google_workspace_api.py b/tests/skills/test_google_workspace_api.pyindex 05c31f74a8d..e7d6aaedb6e 100644--- a/tests/skills/test_google_workspace_api.py+++ b/tests/skills/test_google_workspace_api.py@@ -197,6 +197,32 @@ def test_api_get_credentials_refresh_persists_authorized_user_type(api_module, massert saved["type"] == "authorized_user"+def test_gmail_search_empty_result_prints_json_array(api_module, capsys):+ """Regression for #131711: an empty Gmail search through the Python+ fallback printed "No messages found." instead of the JSON array the gws+ backend emits, breaking consumers that parse search output as JSON."""++ class EmptyGmail:+ def users(self):+ return self++ def messages(self):+ return self++ def list(self, **_kwargs):+ return self++ def execute(self):+ return {"resultSizeEstimate": 0}++ api_module._gws_binary = lambda: None+ api_module.build_service = lambda *_args, **_kwargs: EmptyGmail()++ api_module.gmail_search(api_module.argparse.Namespace(query="is:unread", max=10))++ assert json.loads(capsys.readouterr().out) == []++def _tabbed_doc():"""A Doc with two tabs (one nested), as the Docs API returns with includeTabsContent."""def body(text):