@@ -15,7 +15,12 @@ import {
1515 * what the check itself accepts and refuses when a proxy sits in front of the daemon.
1616 */
1717
18- const DAEMON_LINK = { ok : true , service : 'agent-device-daemon' , version : '98.0.0' } as const ;
18+ const DAEMON_LINK = {
19+ ok : true ,
20+ service : 'agent-device-daemon' ,
21+ version : '98.0.0' ,
22+ hostArch : 'arm64' ,
23+ } as const ;
1924
2025async function withHealthServer < T > (
2126 payload : Record < string , unknown > ,
@@ -40,6 +45,7 @@ function proxyHealth(upstreamRpcProtocolVersion: number): Record<string, unknown
4045 service : 'agent-device-proxy' ,
4146 version : '99.0.0' ,
4247 rpcProtocolVersion : DAEMON_RPC_PROTOCOL_VERSION ,
48+ hostArch : 'x86_64' ,
4349 upstream : { ...DAEMON_LINK , rpcProtocolVersion : upstreamRpcProtocolVersion } ,
4450 } ;
4551}
@@ -51,10 +57,12 @@ test('a proxy whose daemon speaks the same protocol passes with the upstream lin
5157 const health = await readRemoteDaemonHealth ( { baseUrl, token : 'proxy-token' , pid : 0 } ) ;
5258 assert . equal ( health . reachable , true ) ;
5359 assert . equal ( health . service , 'agent-device-proxy' ) ;
60+ assert . equal ( health . hostArch , 'x86_64' ) ;
5461 assert . deepEqual ( health . upstream , {
5562 service : 'agent-device-daemon' ,
5663 version : '98.0.0' ,
5764 rpcProtocolVersion : DAEMON_RPC_PROTOCOL_VERSION ,
65+ hostArch : 'arm64' ,
5866 } ) ;
5967 } ) ;
6068} ) ;
@@ -79,15 +87,17 @@ test('a proxy whose daemon speaks another protocol is refused, naming the daemon
7987 } ) ;
8088} ) ;
8189
82- test ( 'a daemon health payload without an upstream link parses as before' , async ( t ) => {
90+ test ( 'a daemon health payload without an upstream link or host arch parses as before' , async ( t ) => {
8391 if ( await skipWhenLoopbackUnavailable ( t ) ) return ;
8492
93+ const { hostArch : _hostArch , ...legacyLink } = DAEMON_LINK ;
8594 await withHealthServer (
86- { ...DAEMON_LINK , rpcProtocolVersion : DAEMON_RPC_PROTOCOL_VERSION } ,
95+ { ...legacyLink , rpcProtocolVersion : DAEMON_RPC_PROTOCOL_VERSION } ,
8796 async ( baseUrl ) => {
8897 const health = await readRemoteDaemonHealth ( { baseUrl, token : 'daemon-token' , pid : 0 } ) ;
8998 assert . equal ( health . reachable , true ) ;
9099 assert . equal ( health . upstream , undefined ) ;
100+ assert . equal ( 'hostArch' in health , false ) ;
91101 assert . equal ( health . rpcProtocolVersion , DAEMON_RPC_PROTOCOL_VERSION ) ;
92102 } ,
93103 ) ;
0 commit comments