Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions fastdeploy/engine/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,19 +310,7 @@ def set(self, key, value):

def __repr__(self) -> str:
"""Safe string representation that ignores private and None fields."""
try:
if not envs.FD_DEBUG:
return f"Request(request_id={self.request_id})"
else:
attrs_snapshot = dict(vars(self))
non_none_fields = [
f"{attr}={value!r}"
for attr, value in attrs_snapshot.items()
if value is not None and not attr.startswith("_")
]
return f"Request({', '.join(non_none_fields)})"
except Exception as e:
return f"<{self.__class__.__name__} repr failed: {e}>"
return ""
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning an empty string from __repr__ violates Python conventions and breaks debugging expectations. The __repr__ method should return a useful string representation of the object. If the detailed representation is causing issues, consider returning a minimal but informative representation like f"<Request {self.request_id}>" or at minimum f"Request(request_id={self.request_id!r})" to maintain basic debugging capability. Returning an empty string will make logging, debugging, and error messages confusing when Request objects are printed.

Copilot uses AI. Check for mistakes.


@dataclass(slots=True)
Expand Down
Loading