Google Meet: add a call summarizer agent and a summary job for a call recording

Merged
EH
15h ago
+469-1

Context

First of three PRs that split https://github.com/twentyhq/twenty/pull/30645 (AI summaries for Google Meet calls without Gemini notes) into smaller changes. Follows https://github.com/twentyhq/twenty/pull/30632.

This PR adds what writes a summary, but nothing calls it yet, so imports behave as before.

What this PR does

  • Adds the google-meet-call-summarizer agent, with Call Recorder's summary prompt (Gist, Overview, Action Items, Notes, Keywords) and its guard: a transcript too thin to summarize gets a short "Summary unavailable" note instead of invented content.
  • Adds the google-meet-summarize-call-recording job for one Call Recording. It skips a recording that already has a summary, builds the prompt from the stored transcript, runs the agent and saves the answer only while the summary is still empty, so Gemini notes saved in the meantime are kept. A failed agent run raises RetryableLogicFunctionError, so the job is retried.
  • Adds the AI permission flag to the app's default role.

Checks

  • yarn lint, yarn typecheck, twenty app build, oxfmt --check and yarn test:unit (171 tests) pass locally. New pure tests cover the prompt built from a transcript and the parsing of the agent's reply.
  • Tested on a self-hosted Twenty as part of #30645: the job ran the agent on a real call's transcript and saved its answer 14 seconds after the import.

Stack

  1. This PR
  2. https://github.com/twentyhq/twenty/pull/30655
  3. https://github.com/twentyhq/twenty/pull/30656