Issue #3610965: Add request_tag scope to attach context by AI request tags

Adds an "AI Request Tags" scope plugin (in the ai_empathy_ccc submodule) that includes a context item when the AI request carries one of the tags the item is scoped to. Tags are the ai module's provider tags (e.g. ai_empathy, ai_empathy_scenario:5), and the selectable list is admin-defined and rendered as checkboxes on each context item.

  • Add AiContextScopeRequestTag plugin (admin-defined tag list + settings form, subscription-based matching, request_tag scope-settings config + schema).
  • Surface the request tags on EvaluationPromptAlterEvent and compute them in EmpathyEvaluator before the prompt is built, so subscribers can react to them.
  • Merge the request tags into the context request as a request_tag subscription in CccIntegrationSubscriber.
  • Add unit tests for the plugin and subscriber, plus a kernel test proving matching items are included and non-matching items excluded (globals preserved) under getRenderedContext()'s MATCH_ALL selection.

No changes required to ai_context: matching reuses the existing scope subscription resolver and index.

Closes #3610965

Merge request reports

Loading