From 9c8fa589d1776171e43b96cd56e66ac5da3b9fbb Mon Sep 17 00:00:00 2001 From: axisrow Date: Fri, 7 Nov 2025 22:53:31 +0800 Subject: [PATCH] =?UTF-8?q?Clean=20up=20unused=20code=20-=20like,=20seriou?= =?UTF-8?q?sly,=20come=20on=20=F0=9F=99=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit How are we shipping unused imports and variables? Removed: - unused import 'os' from main.py - unused import 'logging' from computers/playwright/playwright.py - unused attribute 'final_reasoning' from agent.py - unused variables in __exit__ methods (exc_type, exc_val, exc_tb) - unused test attributes (api_server, api_server_key) At minimum, keep your imports clean. Pylint score improved from 9.96/10 to 10.00/10. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- agent.py | 2 -- computers/browserbase/browserbase.py | 2 +- computers/playwright/playwright.py | 3 +-- main.py | 1 - test_main.py | 4 ---- 5 files changed, 2 insertions(+), 10 deletions(-) diff --git a/agent.py b/agent.py index 2df602e..7abc93e 100644 --- a/agent.py +++ b/agent.py @@ -72,7 +72,6 @@ def __init__( self._query = query self._model_name = model_name self._verbose = verbose - self.final_reasoning = None self._client = genai.Client( api_key=os.environ.get("GEMINI_API_KEY"), vertexai=os.environ.get("USE_VERTEXAI", "0").lower() in ["true", "1"], @@ -284,7 +283,6 @@ def run_one_iteration(self) -> Literal["COMPLETE", "CONTINUE"]: if not function_calls: print(f"Agent Loop Complete: {reasoning}") - self.final_reasoning = reasoning return "COMPLETE" function_call_strs = [] diff --git a/computers/browserbase/browserbase.py b/computers/browserbase/browserbase.py index 9964af4..9fff3f5 100644 --- a/computers/browserbase/browserbase.py +++ b/computers/browserbase/browserbase.py @@ -68,7 +68,7 @@ def __enter__(self): ) return self - def __exit__(self, exc_type, exc_val, exc_tb): + def __exit__(self, _exc_type, _exc_val, _exc_tb): self._page.close() if self._context: diff --git a/computers/playwright/playwright.py b/computers/playwright/playwright.py index e7a53c3..d9165a1 100644 --- a/computers/playwright/playwright.py +++ b/computers/playwright/playwright.py @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import logging import termcolor import time import os @@ -131,7 +130,7 @@ def __enter__(self): ) return self - def __exit__(self, exc_type, exc_val, exc_tb): + def __exit__(self, _exc_type, _exc_val, _exc_tb): if self._context: self._context.close() try: diff --git a/main.py b/main.py index 05d5537..f8dd603 100644 --- a/main.py +++ b/main.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. import argparse -import os from agent import BrowserAgent from computers import BrowserbaseComputer, PlaywrightComputer diff --git a/test_main.py b/test_main.py index 4bee9ff..d518fee 100644 --- a/test_main.py +++ b/test_main.py @@ -28,8 +28,6 @@ def test_main_playwright(self, mock_browser_agent, mock_playwright_computer, moc mock_args.highlight_mouse = True mock_args.query = 'test_query' mock_args.model = 'test_model' - mock_args.api_server = None - mock_args.api_server_key = None mock_arg_parser.return_value.parse_args.return_value = mock_args main.main() @@ -50,8 +48,6 @@ def test_main_browserbase(self, mock_browser_agent, mock_browserbase_computer, m mock_args.env = 'browserbase' mock_args.query = 'test_query' mock_args.model = 'test_model' - mock_args.api_server = None - mock_args.api_server_key = None mock_args.initial_url = 'test_url' mock_args.highlight_mouse = False mock_arg_parser.return_value.parse_args.return_value = mock_args