Files
twenty/packages/twenty-server
Félix MalfaitandClaude Opus 4.7 85effd6750 fix(billing): gate AI credit-cap at entry points instead of workflow executor
Restores the credit-cap enforcement that was lifted in #19904 (which had
correctly identified that gating per-workflow-step was too coarse), but
moves it to the AI entry points where the actual cost lives.

- agent-async-executor.service: gate executeAgent.
- ai-generate-text.controller: gate the REST handler.
- agent-title-generation.service: gate generateThreadTitle.
- workflow-executor.workspace-service: replace #19904's TODO with an
  absolute-behavior comment documenting why the gate is not here.

Chat resolver was already gated; no change there. Repair-tool-call util
is a sub-call inside an already-gated flow and is left ungated.

Net effect: a workspace that exhausts credits via chat or AI agent stops
making AI calls, but its non-AI workflows (DB CRUD, branching, action
steps) continue running normally.

Addresses the root cause of the 2026-04-26 token-usage incident.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-04-29 18:52:00 +02:00
..
2026-04-02 11:20:08 +00:00
2025-12-17 08:48:17 +01:00
2026-04-02 11:20:08 +00:00
2026-04-02 11:20:08 +00:00
2026-04-13 14:39:52 +00:00
2026-04-02 11:20:08 +00:00