feat: add experimental global AI assistant option#4567
Open
feat: add experimental global AI assistant option#4567
Conversation
54a117e to
cda4590
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4567 +/- ##
==========================================
+ Coverage 89.51% 89.57% +0.06%
==========================================
Files 441 441
Lines 21205 21257 +52
==========================================
+ Hits 18982 19042 +60
+ Misses 2223 2215 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8185c5e to
5b5dbda
Compare
- Add global_chat_stream/2 to ApolloClient for /services/global_chat/stream - Add global_chat?/1 and process_global_message/2 to MessageProcessor - Route to global_chat when use_global_assistant is in session meta - Pass use_global_assistant and page through channel message_options - Add experimental_features_enabled to workflow channel get_context
- Add query_global_stream/3 using process_stream with build_global_message - build_global_message extracts code from attachments (job_code or workflow_yaml) - Context-aware: on job step prefers job_code, on overview prefers workflow_yaml - Resolves job_id from job_key in attachment by matching against workflow jobs
- Add experimental_features_enabled to SessionContextResponseSchema - Map to experimentalFeaturesEnabled in SessionContextStore - Add useExperimentalFeaturesEnabled hook - Add use_global_assistant and page to MessageOptions type
- Add Global assistant (experimental) checkbox to ChatInput with localStorage persistence and onGlobalAssistantChange callback - Pass use_global_assistant and page through AIChannelRegistry buildJoinParams - Wire checkbox through AIAssistantPanel with showGlobalAssistantOption, isGlobalAssistantActive, and onGlobalAssistantChange props - AIAssistantPanelWrapper includes workflow YAML and page when global assistant is active, derives page from workflow/job context - Badge shows "Global (experimental)" in amber when active
The Zod schema adds a default value for the new optional field, so the parsed output includes it. Update the test fixture to match.
Split build_global_message into smaller functions to satisfy credo's complexity threshold.
- ApolloClient: global_chat_stream payload, nil filtering, error handling - AiAssistant: query_global_stream SSE processing, job_code vs workflow_yaml extraction, job resolution from job_key, error handling - MessageProcessor: global_chat routing when use_global_assistant is set - AiAssistantChannel: session options and message options with global assistant - WorkflowChannel: experimental_features_enabled in get_context
Cover workflow_yaml fallback on overview pages, nil job_key handling in resolve_job_from_key, and non-list attachments.
5b5dbda to
8a8e32f
Compare
|
@elias-ba When I try a conversational turn with no YAML generation in the workflow chat (no experimental features turned on) I get some errors: Sometimes the streamed answer disappears and it seems to regenerate a new answer, which in this case was malformed:
I'm not sure why at this stage, but I'll continue testing. |
|
@elias-ba When I try a conversational turn in the global chat (experimental features turned on), I get an error similarly:
|
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.



Description
Adds an opt-in checkbox to the AI Assistant UI that routes messages to Apollo's global chat endpoint instead of the separate job_chat/workflow_chat endpoints. The global chat unifies both behind a router that intelligently decides how to handle each request.
Gated behind the existing experimental features preference - only users who have enabled experimental features in their profile see the checkbox.
Closes #4532
Validation steps
Additional notes for the reviewer
AI Usage
Pre-submission checklist
/reviewwith Claude Code):owner,:admin,:editor,:viewer)