Plumb custom secrets to runtime (#8330)

Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
Rohit Malhotra
2025-05-15 20:06:30 -04:00
committed by GitHub
parent 1f827170f4
commit feb04dc65f
17 changed files with 246 additions and 13 deletions

View File

@@ -176,6 +176,9 @@ class Memory:
microagent_knowledge=microagent_knowledge,
content='Added workspace context',
date=self.runtime_info.date if self.runtime_info is not None else '',
custom_secrets_descriptions=self.runtime_info.custom_secrets_descriptions
if self.runtime_info is not None
else {},
)
return obs
return None
@@ -266,7 +269,9 @@ class Memory:
else:
self.repository_info = None
def set_runtime_info(self, runtime: Runtime) -> None:
def set_runtime_info(
self, runtime: Runtime, custom_secrets_descriptions: dict[str, str]
) -> None:
"""Store runtime info (web hosts, ports, etc.)."""
# e.g. { '127.0.0.1': 8080 }
utc_now = datetime.now(timezone.utc)
@@ -277,9 +282,12 @@ class Memory:
available_hosts=runtime.web_hosts,
additional_agent_instructions=runtime.additional_agent_instructions,
date=date,
custom_secrets_descriptions=custom_secrets_descriptions,
)
else:
self.runtime_info = RuntimeInfo(date=date)
self.runtime_info = RuntimeInfo(
date=date, custom_secrets_descriptions=custom_secrets_descriptions
)
def send_error_message(self, message_id: str, message: str):
"""Sends an error message if the callback function was provided."""