Skip to content

plugin-flow-builder: move contentFilter from action to each content#3209

Merged
Iru89 merged 5 commits intomasterfrom
unify-filters-tracking-and-ai-agent-response
May 7, 2026
Merged

plugin-flow-builder: move contentFilter from action to each content#3209
Iru89 merged 5 commits intomasterfrom
unify-filters-tracking-and-ai-agent-response

Conversation

@Iru89
Copy link
Copy Markdown
Contributor

@Iru89 Iru89 commented May 6, 2026

Description

This PR moves Flow Builder content filtering from the action-level content list into each content field processing lifecycle. It also ensures AI agent responses are filtered after the response is resolved and before their messages are converted into Botonic JSX elements.

Context

Flow Builder content filters were previously applied once in FlowBuilderAction before processing the full list of contents. That made AI agent responses harder to align with the rest of the content lifecycle because their generated messages were converted to JSX during response resolution, before the content processing step could apply filters consistently.

Approach taken / Explain the design

  • Added ContentFieldsBase.filterContent, which retrieves the Flow Builder plugin content filters and runs them through ContentFilterExecutor for a single FlowContent instance.
  • Removed the global filterContents helper and its usage from FlowBuilderAction, so content processing owns when filtering happens.
  • Applied filterContent inside each content field processContent implementation before tracking, handoff, bot actions, or rendering-related work.
  • Updated FlowAiAgent so response resolution only stores the AI agent messages, then processContent filters the content and converts the final messages to Botonic JSX elements.

Testing

The pull request...

  • doesn't need tests because this change refactors when existing content filters are executed without changing the filter API or adding new user-facing behavior.

@Iru89 Iru89 self-assigned this May 6, 2026
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@Iru89 Iru89 changed the title refactor: plugin-flow-builder: move contentFilter from action to each content May 6, 2026
@pepalonsocosta pepalonsocosta self-requested a review May 6, 2026 14:56
@pull-request-size pull-request-size Bot added size/L and removed size/M labels May 7, 2026
@Iru89 Iru89 merged commit eb1126a into master May 7, 2026
6 checks passed
@Iru89 Iru89 deleted the unify-filters-tracking-and-ai-agent-response branch May 7, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants