Skip to content

Commit

Permalink
restrict runtime info
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Mar 6, 2025
1 parent 2c65b23 commit 812fe98
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ each of which has a corresponding port:
When starting a web server, use the corresponding ports. You should also
set any options to allow iframes and CORS requests, and allow the server to
be accessed from any host (e.g. 0.0.0.0).
Only create the server if the user has requested it.
</RUNTIME_INFORMATION>
{% endif %}
6 changes: 5 additions & 1 deletion openhands/utils/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,14 @@ def add_info_to_initial_message(
repo_instructions += '\n\n'
repo_instructions += microagent.content

server_keywords = ['fastapi', 'flask', 'django']
is_runtime_info_needed = any(keyword in repo_instructions for keyword in server_keywords)


additional_info = self.additional_info_template.render(
repository_instructions=repo_instructions,
repository_info=self.repository_info,
runtime_info=self.runtime_info,
runtime_info=self.runtime_info if is_runtime_info_needed else None,
).strip()

# Insert the new content at the start of the TextContent list
Expand Down

0 comments on commit 812fe98

Please sign in to comment.