π OpenHands: AI-Driven Development
hotfix(Secrets): Add event stream filter for refreshed secret (#6764)
Rohit Malhotra14ee6d7afef9
diff --git a/openhands/events/stream.py b/openhands/events/stream.pyindex 5e02c4c369..0fc547803f 100644--- a/openhands/events/stream.py+++ b/openhands/events/stream.py@@ -282,6 +282,9 @@ class EventStream:def set_secrets(self, secrets: dict[str, str]):self.secrets = secrets.copy()+ def update_secrets(self, secrets: dict[str, str]):+ self.secrets.update(secrets)+def _replace_secrets(self, data: dict) -> dict:for key in data:if isinstance(data[key], dict):diff --git a/openhands/runtime/base.py b/openhands/runtime/base.pyindex 4f1e37f471..983fc67fa8 100644--- a/openhands/runtime/base.py+++ b/openhands/runtime/base.py@@ -225,6 +225,13 @@ class Runtime(FileEditRuntimeMixin):export_cmd = CmdRunAction(f"export GITHUB_TOKEN='{token.get_secret_value()}'")++ self.event_stream.update_secrets(+ {+ 'github_token': token.get_secret_value(),+ }+ )+await call_sync_from_async(self.run, export_cmd)observation: Observation = await call_sync_from_async(