SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]
Move Breaking: observation truncation to jinja template next_step_truncated_observation_template instead of manual truncation (#1201)
carlosbe69e037bbea
diff --git a/sweagent/agent/agents.py b/sweagent/agent/agents.pyindex d720b07d..9a535f9f 100644--- a/sweagent/agent/agents.py+++ b/sweagent/agent/agents.py@@ -67,7 +67,7 @@ class TemplateConfig(BaseModel):next_step_template: str = "Observation: {{observation}}"next_step_truncated_observation_template: str = (- "Observation: {{observation}}<response clipped>"+ "Observation: {{observation[:max_observation_length]}}<response clipped>""<NOTE>Observations should not exceeded {{max_observation_length}} characters. ""{{elided_chars}} characters were elided. Please try a different command that produces less output ""or use head/tail/grep/redirect the output to a file. Do not use interactive pagers.</NOTE>"@@ -716,7 +716,6 @@ class DefaultAgent(AbstractAgent):elif len(step.observation) > self.templates.max_observation_length:templates = [self.templates.next_step_truncated_observation_template]elided_chars = len(step.observation) - self.templates.max_observation_length- step.observation = step.observation[: self.templates.max_observation_length]else:# Show standard output template if there is observation contenttemplates = [self.templates.next_step_template]