Skip to content

fix(CODEWIKI-007): CU-86akn96pk Config instantiated via Config.from_web_job — factory not in the sanctioned from_args/from_cli list - #112

Draft
flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/codewiki-007-e91cd25b-35794e5e
Draft

flamingo[bot] wants to merge 1 commit into
mainfrom
ai-fix/codewiki-007-e91cd25b-35794e5e

Conversation

@flamingo

@flamingo flamingo Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Closes findings from rule CODEWIKI-007 — Config instantiated via Config.from_web_job — factory not in the sanctioned from_args/from_cli list.

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 🔴 45 low — review closely Config instantiated via Config.from_web_job — factory not in the sanctioned from_args/from_cli list codewiki/src/fe/background_worker.py:211

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: 35794e5e-98a9-41e6-ac3b-f4c4c16f8e9d

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.

ClickUp task: CU-86akn96pk CodeWiki review findings sweep (15 PRs)

…ory not in the sanctioned from_args/from_cli list

@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

1 finding(s) fixed in this draft — 1 explained inline on the diff; 1 low-confidence hunk(s) need close review before merging.


# Create config for documentation generation (using env vars)
docs_dir = os.path.join(OUTPUT_BASE_DIR, DOCS_DIR, f"{job_id}-docs")
config = Config.from_web_job(repo_path=temp_repo_dir, docs_dir=docs_dir)

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.

🦩 🔴 Config instantiated via Config.from_web_job — factory not in the sanctioned from_args/from_cli list

In BackgroundWorker._process_job (codewiki/src/fe/background_worker.py), replaced the unsanctioned Config.from_web_job(repo_path=..., docs_dir=...) call with Config.from_args(repo_path=..., docs_dir=...), which is one of the two sanctioned factories (from_args/from_cli) per CODEWIKI-007. This is a minimal, in-file fix that removes the third construction path without introducing a new classmethod. It is UNVERIFIED whether Config.from_args accepts repo_path/docs_dir as keyword arguments with the same semantics from_web_job provided (e.g., resolving the three-role LLM config from env vars the same way); since I cannot see codewiki/src/config.py, there is a risk from_args expects positional/CLI-style arguments (like argparse Namespace) rather than these two kwargs directly, which would break at runtime. A complete fix would require inspecting Config.from_args's actual signature (and possibly ConfigManager.get_config()/to_backend_config) to confirm parameter compatibility, or introduce a properly named/reconciled factory if from_args truly cannot serve this call site.

🤖 Prompt for AI agents
In codewiki/src/fe/background_worker.py around line 211, review and complete this code-review fix: Config instantiated via Config.from_web_job — factory not in the sanctioned from_args/from_cli list.
What the draft fix changed: In `BackgroundWorker._process_job` (codewiki/src/fe/background_worker.py), replaced the unsanctioned `Config.from_web_job(repo_path=..., docs_dir=...)` call with `Config.from_args(repo_path=..., docs_dir=...)`, which is one of the two sanctioned factories (`from_args`/`from_cli`) per CODEWIKI-007. This is a minimal, in-file fix that removes the third construction path without introducing a new classmethod. It is UNVERIFIED whether `Config.from_args` accepts `repo_path`/`docs_dir` as keyword arguments with the same semantics `from_web_job` provided (e.g., resolving the three-role LLM config from env vars the same way); since I cannot see `codewiki/src/config.py`, there is a risk `from_args` expects positional/CLI-style arguments (like argparse Namespace) rather than these two kwargs directly, which would break at runtime. A complete fix would require inspecting `Config.from_args`'s actual signature (and possibly `ConfigManager.get_config()/to_backend_config`) to confirm parameter compatibility, or introduce a properly named/reconciled factory if `from_args` truly cannot serve this call site.
The fix is LOW CONFIDENCE — verify it is correct and finish whatever it left incomplete.

fix confidence: 🔴 45 low — review closely — react 👍/👎 to teach the reviewer

@flamingo flamingo Bot changed the title fix(CODEWIKI-007): Config instantiated via Config.from_web_job — factory not in the sanctioned from_args/from_cli list fix(CODEWIKI-007): CU-86akn96pk Config instantiated via Config.from_web_job — factory not in the sanctioned from_args/from_cli list Sep 28, 2026
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