Skip to content

improvement(copilot): incremental edits#891

Merged
Sg312 merged 6 commits intostagingfrom
copilot/diff-controls
Aug 7, 2025
Merged

improvement(copilot): incremental edits#891
Sg312 merged 6 commits intostagingfrom
copilot/diff-controls

Conversation

@Sg312
Copy link
Contributor

@Sg312 Sg312 commented Aug 7, 2025

Summary

Adds incremental edits to copilot functionality

Type of Change

  • New feature

Testing

Manual testing

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)

@vercel
Copy link

vercel bot commented Aug 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sim ❌ Failed (Inspect) Aug 7, 2025 0:13am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Aug 7, 2025 0:13am

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 implements incremental edits functionality for the copilot system, enabling the AI agent to make targeted workflow modifications rather than wholesale replacements. The changes establish a comprehensive client-server communication pattern where workflow state flows from the frontend stores through a new client-side tool (GetUserWorkflowTool) to server-side processing tools.

The implementation introduces several key architectural changes: a new client-side tool that extracts workflow state from multiple Zustand stores (diff, workflow, registry) with proper fallback logic, enhanced server-side tools that can accept current workflow state as parameters to avoid database fetches, and an extended interrupt handler mechanism that passes structured data (fullData) alongside status messages for richer tool communication.

The diff API endpoints receive defensive programming improvements to handle optional loops and parallels properties consistently, while the workflow diff store adds state clearing functionality to prevent interference between successive edit operations. The copilot store gains auto-execution capabilities for client tools and simplified diff merge strategies that prioritize showing complete proposed changes over cumulative merges.

These changes integrate with the existing ReactFlow-based workflow editor and Zustand state management system, extending the copilot's ability to understand and modify workflow structures while maintaining backward compatibility with existing functionality.

Confidence score: 3/5

  • This PR introduces complex architectural changes with potential reliability and consistency issues that require careful review
  • Score reflects concerns about race conditions in auto-execution, code duplication, potential memory leaks, and untested error handling paths
  • Pay close attention to stores/copilot/store.ts, lib/copilot/tools/server-tools/workflow/edit-workflow.ts, and the new client tool implementation

9 files reviewed, 6 comments

Edit Code Review Bot Settings | Greptile

@vercel vercel bot temporarily deployed to Preview – docs August 7, 2025 00:07 Inactive
@vercel vercel bot temporarily deployed to Preview – docs August 7, 2025 00:09 Inactive
@Sg312 Sg312 merged commit f94258e into staging Aug 7, 2025
4 of 5 checks passed
waleedlatif1 pushed a commit that referenced this pull request Aug 7, 2025
* v1

* Incremental edits

* Lint

* Remove dev env

* Fix tests

* Lint
@waleedlatif1 waleedlatif1 deleted the copilot/diff-controls branch August 8, 2025 07:34
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
* v1

* Incremental edits

* Lint

* Remove dev env

* Fix tests

* Lint
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.

1 participant