Canvas AI: Allow "verbose_context_for_orchestrator" to be passed in user input
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3582390. --> Reported by: [akhil babu](https://www.drupal.org/user/3632866) Related to !957 >>> <h3 id="overview">Overview</h3> <p><code>CanvasAiPageBuilderHelper::generateVerboseContextForOrchestrator()</code> generates a message for the orchestrator agent by combining the current entity type (Canvas page), page title, and page description. This is currently added to the orchestrator agent as a token in its system prompt. Instead, it should be passed through the user input</p> <h3 id="proposed-resolution">Proposed resolution</h3> <ul> <li>Remove the [canvas_ai:verbose_context_for_orchestrator] token</li> <li>Get the user input and output of <code>CanvasAiPageBuilderHelper::generateVerboseContextForOrchestrator</code> and construct a single message in the format</li> </ul><pre>&lt;system_context&gt;<br>&nbsp; {context_data}<br>&nbsp; &lt;/system_context&gt;<br>&nbsp; &lt;user_input&gt;<br>&nbsp; {user_input}<br>&nbsp; &lt;/user_input&gt;</pre> <ul> <li>Set that as input to the orchestrator agent</li> <li>Generate comprehensive tests to validate that the orchestrator calls the correct sub agent depending on the task</li> </ul> <h3 id="ui-changes">User interface changes</h3> > Related issue: [Issue #3579471](https://www.drupal.org/node/3579471)
issue