feat(gateway): add interrupt preemption telemetry and requester notice
This commit is contained in:
@@ -19,6 +19,7 @@ import type {
|
||||
SessionCheckpointEvent,
|
||||
SessionAutoCompactEvent,
|
||||
UserActionEvent,
|
||||
QueuePreemptEvent,
|
||||
BackendRouteEvent,
|
||||
BackendFallbackEvent,
|
||||
CronTriggerEvent,
|
||||
@@ -194,6 +195,11 @@ export class AuditLogger {
|
||||
this.write({ level: 'info', event_type: 'user.action', event: event as unknown as Record<string, unknown> });
|
||||
}
|
||||
|
||||
queuePreempt(event: QueuePreemptEvent): void {
|
||||
if (!this.shouldLog('sessions', 'info')) {return;}
|
||||
this.write({ level: 'info', event_type: 'queue.preempt', event: event as unknown as Record<string, unknown> });
|
||||
}
|
||||
|
||||
backendRoute(event: BackendRouteEvent): void {
|
||||
if (!this.shouldLog('sessions', 'info')) {return;}
|
||||
this.write({ level: 'info', event_type: 'backend.route', event: event as unknown as Record<string, unknown> });
|
||||
|
||||
@@ -11,6 +11,7 @@ export type AuditEventType =
|
||||
| 'skills.installer.execution_blocked' | 'skills.installer.command_result' | 'skills.registry_install'
|
||||
// Session lifecycle
|
||||
| 'session.create' | 'session.message' | 'session.delete' | 'session.transfer' | 'session.compact' | 'session.checkpoint' | 'session.auto_compact' | 'user.action'
|
||||
| 'queue.preempt'
|
||||
| 'backend.route' | 'backend.fallback'
|
||||
// Automation - Cron
|
||||
| 'cron.trigger' | 'cron.sent' | 'cron.add' | 'cron.remove'
|
||||
@@ -210,6 +211,16 @@ export interface UserActionEvent {
|
||||
command?: string;
|
||||
}
|
||||
|
||||
export interface QueuePreemptEvent {
|
||||
session_id: string;
|
||||
channel: string;
|
||||
sender: string;
|
||||
lane_id: string;
|
||||
request_id: string;
|
||||
mode: 'interrupt';
|
||||
cancelled_active_run: boolean;
|
||||
}
|
||||
|
||||
export interface BackendRouteEvent {
|
||||
session_id: string;
|
||||
channel: string;
|
||||
|
||||
Reference in New Issue
Block a user