File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/agentex/lib/sdk/fastacp/base Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ def __init__(self):
7878 self .add_middleware (RequestIDMiddleware )
7979 self ._handlers : dict [RPCMethod , Callable ] = {}
8080
81+ # Agent info to return in healthz
82+ self .agent_id : str | None = None
83+
8184 @classmethod
8285 def create (cls ):
8386 """Create and initialize BaseACPServer instance"""
@@ -94,6 +97,7 @@ def get_lifespan_function(self):
9497 @asynccontextmanager
9598 async def lifespan_context (app : FastAPI ): # noqa: ARG001
9699 env_vars = EnvironmentVariables .refresh ()
100+ self .agent_id = env_vars .AGENT_ID
97101 if env_vars .AGENTEX_BASE_URL :
98102 await register_agent (env_vars )
99103 else :
@@ -105,7 +109,10 @@ async def lifespan_context(app: FastAPI): # noqa: ARG001
105109
106110 async def _healthz (self ):
107111 """Health check endpoint"""
108- return {"status" : "healthy" }
112+ result = {"status" : "healthy" }
113+ if self .agent_id :
114+ result ["agent_id" ] = self .agent_id
115+ return result
109116
110117 def _wrap_handler (self , fn : Callable [..., Awaitable [Any ]]):
111118 """Wraps handler functions to provide JSON-RPC 2.0 response format"""
You can’t perform that action at this time.
0 commit comments