fix: use OpenClaw gateway protocol 4
This commit is contained in:
parent
e7a7ba92c4
commit
a12a0b0203
@ -18,7 +18,7 @@ import 'gateway_runtime_errors.dart';
|
||||
import 'gateway_runtime_helpers.dart';
|
||||
import 'gateway_runtime_core.dart';
|
||||
|
||||
const kGatewayProtocolVersion = 3;
|
||||
const kGatewayProtocolVersion = 4;
|
||||
const kDefaultOperatorConnectScopes = <String>[
|
||||
'operator.admin',
|
||||
'operator.read',
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:xworkmate/runtime/device_identity_store.dart';
|
||||
import 'package:xworkmate/runtime/gateway_acp_client.dart';
|
||||
import 'package:xworkmate/runtime/gateway_runtime.dart';
|
||||
import 'package:xworkmate/runtime/runtime_controllers.dart';
|
||||
import 'package:xworkmate/runtime/runtime_models.dart';
|
||||
import 'package:xworkmate/runtime/secure_config_store.dart';
|
||||
|
||||
void main() {
|
||||
@ -129,9 +130,10 @@ void main() {
|
||||
endpointResolver: () => Uri.parse('http://127.0.0.1:${server.port}'),
|
||||
authorizationResolver: (_) async => 'bridge-token',
|
||||
);
|
||||
final identityStore = DeviceIdentityStore(store);
|
||||
final runtime = GatewayRuntime(
|
||||
store: store,
|
||||
identityStore: DeviceIdentityStore(store),
|
||||
identityStore: identityStore,
|
||||
sessionClient: GatewayAcpRuntimeSessionClient(client: acpClient),
|
||||
);
|
||||
await runtime.initialize();
|
||||
@ -142,6 +144,18 @@ void main() {
|
||||
await tempDir.delete(recursive: true);
|
||||
});
|
||||
|
||||
final directConnectParams = await runtime.buildConnectParamsInternal(
|
||||
runtime,
|
||||
profile: GatewayConnectionProfile.defaults(),
|
||||
identity: await identityStore.loadOrCreate(),
|
||||
nonce: 'nonce',
|
||||
authToken: 'bridge-token',
|
||||
authDeviceToken: '',
|
||||
authPassword: '',
|
||||
);
|
||||
expect(directConnectParams['minProtocol'], kGatewayProtocolVersion);
|
||||
expect(directConnectParams['maxProtocol'], kGatewayProtocolVersion);
|
||||
|
||||
final controller = SkillsController(runtime);
|
||||
await controller.refresh(agentId: 'main');
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user