Skip to content

fix(CODEWIKI-006): 2 review findings across 2 files - #41

Draft
flamingo[bot] wants to merge 2 commits into
mainfrom
ai-fix/codewiki-006-541b150a-bef4f5a8
Draft

fix(CODEWIKI-006): 2 review findings across 2 files#41
flamingo[bot] wants to merge 2 commits into
mainfrom
ai-fix/codewiki-006-541b150a-bef4f5a8

Conversation

@flamingo

@flamingo flamingo Bot commented Aug 24, 2026

Copy link
Copy Markdown

Closes 2 review findings across 2 files.

Draft — this is a starting point, not a finished change. The fix required judgment, so read it before trusting it.

# Fix confidence Finding Location
1 🟡 85 medium Third-party logger suppression duplicated in non-entry-point module doc_generator.py codewiki/cli/adapters/doc_generator.py:15
2 🟡 80 medium Third-party logger suppression duplicated again in generate.py command handler codewiki/cli/commands/generate.py:199

What changed — and what was deliberately left — is explained per finding as inline review comments on the lines each finding touched.


Run: https://product-hub.flamingo.so/admin/code-review
Run id: bef4f5a8-e7f3-478b-8731-2becca2de658

Merging this PR is recorded as acceptance of the rule that produced it;
closing it unmerged is recorded as rejection. Both feed rule health, so
closing a wrong suggestion is useful rather than merely tidy.

@flamingo flamingo Bot left a comment

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.

🦩 What this fix changed, finding by finding

2 finding(s) fixed in this draft — 2 explained inline on the diff.

@@ -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

Comment on lines 216 to 221
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)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants