test(core): harden messageBus subscription for legacy-agent-session tests

This commit is contained in:
Michael Bleigh
2026-05-05 12:07:37 -07:00
parent 005e0cfc53
commit 4a4f54c20d
@@ -99,10 +99,12 @@ export class LegacyAgentProtocol implements AgentProtocol {
this._scheduler = scheduler;
}
this._config.messageBus.subscribe(
MessageBusType.TOOL_CALLS_UPDATE,
this._handleToolCallsUpdate.bind(this),
);
if (this._config.messageBus) {
this._config.messageBus.subscribe(
MessageBusType.TOOL_CALLS_UPDATE,
this._handleToolCallsUpdate.bind(this),
);
}
}
get events(): readonly AgentEvent[] {