-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Problem
codeframe/agents/test_worker_agent.py hardcodes its output directory to the codeframe repo itself:
# Line 74
self.project_root = Path(__file__).parent.parent.parent
self.tests_dir = self.project_root / "tests"This means any time the test worker agent runs — even for a completely different project — it writes files into codeframe/tests/. The most visible symptom is tests/test_new_feature.py reappearing after deletion, because the fallback test name is hardcoded:
# Line 262
test_name = "test_new_feature" # default when task description can't be parsedImpact
tests/test_new_feature.pykeeps reappearing (deleted 3-4 times, keeps coming back)- The agent could silently overwrite real test files in the codeframe repo
- Violates v2 architecture rule: agents should operate on the target workspace, not the tool's own repo
Root Cause
TestWorkerAgent is v1 legacy code that predates the v2 workspace architecture. It doesn't accept a Workspace parameter — it uses Path(__file__) to find its output directory.
Affected files
codeframe/agents/test_worker_agent.py— hardcodedproject_rootandtests_dircodeframe/agents/worker_agent.py— parent class, also v1 legacycodeframe/agents/agent_pool_manager.py— only consumer ofTestWorkerAgent
Suggested Fix
Two options (not mutually exclusive):
-
Quick fix: Make
TestWorkerAgent.__init__accept aproject_rootparameter instead of deriving it from__file__. Fall back to current behavior only if not provided. -
Proper fix: Since this is v1 legacy code not used by the Golden Path, consider marking it deprecated or removing it entirely. The v2
ReactAgenthandles test generation as part of its general execution flow.
Workaround
tests/test_new_feature.py has been added to .gitignore so it won't show up in git status anymore.
Labels
bugv1-legacy