Skip to content

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Jul 11, 2025

Description

Adds v1 of copilot chat to workflow. Adds internal tools for the copilot agent to access and call. DOES NOT EXPOSE COPILOT IN THIS PR

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • Documentation update

How Has This Been Tested?

Manual testing of copilot

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.

@vercel vercel bot temporarily deployed to Preview – docs July 22, 2025 19:05 Inactive
@vercel vercel bot temporarily deployed to Preview – docs July 22, 2025 19:22 Inactive
@Sg312 Sg312 marked this pull request as ready for review July 22, 2025 19:26
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 Summary

This PR introduces Copilot v1, a comprehensive AI-powered workflow assistant for Sim Studio. The implementation transforms the platform from a manual workflow builder into an intelligent system that can understand, analyze, and modify workflows through natural language interactions.

Core Architecture

The Copilot system operates in two distinct modes:

  • Ask Mode: Provides educational guidance and workflow analysis without editing capabilities
  • Agent Mode: Enables direct workflow editing with full AI assistance for building and modifying workflows

Key Components Added

Database Infrastructure: New tables for copilot_chats (conversation storage with JSONB messages) and copilot_checkpoints (workflow state versioning), enabling persistent conversations and rollback capabilities.

YAML Workflow System: Comprehensive YAML documentation and parsing utilities covering all block types (starter, agent, function, api, condition, router, evaluator, response, loop, parallel, webhook, workflow). This includes block reference syntax, connection configurations, and validation rules.

Tool Ecosystem: Four critical internal tools power the AI assistant:

  • get_blocks_and_tools: Discovery of available blocks and their capabilities
  • get_blocks_metadata: Detailed schema information for specific blocks
  • get_yaml_structure: Complete YAML syntax guide and best practices
  • edit_workflow: Direct workflow modification through YAML processing

Real-time Features: Enhanced socket server with copilot-workflow-edit and workflow-updated events for live collaboration when AI modifies workflows.

Professional UI: Complete redesign of the chat interface with tool call visualization, checkpoint management panels, mode switching, and streaming message support with inline tool execution feedback.

Auto-layout System: Intelligent workflow visualization with multiple algorithms (hierarchical, smart, force-directed, layered) that automatically arranges blocks based on complexity analysis.

Integration Points

The Copilot integrates deeply with existing workflow infrastructure through consolidated API endpoints (/api/workflows/{id}/yaml, /api/workflows/{id}/state) and extends all LLM providers (Anthropic, OpenAI, Azure, Groq, Cerebras, Deepseek, Ollama, xAI) to pass chatId context for checkpoint operations.

Provider Enhancements

Significant streaming improvements to the Anthropic provider add three execution modes: early streaming (no tools), incremental streaming with real-time tool call feedback (for copilot), and silent tool execution with final response streaming (for chat applications).

Confidence Score: 3/5

Moderate risk due to several implementation concerns and missing validations that could cause runtime issues
Major architectural changes with extensive new functionality increase complexity and potential failure points
Multiple files need attention including API endpoint mismatches, type safety issues, and validation schema problems

97 files reviewed, 58 comments

Edit Code Review Bot Settings | Greptile

@vercel vercel bot temporarily deployed to Preview – sim July 22, 2025 19:31 Inactive
@vercel vercel bot temporarily deployed to Preview – docs July 22, 2025 19:54 Inactive
@vercel vercel bot temporarily deployed to Preview – docs July 22, 2025 19:55 Inactive
@Sg312 Sg312 merged commit 5158a00 into staging Jul 22, 2025
6 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/copilot-v1 branch July 27, 2025 01:34
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
* Fix docs agent

* Doc agent fixes

* Refactor copilot

* Lint

* Update yaml editor

* Lint

* Fix block tool

* Lint

* Get block metadata tool

* Lint

* Yaml changes

* Lint

* Fixes?

* Lint

* Better yaml language

* Lint

* UPdate

* Lint

* Fix condition blocks

* lint

* Fix start block

* Fix starter block stuff

* Lint

* Fix yaml ui

* Lint

* get yaml tool

* Lint

* hi

* Lint

* Agnet

* Copilot UI

* Lint

* Better workflow builder

* Lint

* REHYDRATION

* Lint

* Auto layout

* Lint

* Fixes

* Lint

* Chatbar sizing

* Lint

* Initial chat fixes

* Lint

* Dropdown overflow

* Lint

* UI text

* Lint

* Sample question pills

* Lint

* Ui button

* Fix dropdown appearance

* Lint

* Modal fixes

* UI Updates

* Lint

* Initial ask vs agent mode

* Lint

* Ask vs agent

* Lint

* Ask udpate

* Ui fixes

* Lint

* User message width

* Chat leak fix

* Lint

* Agent ui

* Checkpointing

* Lint

* Checkpoints

* Lint

* Tweaks

* Sample questions

* Lint

* Modal full screen mode

* Lint

* Prompt updates

* Cleaning

* Lint

* Prompt update

* Streaming v1

* Lint

* Tool call inline

* Lint

* Checkpoint

* Lint

* Fix lint

* Sizing

* Lint

* Copilot ui tool call fixes

* Remove output from tool call ui

* Updates

* Lint

* Checkpoitn

* Loading icon

* Lint

* Pulse

* Lint

* Modal fixes

* Sidebar padding

* Checkpoint

* checkpoint

* feat(platform): new UI and templates (simstudioai#639) (simstudioai#693)

* improvement: control bar

* improvement: debug flow

* improvement: control bar hovers and skeleton loading

* improvement: completed control bar

* improvement: panel tab selector complete

* refactor: deleted notifications and history dropdown

* improvement: chat UI complete

* fix: tab change on control bar run

* improvement: finshed console (audio display not working)

* fix: text wrapping in console content

* improvement: audio UI

* improvement: image display

* feat: add input to console

* improvement: code input and showing input on errors

* feat: download chat and console

* improvement: expandable panel and console visibility

* improvement: empty state UI

* improvement: finished variables

* fix: image in console entry

* improvement: sidebar and templates ui

* feat: uploading and fetching templates

* improvement: sidebar and control bar

* improvement: templates

* feat: templates done

* fix(sockets): remove package-lock

* fix: sidebar scroll going over sidebar height (simstudioai#709)

* Checkpoint

* Fix build error

* Checkpoitn

* Docs updates

* Checkpoint

* Streaming vs non streaming

* Clean up yaml save

* Fix revert checkpoitn yaml

* Doc fixes

* Small docs fix

* Clean up old yaml docs

* Doc updates

* Hide copilot

* Revert width

* Db migration fixes

* Add snapshot

* Remove space from mdx

* Add spaces

* Lint

* Address greptile comments

* lint fix

* Hide copilot

---------

Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: Waleed Latif <walif6@gmail.com>
Co-authored-by: Emir Karabeg <78010029+emir-karabeg@users.noreply.github.com>
Co-authored-by: Siddharth Sim <sidstudio@SiddharthsMBP2.attlocal.net>
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.

5 participants