@@ -117,6 +117,15 @@ describe("AgentDispatchMcpClient", () => {
117117 const responses : Record < string , unknown > = {
118118 dispatch_task : { taskId : "task_mcp" , status : "provisioning" , provider : "aws" , accountProfile : "dev-aws" } ,
119119 spawn_cloud_agent : { taskId : "task_spawn" , status : "provisioning" , provider : "aws" , accountProfile : "dev-aws" } ,
120+ check_cloud_agent_runtime : {
121+ ok : true ,
122+ runtime : "research-agent" ,
123+ provider : "aws" ,
124+ accountProfile : "dev-aws" ,
125+ backend : "aws-agentcore" ,
126+ targetMode : "session" ,
127+ checks : [ { name : "aws.research-agent.runtime" , status : "pass" , message : "runtime reachable" } ]
128+ } ,
120129 get_task_status : task ,
121130 get_task_logs : { taskId : "task_mcp" , cursor : 0 , nextCursor : 5 , data : "hello" } ,
122131 get_task_result : { taskId : "task_mcp" , status : "succeeded" , artifacts : [ ] } ,
@@ -144,6 +153,12 @@ describe("AgentDispatchMcpClient", () => {
144153 executionRoleArn : "arn:aws:iam::123456789012:role/agentcore-runtime" ,
145154 environmentVariables : { AGENT_FRAMEWORK : "openclaw" }
146155 } ) ) . resolves . toMatchObject ( { taskId : "task_spawn" } ) ;
156+ await expect ( client . checkCloudAgentRuntime ( {
157+ runtime : "research-agent" ,
158+ runtimeArn : "arn:aws:bedrock-agentcore:us-west-2:123456789012:runtime/research-agent" ,
159+ live : true ,
160+ target : { mode : "session" , protocol : "a2a" }
161+ } ) ) . resolves . toMatchObject ( { ok : true , backend : "aws-agentcore" } ) ;
147162 await expect ( client . getTaskStatus ( "task_mcp" ) ) . resolves . toMatchObject ( { status : "running" } ) ;
148163 await expect ( client . getTaskLogs ( "task_mcp" , 0 , 128 ) ) . resolves . toMatchObject ( { data : "hello" } ) ;
149164 await expect ( client . getTaskResult ( "task_mcp" ) ) . resolves . toMatchObject ( { status : "succeeded" } ) ;
@@ -154,6 +169,7 @@ describe("AgentDispatchMcpClient", () => {
154169 expect ( calls . map ( ( call ) => call . toolName ) ) . toEqual ( [
155170 "dispatch_task" ,
156171 "spawn_cloud_agent" ,
172+ "check_cloud_agent_runtime" ,
157173 "get_task_status" ,
158174 "get_task_logs" ,
159175 "get_task_result" ,
@@ -180,6 +196,12 @@ describe("AgentDispatchMcpClient", () => {
180196 executionRoleArn : "arn:aws:iam::123456789012:role/agentcore-runtime" ,
181197 environmentVariables : { AGENT_FRAMEWORK : "openclaw" }
182198 } ) ;
199+ expect ( calls [ 2 ] . input ) . toMatchObject ( {
200+ runtime : "research-agent" ,
201+ live : true ,
202+ runtimeArn : "arn:aws:bedrock-agentcore:us-west-2:123456789012:runtime/research-agent" ,
203+ target : { mode : "session" , protocol : "a2a" }
204+ } ) ;
183205 } ) ;
184206
185207 it ( "supports transports that return decoded JSON directly" , async ( ) => {
@@ -190,6 +212,30 @@ describe("AgentDispatchMcpClient", () => {
190212 await expect ( client . listProviders ( ) ) . resolves . toEqual ( [ "aws" , "gcp" ] ) ;
191213 } ) ;
192214
215+ it ( "accepts MCP-native runtime check aliases" , async ( ) => {
216+ let forwarded : Record < string , unknown > | undefined ;
217+ const client = new AgentDispatchMcpClient ( {
218+ callTool : async ( _toolName , input ) => {
219+ forwarded = input ;
220+ return { ok : true , checks : [ ] } ;
221+ }
222+ } ) ;
223+
224+ await client . checkCloudAgentRuntime ( {
225+ provider : "aws" ,
226+ account_profile : "dev-aws" ,
227+ runtime_arn : "arn:aws:bedrock-agentcore:us-west-2:123456789012:runtime/alias" ,
228+ target : { mode : "session" }
229+ } ) ;
230+
231+ expect ( forwarded ) . toMatchObject ( {
232+ provider : "aws" ,
233+ account_profile : "dev-aws" ,
234+ runtime_arn : "arn:aws:bedrock-agentcore:us-west-2:123456789012:runtime/alias" ,
235+ target : { mode : "session" }
236+ } ) ;
237+ } ) ;
238+
193239 it ( "accepts MCP-native spawn aliases for clarification retries" , async ( ) => {
194240 let forwarded : Record < string , unknown > | undefined ;
195241 const client = new AgentDispatchMcpClient ( {
0 commit comments