mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
Plumb custom secrets to runtime (#8330)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user