Skip to content

Pi: You are a senior software engineer working in the Sim codebase (sims... - #6018

Closed
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
"pi/oI1D29Gs"

Hidden character warning

The head ref may contain hidden characters: ""pi/oI1D29Gs""
Closed

Pi: You are a senior software engineer working in the Sim codebase (sims...#6018
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
"pi/oI1D29Gs"

Conversation

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor

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.tsx

Changes:

  • Read workflowId from route params.
  • Created ${workspaceId}:copilot:${workflowId} as the draft scope.
  • Passed it to MothershipChat via draftScopeKey.

No reviewer reports were available beyond the note that they were missing. Tests were not run per sandbox guidance.

@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 28, 2026 8:46pm

Request Review

@cursor

cursor Bot commented Jul 28, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Small UI wiring change for local draft scoping with no auth, API, or data-model impact.

Overview
The workflow panel Copilot tab now passes a workflow-scoped draftScopeKey into MothershipChat, so unsent composer text is stored separately per workflow instead of sharing one draft across the workspace.

Panel reads workflowId from the route and builds ${workspaceId}:copilot:${workflowId} before forwarding it to the existing draft plumbing on UserInput.

Reviewed by Cursor Bugbot for commit 0e77e00. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Scopes Copilot composer drafts per workflow in the editor panel.

  • Reads workflowId from route params next to existing workspaceId.
  • Builds draftScopeKey as ${workspaceId}:copilot:${workflowId}.
  • Passes draftScopeKey into panel MothershipChat so drafts persist per workflow instead of a shared undefined key.

Confidence Score: 5/5

Safe 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.

Important Files Changed

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ 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}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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}`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0e77e00. Configure here.

@BillLeoutsakosvl346
BillLeoutsakosvl346 deleted the "pi/oI1D29Gs" branch July 28, 2026 21:40
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