AI Agents framework built on Symfony AI Agent

Description

Adds the ai_agent module: an AI Agents framework built on Symfony AI (^0.12).

Runtimes are plugins: drupal_ai (the loop this module owns, with per-iteration events and durable checkpoints) and symfony_ai (wraps the vendor AgentProcessor). Agents, controls and input processors are plugin types; agents can also be ai_agent config entities. A control can pause a run for human approval and resume it in a later request.

Ships 6 controls (system_context, deny_tool, require_tool, force_arguments, require_approval, return_directly), Drush commands (agent:list|run|chat|runs|resume), and platform-layer streaming.

Meta issue: #3586513

Addresses

Issue
#3586501 Structured input definitions (Tool API input)
#3586504 Move the agent entity structure into the AI module
#3586505 Agent runner abstraction as plugins
#3586506 Drupal agent runner
#3586507 Symfony AI agent runner
#3586509 Shared runner event points
#3586510 Control-mechanism plugin system for runners

Changes outside the submodule

Three parent-module fixes the agent loop depends on:

  • ToolsPropertyInput emitted required as a boolean inside a property. JSON Schema declares required names as a list on the parent object, and a strict provider rejects the request outright (Ollama answers cannot unmarshal bool into ... properties.required of type []string, and no tool call is attempted).
  • ToolsFunctionOutput::$name was uninitialised, so the object threw the first time anything read it.
  • OpenAiBasedProviderClientBase dropped the name when a model called a function that was never offered, producing an unreportable tool call.

Checklist

  • I have linked the related issue in the MR title or description
  • I have performed a self-review of my own code
  • I have added or updated tests, or explained in the description why this change is not covered by tests
  • I have updated documentation for any new or changed functionality
  • I have written testing instructions and verified them locally
  • I have noted any required post-merge steps (config imports, cache rebuilds, manual changes)
  • This MR contains no breaking API or hook changes, or they are explicitly documented in the description

AI Compliance

Note

Check the one that best describes your usage, or leave all unchecked if AI was not significantly used.

  • AI Assisted Code
    Mainly written by a human; AI used for autocomplete or partial generation under full human supervision.

  • AI Generated Code
    Mainly generated by AI, reviewed and approved by a human before this MR was created.

  • Vibe Coded
    Generated by AI and only functionally reviewed before this MR was created.

Edited by harivansh sharma

Merge request reports

Loading