Skip to content

Commit

Permalink
more possible manual intervention
Browse files Browse the repository at this point in the history
  • Loading branch information
Domiii committed Oct 14, 2024
1 parent f31d0c2 commit db08f24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 8 additions & 3 deletions sweagent/agent/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
ModelQueryResult,
get_last_valid_tool_use_name,
get_model,
make_model_query_result,
make_assistant_content,
make_model_query_result,
make_user_reply_content,
)
from sweagent.agent.parsing import FormatError, ParseFunction
from sweagent.environment.swe_env import SWEEnv
from sweagent.utils.config import convert_path_to_abspath, convert_paths_to_abspath
from sweagent.utils.log import get_logger
from sweagent.utils.instrumentation import instrument
from sweagent.utils.log import get_logger

logger = get_logger("agents")

Expand Down Expand Up @@ -643,7 +643,12 @@ def forward_model(self, observation: str, state: str) -> ModelQueryResult:
if is_init:
# Show instance template if prev. obs. was initial system message
self.made_initial_prompt = True
templates = [self.config.instance_template]
# NOTE: Uncomment this to force-feed manually constructed data into initial prompt.
# from sweagent.agent.manual_prompt_input import MANUAL_ANALYSIS_PROMPT
# templates = [
# self.config.instance_template,
# self.config.next_step_template]
# observation = MANUAL_ANALYSIS_PROMPT
if self.config.strategy_template is not None:
templates.append(self.config.strategy_template)
elif observation is None or observation.strip() == "":
Expand Down
2 changes: 0 additions & 2 deletions sweagent/environment/swe_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,7 @@ def _container_patch_path(self):
return "/root/test.patch"

def _prepare_test_patch(self):
ln = "\n"
patch = self.record["test_patch"]
self.logger.debug(f"Preparing patch at {self._container_patch_path}:{ln}{ln}{patch}")
self.copy_string_to_container_file(patch, self._container_patch_path)


Expand Down

0 comments on commit db08f24

Please sign in to comment.