Rename delete_related_files to deregister_related_files.
This commit is contained in:
parent
678722f37f
commit
5ddceabae1
|
|
@ -458,7 +458,7 @@ Exit Criteria:
|
||||||
Context Cleanup:
|
Context Cleanup:
|
||||||
- Use delete_key_facts to remove any key facts that no longer apply.
|
- Use delete_key_facts to remove any key facts that no longer apply.
|
||||||
- Use delete_key_snippets to remove any key snippets that no longer apply.
|
- Use delete_key_snippets to remove any key snippets that no longer apply.
|
||||||
- Use delete_research_notes to remove any research notes that no longer apply.
|
- Use deregister_related_files to remove any related files that no longer apply.
|
||||||
|
|
||||||
Remember:
|
Remember:
|
||||||
- Always begin by calling ask_human.
|
- Always begin by calling ask_human.
|
||||||
|
|
@ -467,4 +467,4 @@ Remember:
|
||||||
- Do communicate results/responses from tools that you call as it pertains to the users request.
|
- Do communicate results/responses from tools that you call as it pertains to the users request.
|
||||||
- If the user interrupts/cancels an operation, you may want to ask why.
|
- If the user interrupts/cancels an operation, you may want to ask why.
|
||||||
- For deep debugging, logic analysis, or correctness checks, rely on the expert (if expert is available) for guidance.
|
- For deep debugging, logic analysis, or correctness checks, rely on the expert (if expert is available) for guidance.
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from ra_aid.tools import (
|
||||||
ask_expert, ask_human, run_shell_command, run_programming_task,
|
ask_expert, ask_human, run_shell_command, run_programming_task,
|
||||||
emit_research_notes, emit_plan, emit_related_files, emit_task,
|
emit_research_notes, emit_plan, emit_related_files, emit_task,
|
||||||
emit_expert_context, emit_key_facts, delete_key_facts,
|
emit_expert_context, emit_key_facts, delete_key_facts,
|
||||||
emit_key_snippets, delete_key_snippets, delete_related_files, delete_tasks, read_file_tool,
|
emit_key_snippets, delete_key_snippets, deregister_related_files, delete_tasks, read_file_tool,
|
||||||
fuzzy_find_project_files, ripgrep_search, list_directory_tree,
|
fuzzy_find_project_files, ripgrep_search, list_directory_tree,
|
||||||
swap_task_order, monorepo_detected, existing_project_detected, ui_detected,
|
swap_task_order, monorepo_detected, existing_project_detected, ui_detected,
|
||||||
task_completed, plan_implementation_completed
|
task_completed, plan_implementation_completed
|
||||||
|
|
@ -20,7 +20,7 @@ def get_read_only_tools(human_interaction: bool = False) -> list:
|
||||||
delete_key_facts,
|
delete_key_facts,
|
||||||
emit_key_snippets,
|
emit_key_snippets,
|
||||||
delete_key_snippets,
|
delete_key_snippets,
|
||||||
delete_related_files,
|
deregister_related_files,
|
||||||
list_directory_tree,
|
list_directory_tree,
|
||||||
read_file_tool,
|
read_file_tool,
|
||||||
fuzzy_find_project_files,
|
fuzzy_find_project_files,
|
||||||
|
|
@ -118,7 +118,7 @@ def get_chat_tools(expert_enabled: bool = True) -> list:
|
||||||
request_research_and_implementation,
|
request_research_and_implementation,
|
||||||
delete_key_facts,
|
delete_key_facts,
|
||||||
delete_key_snippets,
|
delete_key_snippets,
|
||||||
delete_related_files
|
deregister_related_files
|
||||||
]
|
]
|
||||||
|
|
||||||
return tools
|
return tools
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,14 @@ from .memory import (
|
||||||
delete_tasks, emit_research_notes, emit_plan, emit_task, get_memory_value, emit_key_facts,
|
delete_tasks, emit_research_notes, emit_plan, emit_task, get_memory_value, emit_key_facts,
|
||||||
request_implementation, delete_key_facts,
|
request_implementation, delete_key_facts,
|
||||||
emit_key_snippets, delete_key_snippets, emit_related_files, swap_task_order, task_completed,
|
emit_key_snippets, delete_key_snippets, emit_related_files, swap_task_order, task_completed,
|
||||||
plan_implementation_completed, delete_related_files
|
plan_implementation_completed, deregister_related_files
|
||||||
)
|
)
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'ask_expert',
|
'ask_expert',
|
||||||
'delete_key_facts',
|
'delete_key_facts',
|
||||||
'delete_key_snippets',
|
'delete_key_snippets',
|
||||||
'delete_related_files',
|
'deregister_related_files',
|
||||||
'emit_expert_context',
|
'emit_expert_context',
|
||||||
'emit_key_facts',
|
'emit_key_facts',
|
||||||
'emit_key_snippets',
|
'emit_key_snippets',
|
||||||
|
|
|
||||||
|
|
@ -384,8 +384,8 @@ def emit_related_files(files: List[str]) -> str:
|
||||||
return '\n'.join(results)
|
return '\n'.join(results)
|
||||||
|
|
||||||
|
|
||||||
@tool("delete_related_files")
|
@tool("deregister_related_files")
|
||||||
def delete_related_files(file_ids: List[int]) -> str:
|
def deregister_related_files(file_ids: List[int]) -> str:
|
||||||
"""Delete multiple related files from global memory by their IDs.
|
"""Delete multiple related files from global memory by their IDs.
|
||||||
Silently skips any IDs that don't exist.
|
Silently skips any IDs that don't exist.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ from ra_aid.tools.memory import (
|
||||||
delete_key_snippets,
|
delete_key_snippets,
|
||||||
emit_related_files,
|
emit_related_files,
|
||||||
get_related_files,
|
get_related_files,
|
||||||
delete_related_files,
|
deregister_related_files,
|
||||||
emit_task,
|
emit_task,
|
||||||
delete_tasks,
|
delete_tasks,
|
||||||
swap_task_order
|
swap_task_order
|
||||||
|
|
@ -269,19 +269,19 @@ def test_related_files_id_tracking(reset_memory):
|
||||||
assert _global_memory['related_files'][0] == "file1.py"
|
assert _global_memory['related_files'][0] == "file1.py"
|
||||||
assert _global_memory['related_files'][1] == "file2.py"
|
assert _global_memory['related_files'][1] == "file2.py"
|
||||||
|
|
||||||
def test_delete_related_files(reset_memory):
|
def test_deregister_related_files(reset_memory):
|
||||||
"""Test deleting related files"""
|
"""Test deleting related files"""
|
||||||
# Add test files
|
# Add test files
|
||||||
emit_related_files.invoke({"files": ["file1.py", "file2.py", "file3.py"]})
|
emit_related_files.invoke({"files": ["file1.py", "file2.py", "file3.py"]})
|
||||||
|
|
||||||
# Delete middle file
|
# Delete middle file
|
||||||
result = delete_related_files.invoke({"file_ids": [1]})
|
result = deregister_related_files.invoke({"file_ids": [1]})
|
||||||
assert result == "File references removed."
|
assert result == "File references removed."
|
||||||
assert 1 not in _global_memory['related_files']
|
assert 1 not in _global_memory['related_files']
|
||||||
assert len(_global_memory['related_files']) == 2
|
assert len(_global_memory['related_files']) == 2
|
||||||
|
|
||||||
# Delete multiple files including non-existent ID
|
# Delete multiple files including non-existent ID
|
||||||
result = delete_related_files.invoke({"file_ids": [0, 2, 999]})
|
result = deregister_related_files.invoke({"file_ids": [0, 2, 999]})
|
||||||
assert result == "File references removed."
|
assert result == "File references removed."
|
||||||
assert len(_global_memory['related_files']) == 0
|
assert len(_global_memory['related_files']) == 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue