Skip to content

Commit f04f490

Browse files
committed
Update loading prompt template and add log for missing file
1 parent 3656f91 commit f04f490

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

qualityflow/steps/gen_tests_agent.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,24 @@ def gen_tests_agent(
6262
tests_dir = tempfile.mkdtemp(prefix="qualityflow_agent_tests_")
6363
tests_path = Path(tests_dir)
6464

65-
# Load prompt template
66-
workspace_path = Path(workspace_dir)
67-
prompt_file = workspace_path / prompt_path
65+
# Load prompt template from QualityFlow project directory
66+
# Note: workspace_dir is the cloned repo, but prompts are in QualityFlow project
67+
project_root = Path(__file__).parent.parent # Go up from steps/ to project root
68+
prompt_file = project_root / prompt_path
6869

6970
if prompt_file.exists():
7071
with open(prompt_file, "r") as f:
7172
prompt_template = f.read()
73+
logger.info(f"Loaded prompt template from {prompt_file}")
7274
else:
7375
# Use default template if file doesn't exist
7476
prompt_template = _get_default_prompt_template()
75-
logger.info(f"Using default prompt template, {prompt_path} not found")
77+
logger.info(f"Using default prompt template, {prompt_path} not found at {prompt_file}")
7678

7779
template = Template(prompt_template)
80+
81+
# Keep workspace_path for reading source files
82+
workspace_path = Path(workspace_dir)
7883

7984
total_tokens_in = 0
8085
total_tokens_out = 0

0 commit comments

Comments
 (0)