Skip to content

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Jan 8, 2026

Summary

Adds subagents to the copilot.
Also adds components to see copilot plan, edit diffs in chat, and options.
Adds nicer thinking text
Makes diff view accept/reject optimistic
Fixes chat load on refresh

Type of Change

  • New feature
  • Bug fix

Testing

Manual with @emir-karabeg

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

icecrasher321 and others added 21 commits December 18, 2025 16:23
The realtime service network policy was missing the custom egress rules section
that allows configuration of additional egress rules via values.yaml. This caused
the realtime pods to be unable to connect to external databases (e.g., PostgreSQL
on port 5432) when using external database configurations.

The app network policy already had this section, but the realtime network policy
was missing it, creating an inconsistency and preventing the realtime service
from accessing external databases configured via networkPolicy.egress values.

This fix adds the same custom egress rules template section to the realtime
network policy, matching the app network policy behavior and allowing users to
configure database connectivity via values.yaml.
…ext menu (#2672)

* feat(logs-context-menu): consolidated logs utils and types, added logs record context menu (#2659)

* feat(email): welcome email; improvement(emails): ui/ux (#2658)

* feat(email): welcome email; improvement(emails): ui/ux

* improvement(emails): links, accounts, preview

* refactor(emails): file structure and wrapper components

* added envvar for personal emails sent, added isHosted gate

* fixed failing tests, added env mock

* fix: removed comment

---------

Co-authored-by: waleed <walif6@gmail.com>

* fix(logging): hitl + trigger dev crash protection (#2664)

* hitl gaps

* deal with trigger worker crashes

* cleanup import strcuture

* feat(imap): added support for imap trigger (#2663)

* feat(tools): added support for imap trigger

* feat(imap): added parity, tested

* ack PR comments

* final cleanup

* feat(i18n): update translations (#2665)

Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>

* fix(grain): updated grain trigger to auto-establish trigger (#2666)

Co-authored-by: aadamgough <adam@sim.ai>

* feat(admin): routes to manage deployments (#2667)

* feat(admin): routes to manage deployments

* fix naming fo deployed by

* feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date (#2668)

* feat(time-picker): added timepicker emcn component, added to playground, added searchable prop for dropdown, added more timezones for schedule, updated license and notice date

* removed unused params, cleaned up redundant utils

* improvement(invite): aligned styling (#2669)

* improvement(invite): aligned with rest of app

* fix(invite): error handling

* fix: addressed comments

---------

Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com>
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: waleedlatif1 <waleedlatif1@users.noreply.github.com>
Co-authored-by: Adam Gough <77861281+aadamgough@users.noreply.github.com>
Co-authored-by: aadamgough <adam@sim.ai>
…ion, autoconnect improvements, billing fixes
@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 10, 2026 7:32pm

@Sg312 Sg312 changed the title Feat/copilot subagents feat(copilot): subagents Jan 8, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

Implemented comprehensive subagent architecture for the Copilot feature, enabling nested agent execution with streaming content and tool calls displayed within parent tool calls.

Key Changes

  • Subagent Streaming Infrastructure: Added complete SSE handling for subagent events (subagent_start, subagent_end, and subagent-scoped content/tool_call/tool_result events) in the Copilot store
  • New Subagent Tools: Created 12 new auto-executing client tools (debug, plan, edit, test, research, auth, deploy, knowledge, custom_tool, tour, info, workflow) that spawn server-side subagents
  • UI Components: Enhanced tool-call component with nested subagent content rendering including thinking blocks, tool calls, plan steps, and interactive option selectors with keyboard navigation
  • Message Queue: Implemented Cursor-style message queuing that allows users to queue messages while another is streaming, with send now/remove controls
  • Trigger Mode Support: Extended get_block_config tool to support trigger mode configuration retrieval for blocks with trigger capabilities
  • Context Usage Removal: Removed deprecated context-usage feature and related components/API endpoints
  • Manage Custom Tool Enhancement: Added list operation to manage_custom_tool and improved conditional interrupt handling

Architecture

The subagent system works through a parent-child relationship where specialized tools like debug or plan spawn server-side subagents that stream their reasoning and tool calls back to the client. These are displayed as nested, collapsible content within the parent tool call, providing transparency into the subagent's work.

Testing Focus

  • Verify subagent streaming works correctly for all 12 new tools
  • Test message queuing with multiple queued messages
  • Validate nested tool call execution and state management
  • Check trigger mode configuration retrieval for trigger-enabled blocks
  • Test option selector keyboard navigation (arrow keys, enter) on the last message only

Confidence Score: 4/5

  • Safe to merge with careful testing - comprehensive feature implementation with well-structured code
  • Large PR with significant architectural changes (+2552/-664 lines). The subagent streaming logic is complex but well-structured with proper error handling and logging. Code follows project patterns and TypeScript conventions. Main concerns are the complexity of the streaming state management and the need for thorough testing of edge cases in nested subagent execution. No critical bugs found, but the scale and complexity warrant extensive QA.
  • Pay close attention to apps/sim/stores/panel/copilot/store.ts - complex streaming logic with subagent state management needs thorough testing

Important Files Changed

File Analysis

Filename Score Overview
apps/sim/stores/panel/copilot/types.ts 5/5 Added subagent type definitions including SubAgentContentBlock, subagent properties on CopilotToolCall, and QueuedMessage interface for message queuing feature
apps/sim/stores/panel/copilot/store.ts 4/5 Implemented comprehensive subagent streaming logic with SSE handlers, added message queue functionality, removed context-usage feature, added new tool instantiators for subagent tools
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/tool-call/tool-call.tsx 4/5 Added comprehensive subagent content rendering with PlanSteps, OptionsSelector, and SubAgentContent components for displaying nested tool calls and thinking blocks
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/queued-messages/queued-messages.tsx 5/5 New component implementing Cursor-style message queuing UI with expand/collapse, send now, and remove functionality
apps/sim/lib/copilot/tools/client/other/debug.ts 5/5 New subagent tool for debugging, auto-executes with server-side subagent handling nested content stream
apps/sim/lib/copilot/tools/server/blocks/get-block-config.ts 4/5 Implemented trigger mode support with trigger inputs/outputs extraction and validation, fixed option resolution to prefer id over label
apps/sim/lib/copilot/registry.ts 5/5 Extended schemas with trigger parameter for get_block_config and list operation for manage_custom_tool, added triggerMode to output schemas
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx 5/5 Added QueuedMessages component, removed context-usage functionality, enabled message submission during active streaming for queuing

Sequence Diagram

sequenceDiagram
    participant User
    participant UI as Copilot UI
    participant Store as CopilotStore
    participant API as Server API
    participant SubAgent as Subagent (debug/plan/edit/etc)

    User->>UI: Sends message
    UI->>Store: sendMessage()
    Store->>API: POST /api/copilot/chat (stream)
    
    Note over API,SubAgent: Main agent processes request
    API-->>Store: SSE: content (main agent text)
    Store-->>UI: Update message content
    
    API-->>Store: SSE: tool_call (e.g., debug tool)
    Store->>Store: Create tool call with pending state
    Store->>Store: Execute client tool (debug.execute())
    Store-->>UI: Show tool call in UI
    
    Note over API,SubAgent: Server invokes subagent
    API-->>Store: SSE: subagent_start {tool_call_id}
    Store->>Store: Set subAgentParentToolCallId
    Store->>Store: Mark parent tool as subAgentStreaming=true
    
    loop Subagent streaming
        API-->>Store: SSE: {subagent: "debug", type: "content"}
        Store->>Store: Append to subAgentContent[toolCallId]
        Store->>Store: Update subAgentBlocks with text block
        Store-->>UI: Update nested content in tool call
        
        API-->>Store: SSE: {subagent: "debug", type: "tool_call"}
        Store->>Store: Add to subAgentToolCalls[toolCallId]
        Store->>Store: Update subAgentBlocks with tool block
        Store->>Store: Execute nested tool if no interrupt
        Store-->>UI: Show nested tool in subagent section
        
        API-->>Store: SSE: {subagent: "debug", type: "tool_result"}
        Store->>Store: Update nested tool state to success/error
        Store-->>UI: Update nested tool status
    end
    
    API-->>Store: SSE: subagent_end
    Store->>Store: Set subAgentStreaming=false
    Store->>Store: Clear subAgentParentToolCallId
    Store-->>UI: Finalize subagent display
    
    API-->>Store: SSE: tool_result {toolCallId, success}
    Store->>Store: Update parent tool state to success
    Store-->>UI: Show parent tool completed
    
    API-->>Store: SSE: done
    Store->>Store: Complete streaming
    Store-->>UI: Enable input
Loading

@Sg312 Sg312 merged commit 283a521 into staging Jan 10, 2026
10 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/copilot-subagents branch January 12, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants