Skip to content

Commit

Permalink
plumb token secret
Browse files Browse the repository at this point in the history
  • Loading branch information
malhotra5 committed Feb 8, 2025
1 parent b5d1d6d commit 523da6d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions openhands/server/session/agent_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import time
from typing import Callable, Optional

from pydantic import SecretStr

from openhands.controller import AgentController
from openhands.controller.agent import Agent
from openhands.controller.state.state import State
Expand Down Expand Up @@ -69,7 +71,7 @@ async def start(
max_budget_per_task: float | None = None,
agent_to_llm_config: dict[str, LLMConfig] | None = None,
agent_configs: dict[str, AgentConfig] | None = None,
github_token: str | None = None,
github_token: SecretStr | None = None,
selected_repository: str | None = None,
initial_message: MessageAction | None = None,
):
Expand Down Expand Up @@ -177,7 +179,7 @@ async def _create_runtime(
runtime_name: str,
config: AppConfig,
agent: Agent,
github_token: str | None = None,
github_token: SecretStr | None = None,
selected_repository: str | None = None,
):
"""Creates a runtime instance
Expand All @@ -195,7 +197,7 @@ async def _create_runtime(
runtime_cls = get_runtime_cls(runtime_name)
env_vars = (
{
'GITHUB_TOKEN': github_token,
'GITHUB_TOKEN': github_token.get_secret_value(),
}
if github_token
else None
Expand Down

0 comments on commit 523da6d

Please sign in to comment.