Repository navigation
fix(sales-assist): resolve AI Assist agent from params, company setting, then fallback - #11342
Merged
Merged
Conversation
…ng, then fallback Move the enabled check and agent resolution into CreateAIAssistChannelAction::ifEnabled so the pull action and the social channel activity share one implementation. Fixes the undefined $params / $this->agentId references and adds the ai_assist_agent company setting to the Intelligence ConfigurationEnum.
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
The AI Assist channel created after a SalesAssist lead pull (and now also from the
SalesAssist Create Contact Channelworkflow activity) resolves its agent with this precedence:ai_assist_agent_idworkflow paramai_assist_agentsetting (newConfigurationEnum::AI_ASSIST_AGENT_ID)agent_idthe step already runs withThe enabled check plus this resolution now live in one place,
CreateAIAssistChannelAction::ifEnabled(), which returnsnullwhen AI Assist is off so callers just?->execute().Fixes along the way
CreateSocialChannelsAfterPullActionread an undefined$params(should be$this->params), so the param override never applied.CreateSocialChannelActivityread$this->agentId, which does not exist on the activity. With no company setting this passednullto anintand threw aTypeError.intbefore reaching the action.'ai_assist_agent'key moved intoKanvas\Intelligence\Enums\ConfigurationEnum.Tests
CreateAIAssistChannelActionTest::testIfEnabledReturnsNullWhenAiAssistIsOffCreateAIAssistChannelActionTest::testIfEnabledResolvesAgentByPrecedencePullLeadActivityReynoldsResolvedLeadTestcovers the activity path.PHPStan (level 0) clean on
src/Domains/Connectors/SalesAssistandsrc/Domains/Intelligence/Enums. php-cs-fixer clean on every touched file.