feat(gateway): wire safe-point runtime cancellation for agent.cancel
This commit is contained in:
@@ -97,6 +97,17 @@ export class SessionBridge {
|
||||
if (client) {client.busy = busy;}
|
||||
}
|
||||
|
||||
/** Request cancellation for the current operation on a connection's agent. */
|
||||
cancel(connectionId: string): boolean {
|
||||
const client = this.clients.get(connectionId);
|
||||
if (!client || !client.busy) {
|
||||
return false;
|
||||
}
|
||||
|
||||
client.agent.cancel();
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Set onToolUse callback for a connection's agent. */
|
||||
setOnToolUse(connectionId: string, callback: ((event: ToolUseEvent) => void) | undefined): void {
|
||||
const client = this.clients.get(connectionId);
|
||||
|
||||
Reference in New Issue
Block a user