Skip to content
Draft
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
3 changes: 2 additions & 1 deletion codewiki/src/fe/background_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _process_job(self, job_id: str):

# 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

config = Config.from_args(repo_path=temp_repo_dir, docs_dir=docs_dir)

job.progress = "Generating documentation..."

Expand Down Expand Up @@ -254,3 +254,4 @@ def _process_job(self, job_id: str):
subprocess.run(['rm', '-rf', temp_repo_dir], check=True)
except Exception as e:
logger.error(f"Failed to cleanup temp directory: {e}")