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 parsed
Impact
tests/test_new_feature.py keeps 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 — hardcoded project_root and tests_dir
codeframe/agents/worker_agent.py — parent class, also v1 legacy
codeframe/agents/agent_pool_manager.py — only consumer of TestWorkerAgent
Suggested Fix
Two options (not mutually exclusive):
-
Quick fix: Make TestWorkerAgent.__init__ accept a project_root parameter 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 ReactAgent handles 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
Problem
codeframe/agents/test_worker_agent.pyhardcodes its output directory to the codeframe repo itself: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 istests/test_new_feature.pyreappearing after deletion, because the fallback test name is hardcoded:Impact
tests/test_new_feature.pykeeps reappearing (deleted 3-4 times, keeps coming back)Root Cause
TestWorkerAgentis v1 legacy code that predates the v2 workspace architecture. It doesn't accept aWorkspaceparameter — it usesPath(__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 ofTestWorkerAgentSuggested 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.pyhas been added to.gitignoreso it won't show up in git status anymore.Labels
bugv1-legacy