-
Notifications
You must be signed in to change notification settings - Fork 3.2k
improvement(copilot-context): structured context for copilot #1345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Summary
This PR restructures the copilot metadata system by introducing structured authentication modes and separating tool information from block data. The changes add an AuthMode enum with three values (OAuth, ApiKey, BotToken) and systematically update all block configurations to include explicit authMode properties. Additionally, many blocks now include triggerAllowed boolean flags to indicate trigger capabilities.
The architectural changes move from a single get-blocks-and-tools endpoint that returned both blocks and tools to a separated approach where get-blocks-and-tools provides lightweight block discovery and a new get-blocks-metadata endpoint delivers comprehensive metadata including properly nested tools and triggers. This establishes clear hierarchical relationships where tools and triggers are associated with their parent blocks rather than existing as disconnected arrays.
The metadata transformation includes filtering out UI-specific elements (blocks with hideFromToolbar: true, subBlock layout details, colors, icons) and removing redundant information. For example, blocks that previously mentioned "Requires API Key" in their descriptions now use the structured authMode: AuthMode.ApiKey property instead, eliminating duplicate information across text descriptions and configuration metadata.
Confidence score: 4/5
- This PR introduces significant architectural improvements with mostly safe metadata additions, though the large scope requires careful validation of all endpoint consumers
- Score reflects the comprehensive nature of changes across many files and the introduction of new data structures that could impact downstream systems
- Pay close attention to the
get-blocks-metadata-tool.tsfile which contains complex transformation logic and a potential syntax issue on lines 67-74
61 files reviewed, 4 comments
Summary
Streamlined Tool Separation: Removed tools from get-blocks-and-tools endpoint (now blocks only) and moved detailed tool information to get-blocks-metadata where it's properly associated with each block
Established Clear Data Relationships: Restructured metadata to use nested objects (tools: CopilotToolMetadata[], triggers: CopilotTriggerMetadata[]) instead of disconnected arrays, making relationships between blocks, tools, and triggers explicit
Reduced Context Overhead: Removed duplicate information (flattened trigger outputs, redundant toolDetails), excluded UI-specific subBlock details, and filtered out blocks with hideFromToolbar: true to minimize LLM context consumption
Type of Change
Testing
Manually with @Sg312
Checklist