Skip to content

Commit bc3192b

Browse files
authored
Update session.py
1 parent 35b1e57 commit bc3192b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎python_agent_harness/session.py‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -784,21 +784,20 @@ def switch_agent(self, name: str) -> tuple[bool, str]:
784784
if prompt_file is None:
785785
available = ", ".join(sorted([RESERVED_AGENT_NAME, *agents.keys()]))
786786
return False, f"unknown agent: {name} (available: {available})"
787-
from .prompts import assemble_agent_prompt, load_agent_prompt
787+
from .prompts import agent_exclude_tools, assemble_agent_prompt, load_agent_prompt
788788

789789
agent_prompt = load_agent_prompt(prompt_file, skill_dir=self._skill_dir)
790790
if agent_prompt is None:
791791
return False, f"agent {name}: prompt file not found or empty: {prompt_file}"
792+
new_exclusions = agent_exclude_tools(prompt_file)
792793
self.system_prompt = assemble_agent_prompt(
793794
self.project_dir,
794795
agent_prompt,
795796
context_path=self._configured_context_path,
796797
)
797798
self.store.system_prompt = self.system_prompt
798799
self.store.agent = name
799-
from .prompts import agent_exclude_tools
800-
801-
self._agent_excluded_tools = agent_exclude_tools(prompt_file)
800+
self._agent_excluded_tools = new_exclusions
802801
return True, f"switched to {name}"
803802

804803
# ------------------------------------------------------------------

0 commit comments

Comments
 (0)