@@ -55,7 +55,50 @@ def test_system_prompt_with_goosehints(temp_dir, developer_toolkit):
55
55
assert system_prompt .endswith (expected_end )
56
56
57
57
58
- def test_update_plan (developer_toolkit ):
58
+ def test_system_prompt_with_goosehints_only_from_home_dir (temp_dir , developer_toolkit ):
59
+ readme_file_home = Path .home () / ".config/goose/README.md"
60
+ readme_file_home .parent .mkdir (parents = True , exist_ok = True )
61
+ readme_file_home .write_text ("This is from the README.md file in home." )
62
+
63
+ home_hints_file = Path .home () / ".config/goose/.goosehints"
64
+ home_jinja_template_content = "Hints from home:\n \n {% include 'README.md' %}\n End."
65
+ home_hints_file .write_text (home_jinja_template_content )
66
+
67
+ try :
68
+ with change_dir (temp_dir ):
69
+ system_prompt = developer_toolkit .system ()
70
+ expected_content_home = "Hints from home:\n \n This is from the README.md file in home.\n End."
71
+ expected_end = f"Hints:\n { expected_content_home } "
72
+ assert system_prompt .endswith (expected_end )
73
+ finally :
74
+ home_hints_file .unlink ()
75
+ readme_file_home .unlink ()
76
+
77
+ readme_file = temp_dir / "README.md"
78
+ readme_file .write_text ("This is from the README.md file." )
79
+
80
+ hints_file = temp_dir / ".goosehints"
81
+ jinja_template_content = "Hints from local:\n \n {% include 'README.md' %}\n End."
82
+ hints_file .write_text (jinja_template_content )
83
+
84
+ home_hints_file = Path .home () / ".config/goose/.goosehints"
85
+ home_jinja_template_content = "Hints from home:\n \n {% include 'README.md' %}\n End."
86
+ home_hints_file .write_text (home_jinja_template_content )
87
+
88
+ home_readme_file = Path .home () / ".config/goose/README.md"
89
+ home_readme_file .write_text ("This is from the README.md file in home." )
90
+
91
+ try :
92
+ with change_dir (temp_dir ):
93
+ system_prompt = developer_toolkit .system ()
94
+ expected_content_local = "Hints from local:\n \n This is from the README.md file.\n End."
95
+ expected_content_home = "Hints from home:\n \n This is from the README.md file in home.\n End."
96
+ expected_end = f"Hints:\n { expected_content_local } \n { expected_content_home } "
97
+ assert system_prompt .endswith (expected_end )
98
+ finally :
99
+ home_hints_file .unlink ()
100
+ home_readme_file .unlink ()
101
+
59
102
tasks = [
60
103
{"description" : "Task 1" , "status" : "planned" },
61
104
{"description" : "Task 2" , "status" : "complete" },
0 commit comments