diff --git a/agentops/client/api/versions/v4.py b/agentops/client/api/versions/v4.py index b444010ad..e1e3f263d 100644 --- a/agentops/client/api/versions/v4.py +++ b/agentops/client/api/versions/v4.py @@ -95,6 +95,8 @@ def upload_object(self, body: Union[str, bytes]) -> Dict[str, Any]: if "error" in error_data: error_msg = error_data["error"] except: + + # TODO: be more specific about exception type pass raise ApiServerException(error_msg) @@ -134,6 +136,8 @@ def upload_logfile(self, body: Union[str, bytes], trace_id: str) -> Dict[str, An if "error" in error_data: error_msg = error_data["error"] except: + + # TODO: be more specific about exception type pass raise ApiServerException(error_msg) diff --git a/agentops/helpers/serialization.py b/agentops/helpers/serialization.py index 910fcdec3..c83c6080b 100644 --- a/agentops/helpers/serialization.py +++ b/agentops/helpers/serialization.py @@ -103,6 +103,7 @@ def model_to_dict(obj: Any) -> dict: try: return obj.__dict__ except: + # TODO: be more specific about exception type return {} diff --git a/agentops/helpers/system.py b/agentops/helpers/system.py index dfb2cdd01..bb8327242 100644 --- a/agentops/helpers/system.py +++ b/agentops/helpers/system.py @@ -58,6 +58,13 @@ def get_sdk_details(): "System Packages": get_sys_packages(), } except: + + + + + + + # TODO: be more specific about exception type return {} @@ -83,6 +90,13 @@ def get_installed_packages(): } } except: + + + + + + + # TODO: be more specific about exception type return {} @@ -90,6 +104,13 @@ def get_current_directory(): try: return {"Project Working Directory": os.getcwd()} except: + + + + + + + # TODO: be more specific about exception type return {} @@ -97,6 +118,13 @@ def get_virtual_env(): try: return {"Virtual Environment": os.environ.get("VIRTUAL_ENV", None)} except: + + + + + + + # TODO: be more specific about exception type return {} @@ -109,6 +137,13 @@ def get_os_details(): "OS Release": platform.release(), } except: + + + + + + + # TODO: be more specific about exception type return {} @@ -121,6 +156,13 @@ def get_cpu_details(): "CPU Usage": f"{psutil.cpu_percent()}%", } except: + + + + + + + # TODO: be more specific about exception type return {} @@ -134,6 +176,13 @@ def get_ram_details(): "Percentage": f"{ram_info.percent}%", } except: + + + + + + + # TODO: be more specific about exception type return {} diff --git a/agentops/instrumentation/agentic/ag2/instrumentor.py b/agentops/instrumentation/agentic/ag2/instrumentor.py index 983c9fb20..843a17ead 100644 --- a/agentops/instrumentation/agentic/ag2/instrumentor.py +++ b/agentops/instrumentation/agentic/ag2/instrumentor.py @@ -696,6 +696,8 @@ def wrapper(wrapped, instance, args, kwargs): json.dumps(func_call["arguments"]), ) except: + + # TODO: be more specific about exception type pass elif tool_type == "code" and args: @@ -827,6 +829,8 @@ def _process_tool_result(self, span, result, tool_type): try: span.set_attribute(ToolAttributes.TOOL_RESULT, json.dumps(result[1])) except: + + # TODO: be more specific about exception type pass if tool_type == "code" and isinstance(result, tuple) and len(result) >= 3: diff --git a/agentops/instrumentation/agentic/agno/attributes/agent.py b/agentops/instrumentation/agentic/agno/attributes/agent.py index acbd36ac6..d1865e905 100644 --- a/agentops/instrumentation/agentic/agno/attributes/agent.py +++ b/agentops/instrumentation/agentic/agno/attributes/agent.py @@ -227,6 +227,7 @@ def get_agent_run_attributes( args_str = json.dumps(tool_exec.tool_args) attributes[f"tool.{i}.parameters"] = args_str except: + # TODO: be more specific about exception type attributes[f"tool.{i}.parameters"] = str(tool_exec.tool_args) if hasattr(tool_exec, "result") and tool_exec.result: diff --git a/agentops/instrumentation/agentic/agno/attributes/team.py b/agentops/instrumentation/agentic/agno/attributes/team.py index da08a1776..9cdf1ee58 100644 --- a/agentops/instrumentation/agentic/agno/attributes/team.py +++ b/agentops/instrumentation/agentic/agno/attributes/team.py @@ -77,6 +77,7 @@ def get_team_run_attributes( member_names = [m.get("name", "Unknown") for m in member_agents] attributes["team.member_names"] = ", ".join(member_names) except: + # TODO: be more specific about exception type attributes["team.members"] = str(member_agents) # Process input arguments - handle both internal and public method signatures diff --git a/agentops/instrumentation/providers/anthropic/attributes/message.py b/agentops/instrumentation/providers/anthropic/attributes/message.py index 4346a2673..2f0fc86f7 100644 --- a/agentops/instrumentation/providers/anthropic/attributes/message.py +++ b/agentops/instrumentation/providers/anthropic/attributes/message.py @@ -166,7 +166,9 @@ def _process_content(content, role, index): attributes[MessageAttributes.PROMPT_CONTENT.format(i=index)] = simple_content attributes[MessageAttributes.PROMPT_TYPE.format(i=index)] = "text" except: - # Ultimate fallback + + + # TODO: be more specific about exception type attributes[MessageAttributes.PROMPT_ROLE.format(i=index)] = role attributes[MessageAttributes.PROMPT_CONTENT.format(i=index)] = "(complex content)" attributes[MessageAttributes.PROMPT_TYPE.format(i=index)] = "unknown" @@ -204,6 +206,8 @@ def _create_simplified_message(msg): try: return {"role": role, "content": str(content)} except: + + # TODO: be more specific about exception type return {"role": role, "content": "(complex content)"} diff --git a/app/api/agentops/api/routes/v2.py b/app/api/agentops/api/routes/v2.py index ad506ee48..c1b38a15b 100644 --- a/app/api/agentops/api/routes/v2.py +++ b/app/api/agentops/api/routes/v2.py @@ -654,7 +654,8 @@ async def v2_update_logs(request: Request, supabase: AsyncSupabaseClient): existing_content = existing_file.decode("utf-8") new_content = existing_content + logs_content except: - # File doesn't exist yet + + # TODO: be more specific about exception type new_content = logs_content # Upload the file diff --git a/app/deploy/jockey/__main__.py b/app/deploy/jockey/__main__.py index 0b0783bb4..390bbcfe9 100644 --- a/app/deploy/jockey/__main__.py +++ b/app/deploy/jockey/__main__.py @@ -477,6 +477,7 @@ def alb_status(): ingresses = Ingress.filter(namespace=namespace) all_ingresses.extend(ingresses) except: + # TODO: be more specific about exception type continue # Skip if namespace doesn't exist or no access shared_alb_ingresses = [] diff --git a/app/deploy/jockey/backend/models/image.py b/app/deploy/jockey/backend/models/image.py index 34b4720c6..c5f7b289e 100644 --- a/app/deploy/jockey/backend/models/image.py +++ b/app/deploy/jockey/backend/models/image.py @@ -391,6 +391,7 @@ def build(self, job_id: Optional[str] = None) -> BuildEventStream: self.client.batch.delete_namespaced_job(name=builder_job_name, namespace=self.namespace) configmap.delete() except: + # TODO: be more specific about exception type pass # Ignore cleanup errors logger.info(f"Job {builder_job_name} complete") diff --git a/app/e2e/sdk-api/src/test_basic_agent.py b/app/e2e/sdk-api/src/test_basic_agent.py index 4c762be09..1cf172cde 100644 --- a/app/e2e/sdk-api/src/test_basic_agent.py +++ b/app/e2e/sdk-api/src/test_basic_agent.py @@ -32,7 +32,7 @@ async def asyncTearDown(self): async def test_completion(self): await self.agent.async_chat_completion() - time.sleep(2) + asyncio.sleep(2) sessions = await self.db.get("sessions", "id", "project_id", Project.ID) llm_calls = await self.db.get("llms", "*", "session_id", sessions[0].get("id")) @@ -44,7 +44,7 @@ async def test_completion(self): async def test_stream_completion(self): await self.agent.async_chat_completion_stream() - time.sleep(2) + asyncio.sleep(2) sessions = await self.db.get("sessions", "id", "project_id", Project.ID) llm_calls = await self.db.get("llms", "*", "session_id", sessions[0].get("id")) diff --git a/app/e2e/sdk-api/src/test_multi_agent.py b/app/e2e/sdk-api/src/test_multi_agent.py index d96c652ea..43f58cbff 100644 --- a/app/e2e/sdk-api/src/test_multi_agent.py +++ b/app/e2e/sdk-api/src/test_multi_agent.py @@ -48,7 +48,7 @@ async def test_single_completion(self): "write a python function that adds two numbers together", self.client ) - time.sleep(2) + asyncio.sleep(2) llm_calls = await self.db.get( "llms", "id", "agent_id", getattr(self.engineer, "agent_ops_agent_id") @@ -58,7 +58,7 @@ async def test_single_completion(self): async def test_record_agent_error(self): self.qa.record_error() - time.sleep(2) + asyncio.sleep(2) sessions = await self.db.get("sessions", "id", "project_id", Project.ID) errors = await self.db.get("errors", "id", "session_id", sessions[0].get("id")) self.assertIsNotNone(errors) @@ -66,7 +66,7 @@ async def test_record_agent_error(self): async def test_record_agent_action(self): self.qa.record_action(1, 2) - time.sleep(2) + asyncio.sleep(2) actions = await self.db.get( "actions", "id", "agent_id", getattr(self.engineer, "agent_ops_agent_id")