fix(copilot-cleanup): support azure blob upload in copilot, remove dead code & consolidate other copilot files#1147
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR implements Azure Blob Storage support for the copilot feature while consolidating and cleaning up copilot-related files. The changes introduce a storage-agnostic architecture that supports both S3 and Azure Blob Storage through a unified interface.
Key Changes:
Storage Layer Modernization: The PR updates file attachment schemas from S3-specific s3_key fields to generic key fields across multiple interfaces (MessageFileAttachment, FileAttachment). This change enables the same data structures to work with both S3 and Azure Blob Storage providers.
Unified Storage Client: The storage client abstraction layer is enhanced with custom configuration support, allowing different parts of the application to use different storage providers or configurations. The copilot feature can now leverage Azure Blob Storage through custom configurations while maintaining backward compatibility with S3.
Component Consolidation: Major refactoring extracts inline components from the 620-line copilot-message.tsx file into separate, reusable modules (FileAttachmentDisplay, SmoothStreamingText, StreamingIndicator, ThinkingBlock, WordWrap). This improves maintainability and follows single responsibility principles.
Import Optimization: Multiple files consolidate UI component imports from individual files to barrel exports (@/components/ui), reducing import verbosity and improving code organization.
Chat Title Generation: The generate-chat-title module is enhanced to support both Azure OpenAI and regular OpenAI providers, with environment-based provider selection and improved model configuration (upgraded from GPT-3.5-turbo to GPT-4o, temperature reduced to 0.2).
File Utilities Migration: File handling utilities are moved from copilot-specific locations to a central lib/uploads/file-utils.ts location, making them reusable across the application and removing Anthropic-specific naming conventions.
Dead Code Removal: Extensive logging cleanup removes verbose debug statements from provider execution, agent handlers, and configuration loading while preserving essential error logging.
The changes integrate with the existing workflow execution system, maintaining all current functionality while adding multi-cloud storage capabilities. The architecture now supports provider-agnostic file handling through standardized interfaces and abstraction layers.
Confidence score: 3/5
- This PR introduces significant architectural changes with potential compatibility risks due to field name changes and default service URL modifications
- Score reflects concerns about breaking changes (s3_key to key transitions), unsafe type assertions in storage client, and critical default URL change to staging environment
- Pay close attention to storage-client.ts for type assertion safety, constants.ts for production impact, and all file attachment interfaces for compatibility
23 files reviewed, 7 comments
...]/components/panel/components/copilot/components/copilot-message/components/file-display.tsx
Outdated
Show resolved
Hide resolved
...]/components/panel/components/copilot/components/copilot-message/components/file-display.tsx
Outdated
Show resolved
Hide resolved
...]/components/panel/components/copilot/components/copilot-message/components/file-display.tsx
Outdated
Show resolved
Hide resolved
...]/components/panel/components/copilot/components/copilot-message/components/file-display.tsx
Show resolved
Hide resolved
...rkflowId]/components/panel/components/copilot/components/copilot-message/copilot-message.tsx
Show resolved
Hide resolved
…ad code & consolidate other copilot files (#1147) * cleanup * support azure blob image upload * imports cleanup * PR comments * ack PR comments * fix key validation
…is for queueing docs in kb (#1143) * improvement(kb): created knowledge, chunks, tags services and use redis for queueing docs in kb * moved directories around * cleanup * bulk create docuemnt records after upload is completed * fix(copilot): send api key to sim agent (#1142) * Fix api key auth * Lint * ack PR comments * added sort by functionality for headers in kb table * updated * test fallback from redis, fix styling * cleanup copilot, fixed tooltips * feat: local auto layout (#1144) * feat: added llms.txt and robots.txt (#1145) * fix(condition-block): edges not following blocks, duplicate issues (#1146) * fix(condition-block): edges not following blocks, duplicate issues * add subblock update to setActiveWorkflow * Update apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/condition-input.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix dependency array * fix(copilot-cleanup): support azure blob upload in copilot, remove dead code & consolidate other copilot files (#1147) * cleanup * support azure blob image upload * imports cleanup * PR comments * ack PR comments * fix key validation * improvement(forwarding+excel): added forwarding and improve excel read (#1136) * added forwarding for outlook * lint * improved excel sheet read * addressed greptile * fixed bodytext getting truncated * fixed any type * added html func --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> * revert agent const * update docs --------- Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
…ad code & consolidate other copilot files (simstudioai#1147) * cleanup * support azure blob image upload * imports cleanup * PR comments * ack PR comments * fix key validation
…is for queueing docs in kb (simstudioai#1143) * improvement(kb): created knowledge, chunks, tags services and use redis for queueing docs in kb * moved directories around * cleanup * bulk create docuemnt records after upload is completed * fix(copilot): send api key to sim agent (simstudioai#1142) * Fix api key auth * Lint * ack PR comments * added sort by functionality for headers in kb table * updated * test fallback from redis, fix styling * cleanup copilot, fixed tooltips * feat: local auto layout (simstudioai#1144) * feat: added llms.txt and robots.txt (simstudioai#1145) * fix(condition-block): edges not following blocks, duplicate issues (simstudioai#1146) * fix(condition-block): edges not following blocks, duplicate issues * add subblock update to setActiveWorkflow * Update apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/workflow-block/components/sub-block/components/condition-input.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix dependency array * fix(copilot-cleanup): support azure blob upload in copilot, remove dead code & consolidate other copilot files (simstudioai#1147) * cleanup * support azure blob image upload * imports cleanup * PR comments * ack PR comments * fix key validation * improvement(forwarding+excel): added forwarding and improve excel read (simstudioai#1136) * added forwarding for outlook * lint * improved excel sheet read * addressed greptile * fixed bodytext getting truncated * fixed any type * added html func --------- Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net> * revert agent const * update docs --------- Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai> Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com> Co-authored-by: Adam Gough <adamgough@Mac.attlocal.net>
Summary
support azure blob upload in copilot, remove dead code & consolidate other copilot files, use azure openai to generate chat title.
Type of Change
Testing
Tested manually.
Checklist