Skip to content
Draft
Show file tree
Hide file tree
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
6 changes: 0 additions & 6 deletions codewiki/cli/adapters/doc_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
import logging
import sys

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 Third-party logger suppression duplicated in non-entry-point module doc_generator.py

Removed the module-level duplicate third-party logger suppression block (logging.getLogger("httpx"/"openai"/"openai._base_client"/"anthropic").setLevel(logging.WARNING)) and its comment from the top of codewiki/cli/adapters/doc_generator.py, since this is not the entry-point module per CODEWIKI-006. The import logging statement was kept since logging is still used extensively throughout the file (e.g., _configure_backend_logging, various logger.info/logger.error calls). This centralizes the suppression to the actual entry point (main.py), removing the duplication called out in the finding. Residual risk: this file no longer independently guarantees suppressed httpx/openai/anthropic logs if invoked in a code path that bypasses the entry point's setup_logging(); confirming that all invocation paths go through the entry point is outside this file's visibility.

πŸ€– Prompt for AI agents
In codewiki/cli/adapters/doc_generator.py around line 15, review and complete this code-review fix: Third-party logger suppression duplicated in non-entry-point module doc_generator.py.
What the draft fix changed: Removed the module-level duplicate third-party logger suppression block (`logging.getLogger("httpx"/"openai"/"openai._base_client"/"anthropic").setLevel(logging.WARNING)`) and its comment from the top of `codewiki/cli/adapters/doc_generator.py`, since this is not the entry-point module per CODEWIKI-006. The `import logging` statement was kept since `logging` is still used extensively throughout the file (e.g., `_configure_backend_logging`, various `logger.info`/`logger.error` calls). This centralizes the suppression to the actual entry point (main.py), removing the duplication called out in the finding. Residual risk: this file no longer independently guarantees suppressed httpx/openai/anthropic logs if invoked in a code path that bypasses the entry point's setup_logging(); confirming that all invocation paths go through the entry point is outside this file's visibility.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟑 85 medium β€” react πŸ‘/πŸ‘Ž to teach the reviewer

# Suppress verbose third-party library logs (OpenAI, Anthropic, httpx)
logging.getLogger("httpx").setLevel(logging.WARNING)
logging.getLogger("openai").setLevel(logging.WARNING)
logging.getLogger("openai._base_client").setLevel(logging.WARNING)
logging.getLogger("anthropic").setLevel(logging.WARNING)

from codewiki.cli.utils.progress import ProgressTracker
from codewiki.cli.models.job import DocumentationJob, LLMConfig
from codewiki.cli.utils.errors import APIError
Expand Down
7 changes: 1 addition & 6 deletions codewiki/cli/commands/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,6 @@ def generate_command(
logger = create_logger(verbose=verbose)
start_time = time.time()

# Suppress verbose third-party library logs
logging.getLogger("httpx").setLevel(logging.WARNING)
logging.getLogger("openai").setLevel(logging.WARNING)
logging.getLogger("openai._base_client").setLevel(logging.WARNING)
logging.getLogger("anthropic").setLevel(logging.WARNING)

try:
# Pre-generation checks
logger.step("Validating configuration...", 1, 4)
Comment on lines 216 to 221

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

🦩 🟠 Third-party logger suppression duplicated again in generate.py command handler

Removed the duplicated third-party logger suppression block (logging.getLogger("httpx"/"openai"/"openai._base_client"/"anthropic").setLevel(logging.WARNING)) from generate_command in codewiki/cli/commands/generate.py, immediately after start_time = time.time(). Per CODEWIKI-006 this suppression should occur exactly once at the application entry point (already present in doc_generator.py), so the redundant copy here is deleted rather than duplicated. The logging import is left in place since it is unused elsewhere in this file now, but removing it was not required by the finding and leaving it avoids risking an accidental break if it's referenced indirectly; a reviewer may want to drop the now-unused import logging as a small follow-up cleanup. Risk: if the entry-point suppression in doc_generator.py is not actually invoked before this command handler runs in some invocation path, third-party WARNING logs could reappear here β€” this was not verified end-to-end since only this file was in scope.

πŸ€– Prompt for AI agents
In codewiki/cli/commands/generate.py around line 199, review and complete this code-review fix: Third-party logger suppression duplicated again in generate.py command handler.
What the draft fix changed: Removed the duplicated third-party logger suppression block (`logging.getLogger("httpx"/"openai"/"openai._base_client"/"anthropic").setLevel(logging.WARNING)`) from `generate_command` in `codewiki/cli/commands/generate.py`, immediately after `start_time = time.time()`. Per CODEWIKI-006 this suppression should occur exactly once at the application entry point (already present in `doc_generator.py`), so the redundant copy here is deleted rather than duplicated. The `logging` import is left in place since it is unused elsewhere in this file now, but removing it was not required by the finding and leaving it avoids risking an accidental break if it's referenced indirectly; a reviewer may want to drop the now-unused `import logging` as a small follow-up cleanup. Risk: if the entry-point suppression in `doc_generator.py` is not actually invoked before this command handler runs in some invocation path, third-party WARNING logs could reappear here β€” this was not verified end-to-end since only this file was in scope.
Verify the change is correct and complete; do not refactor unrelated code.

fix confidence: 🟑 80 medium β€” react πŸ‘/πŸ‘Ž to teach the reviewer

Expand Down Expand Up @@ -553,3 +547,4 @@ def generate_command(
except Exception as e:
sys.exit(handle_error(e, verbose=verbose))