Skip to content

Commit 0de1941

Browse files
committed
Update base_acp_server.py
1 parent b71fc8e commit 0de1941

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/agentex/lib/sdk/fastacp/base/base_acp_server.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,14 @@ async def _register_agent(self, env_vars: EnvironmentVariables):
390390
registration_url, json=registration_data, timeout=30.0
391391
)
392392
if response.status_code == 200:
393+
agent = response.json()
394+
agent_id, agent_name = agent["id"], agent["name"]
395+
396+
os.environ["AGENT_ID"] = agent_id
397+
os.environ["AGENT_NAME"] = agent_name
398+
#refreshed_environment_variables.AGENT_ID = agent_id
399+
#refreshed_environment_variables.AGENT_NAME = agent_name
400+
393401
logger.info(
394402
f"Successfully registered agent '{env_vars.AGENT_NAME}' with Agentex server with acp_url: {full_acp_url}. Registration data: {registration_data}"
395403
)

0 commit comments

Comments
 (0)