Pi: You are a senior software engineer working in the Sim codebase (sims... - #6018
Hidden character warning
Pi: You are a senior software engineer working in the Sim codebase (sims...#6018BillLeoutsakosvl346 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 0e77e00. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryScopes Copilot composer drafts per workflow in the editor panel.
Confidence Score: 5/5Safe to merge; the change only wires a correct per-workflow draft scope key into the existing draft store path. draftScopeKey is a plain string key for the mothership drafts Zustand/localStorage map; including workspaceId, a copilot namespace, and workflowId isolates panel drafts from home chat keys and across workflows without changing auth or server contracts.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsx | Adds workflow-scoped mothership draft key wiring for panel Copilot; matches existing draftScopeKey consumer contract and home’s workspace-prefixed key style with a copilot namespace. |
Reviews (1): Last reviewed commit: "Pi: You are a senior software engineer w..." | Re-trigger Greptile
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0e77e00. Configure here.
| onCancelQueueEdit={copilotCancelQueueEdit} | ||
| userId={session?.user?.id} | ||
| chatId={copilotResolvedChatId} | ||
| draftScopeKey={copilotDraftScopeKey} |
There was a problem hiding this comment.
Stale draft on workflow change
Medium Severity
When navigating between workflows, the MothershipChat component remains mounted, preventing UserInput from re-initializing its draft state. Although the draftScopeKey updates, UserInput continues to display the previous workflow's draft, and autosaves overwrite the new workflow's draft with the old text.
Reviewed by Cursor Bugbot for commit 0e77e00. Configure here.
| const params = useParams() | ||
| const workspaceId = params.workspaceId as string | ||
| const workflowId = params.workflowId as string | ||
| const copilotDraftScopeKey = `${workspaceId}:copilot:${workflowId}` |
There was a problem hiding this comment.
URL id mismatches active workflow
Medium Severity
The copilotDraftScopeKey is built from params.workflowId, but the Copilot chat session and related hooks rely on activeWorkflowId from the workflow registry. This mismatch can cause drafts to be scoped to a different workflow than the active Copilot session, particularly during navigation or hydration.
Reviewed by Cursor Bugbot for commit 0e77e00. Configure here.


Task
You are a senior software engineer working in the Sim codebase (simstudioai/sim) — an agent-builder / workflow-automation platform where users compose workflows from blocks (triggers, agent/LLM blocks, functions, integrations) and deploy them as APIs, chat, or MCP tools (primarily TypeScript). You already opened a pull request for this task and reviewers have given feedback.
THE ORIGINAL TASK (from #eng-todo):
<@U0BLD9VE2P4> do this
You are working on the EXISTING branch ""pi/oI1D29Gs"" of simstudioai/sim. Push commits to that same branch and its existing pull request — do NOT open a new PR.
CODE-REVIEW FEEDBACK TO ADDRESS THIS ROUND:
No branch changes can be prescribed yet because the current PR diff and both reviewer reports were not included. Provide Reviewer A’s feedback, Reviewer B’s feedback, and preferably the PR diff or commit summary.
HOW TO WORK: Read the relevant code first so your changes fit existing patterns. Address the feedback, keeping changes SIMPLE and minimal — do not over-engineer or add defensive code for unlikely scenarios. Rely on CI as the test gate: after you push commits, GitHub Actions CI will run the tests on the PR. Do NOT try to run the full test suite locally — the sandbox may lack the toolchain (bun/Biome/TypeScript).
Summary
Implemented the missing workflow-scoped Copilot draft persistence in:
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/panel.tsxChanges:
workflowIdfrom route params.${workspaceId}:copilot:${workflowId}as the draft scope.MothershipChatviadraftScopeKey.No reviewer reports were available beyond the note that they were missing. Tests were not run per sandbox guidance.