Repository navigation
feat(comment-automation): moderate comments with an ai router (jev) connection - #1745
Merged
Merged
Conversation
…onnection AI moderation can now run on an AI Router (Decision) connection such as Jev instead of an AI agent's model. `hideComments.aiModeration.engine` picks `aiAgent` (default, and what every stored row reads as) or `decision`, with `decisionConnectionId`, `decisionModel` and `decisionThreshold` (0.5-0.99, default 0.7). The decision engine asks one yes/no question per selected category and flags those whose probability reaches the threshold. Failures and missing or disabled connections fail open, like the agent path. Writes check that the connection belongs to the workspace, is enabled and lists the model; a template install switches it off and clears the connection with a credentialRequired warning. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Keep the connection picker rendered when none is enabled so the required error shows on save instead of failing silently. - Cap AI Router guidance at 500 characters in the schema and stop truncating it, so every question carries the full guidance. - Align the threshold range to 0.5–0.95 across schema, docs and slider. - Do not mark the form dirty when a stale model is swapped on load. - Document the decision engine fields in the CLI README and schema. - Share one usable-connection check between classify and the write check. - Move the enabled-connections picker endpoint to decision-connections (decisionConnectionsAPI.listEnabled), reading through the existing query. Co-Authored-By: Claude Opus 5.5 <[email protected]>
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
…onnection (#1745) * feat(comment-automation): moderate comments with an ai router (jev) connection AI moderation can now run on an AI Router (Decision) connection such as Jev instead of an AI agent's model. `hideComments.aiModeration.engine` picks `aiAgent` (default, and what every stored row reads as) or `decision`, with `decisionConnectionId`, `decisionModel` and `decisionThreshold` (0.5-0.99, default 0.7). The decision engine asks one yes/no question per selected category and flags those whose probability reaches the threshold. Failures and missing or disabled connections fail open, like the agent path. Writes check that the connection belongs to the workspace, is enabled and lists the model; a template install switches it off and clears the connection with a credentialRequired warning. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(comment-automation): address ai router moderation review findings - Keep the connection picker rendered when none is enabled so the required error shows on save instead of failing silently. - Cap AI Router guidance at 500 characters in the schema and stop truncating it, so every question carries the full guidance. - Align the threshold range to 0.5–0.95 across schema, docs and slider. - Do not mark the form dirty when a stale model is swapped on load. - Document the decision engine fields in the CLI README and schema. - Share one usable-connection check between classify and the write check. - Move the enabled-connections picker endpoint to decision-connections (decisionConnectionsAPI.listEnabled), reading through the existing query. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Deathgiver <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AI moderation on comment automations (Facebook, Instagram, Threads, TikTok) can now classify comments with an AI Router connection (Decision, e.g. Jev) instead of an AI agent's model. Categories, extra guidance, hide/delete and the moderation log work the same for both.
hideComments.aiModeration.engine:aiAgentordecision. If it is absent, the setting is treated asaiAgent, so every stored automation keeps working unchanged. The setting lives in a JSON column, so there is no migration.decisionengine usesdecisionConnectionId,decisionModel(one of the connection'smodelCatalog) anddecisionThreshold(0.5–0.99, default 0.7).noul) question keyed by the category name. A category is blocked when its probability is at or above the threshold. The comment is sent instate.currentMessageand marked as untrusted data, never as an instruction.reasonreads likeAI Router jev-1.13.0: hate 92%, offensive 12%,provideris the connection'sproviderKindandmodelIdis the model.aiAgentkey is unchanged, so verdicts cached across the deploy stay valid.decisionengine is switched off, the connection is cleared, and the installer gets acredentialRequiredwarning.decisionConnections.listalready exists. The builder gets a privatedecisionProfiles.listModerationConnections(enabled connections only, without credentials) for the form.docs/comment-automation.mdand trap 23 of the comment-automation skill are updated.Possibly an existing gap, not changed here: a template install copies
aiModeration.aiAgentIdas-is, so the installed automation points at the source workspace's agent. At runtime the lookup is scoped by workspace, so the agent is not found and moderation is skipped (no data leaks).Test plan
pnpm lintcheck-typesfor database, business, worker and builder (the pre-commit hook also ran it across 25 packages)@chatbotx.io/businesssuite (10,088 passed) andworkersuite (5,244 passed)public-spec-operations,public-spec-mcp,api-parity-manifest,edge-instrumentation-graph, plus comment/moderation/decision testsaiAgent;decisionrequires a connection and model; threshold boundsfailed/unavailable; cache keys differ by engine, model and thresholdinvariant-guardagent: no violations🤖 Generated with Claude Code