oscerd commented on PR #27714: URL: https://github.com/apache/camel/pull/27714#issuecomment-6121447363
Thanks @davsclaus — all addressed in b9da6729b4ff. You were right that the direct `ManagementStrategy.notify()` was the reason `ignoreAiEvents` had no effect; I've moved AI events onto the normal path. - **`EventHelper.notifyAiEvent(CamelContext, Supplier<AiEvent>)`** — loops `getStartedEventNotifiers()`, skips `isDisabled()` / `isIgnoreAiEvents()`, creates the event lazily (only when a notifier wants it), and delivers via `doNotifyEvent` (a failing notifier no longer stops the others). Both `camel-openai` (`OpenAIAgenticObservability`) and `camel-ai-tool` (`AiToolExecutor`) call it now, and their hand-written try/catch is gone. - **`isIgnoreAiEvents()` / `setIgnoreAiEvents()`** — default methods on `EventNotifier` (so third-party implementations keep compiling) and real impls on `EventNotifierSupport`. - **AI is its own category** — `notifyAiEvent` checks only `isIgnoreAiEvents()`, not `ignoreExchangeEvents`, so `ignoreExchangeEvents=true` does **not** drop AI events (an AI-observability notifier can keep it for performance). - **Opt-outs** — `DebugEventNotifier`, `ConsoleEventNotifier` and `MicrometerExchangeEventNotifier` set `ignoreAiEvents(true)` so AI events don't reach the debugger / the exchange-event ring / the per-event route lookup. `camel-event`'s type switch gets a `case Ai` that turns the flag off when `Ai` is subscribed. - **Tests** — `ignoreAiEvents` is honored (an ignoring notifier receives nothing while the default one does), and a notifier recognises the events via `instanceof AiEvent.ToolCallDeniedEvent` / `AiEvent.ToolCallExecutedEvent` reading `getProvider()`. - **@since 4.24** on all new types (inline fixed); the **upgrade guide** now also notes that AI events reach `instanceof ExchangeEvent` notifiers and that `ignoreAiEvents` opts out. Milestone/`fixVersion` 4.24.0. Full reactor BUILD SUCCESS; ai-tool (6) and openai (2+7) event tests green. Re-requesting your review. _Claude Code on behalf of oscerd_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
