Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Closed
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
7 changes: 7 additions & 0 deletions agentuity/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,14 @@ def autostart(callback: Callable[[], None] = None):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

# Configure logging with a default handler if none exists
# This ensures logs are visible even if the caller doesn't configure logging
logging.basicConfig(
level=logging.INFO,
format="[%(levelname)-5.5s] %(message)s",
)
Comment on lines +698 to +703
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Search for logging format configurations in server.py and related files
rg -n "levelname.*5\.5s" --type=py

# Also search for basicConfig or format= in server.py specifically
rg -n -A 2 "basicConfig|format=" --type=py -g "server.py"

# Additionally, search for the file path to locate server.py
fd "server\.py" --type f

Repository: agentuity/sdk-py

Length of output: 336


🏁 Script executed:

# Find all server.py files in the repository
find . -name "server.py" -type f

# Also check the actual file at lines 698-710 to see the logging config and surrounding code
wc -l agentuity/server/__init__.py

# Read the relevant section
sed -n '698,710p' agentuity/server/__init__.py

Repository: agentuity/sdk-py

Length of output: 543


🏁 Script executed:

# Check lines around 731-732 for dead code
sed -n '728,738p' agentuity/server/__init__.py

# Search for any reference to server.py or logging format in the codebase
rg -n "server\.py" --type=py

# Search for other basicConfig or logging.INFO patterns
rg -n "logging\.INFO" agentuity/server/__init__.py

# Check git log or PR description context
git log --oneline -n 20 --all -- agentuity/server/__init__.py 2>/dev/null | head -5

Repository: agentuity/sdk-py

Length of output: 736


🏁 Script executed:

# Find the autostart function definition
sed -n '693,720p' agentuity/server/__init__.py

# Search for loghandler initialization or return
rg -n "loghandler" agentuity/server/__init__.py | head -20

Repository: agentuity/sdk-py

Length of output: 1055


Address redundant logger configuration that overrides user settings.

The logging configuration has two issues:

  1. Redundant logger.setLevel(): Line 704 calls logger.setLevel(logging.INFO) immediately after basicConfig(level=logging.INFO). This is redundant and, more importantly, will override any logging level a user has already configured on the root logger. The basicConfig() call alone is sufficient.

  2. Unverifiable format claim: The PR description claims the format string matches server.py, but no such file exists in this repository. The format [%(levelname)-5.5s] %(message)s appears only in this file.

Remove the redundant logger.setLevel() call on line 704 to prevent overriding user-provided logging configuration.

🤖 Prompt for AI Agents
In agentuity/server/__init__.py around lines 698 to 703, remove the redundant
call to logger.setLevel(logging.INFO) that follows logging.basicConfig(...) so
we don't override any user-configured root logger level; keep the basicConfig
call (and its format) only, and delete the subsequent logger.setLevel(...) line
to preserve user logging settings.

logger.setLevel(logging.INFO)

config_data, config_file = load_config()

if config_data is None:
Expand Down