File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/agentex/lib/sdk/fastacp/base Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 22import base64
33import inspect
44import json
5+ import os
56from collections .abc import AsyncGenerator , Awaitable , Callable
67from contextlib import asynccontextmanager
78from typing import Any
1314from pydantic import TypeAdapter , ValidationError
1415
1516# from agentex.lib.sdk.fastacp.types import BaseACPConfig
16- from agentex .lib .environment_variables import EnvironmentVariables
17+ from agentex .lib .environment_variables import EnvironmentVariables , refreshed_environment_variables
1718from agentex .lib .types .acp import (
1819 PARAMS_MODEL_BY_METHOD ,
1920 RPC_SYNC_METHODS ,
@@ -393,6 +394,13 @@ async def _register_agent(self, env_vars: EnvironmentVariables):
393394 logger .info (
394395 f"Successfully registered agent '{ env_vars .AGENT_NAME } ' with Agentex server with acp_url: { full_acp_url } . Registration data: { registration_data } "
395396 )
397+ agent = response .json ()
398+ agent_id , agent_name = agent ["id" ], agent ["name" ]
399+
400+ os .environ ["AGENT_ID" ] = agent_id
401+ os .environ ["AGENT_NAME" ] = agent_name
402+ refreshed_environment_variables .AGENT_ID = agent_id
403+ refreshed_environment_variables .AGENT_NAME = agent_name
396404 return # Success, exit the retry loop
397405 else :
398406 error_msg = f"Failed to register agent. Status: { response .status_code } , Response: { response .text } "
You can’t perform that action at this time.
0 commit comments