Skip to content

chore(pi): organize mode implementations - #6362

Open
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
refactor/pi-mode-folders
Open

chore(pi): organize mode implementations#6362
BillLeoutsakosvl346 wants to merge 1 commit into
stagingfrom
refactor/pi-mode-folders

Conversation

@BillLeoutsakosvl346

@BillLeoutsakosvl346 BillLeoutsakosvl346 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • move PI implementations and colocated tests into explicit core, cloud, and local folders
  • update direct imports and test mocks for the relocated files
  • keep the existing PI handler, mode logic, execution behavior, and public interfaces unchanged

Type of Change

  • Refactor

Testing

  • PI executor and block suites (22 files, 360 tests)
  • full workspace type-check
  • lint, block registry, import specifiers, monorepo boundaries, and the complete pre-ship audit suite

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Existing tests pass after relocation
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 7, 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 Aug 7, 2026 2:12am

Request Review

@cursor

cursor Bot commented Aug 7, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Mechanical path refactor with no described logic changes; risk is limited to missed import or mock path updates rather than runtime behavior changes.

Overview
Reorganizes the Pi executor handler tree so shared types and utilities live under core/, E2B/GitHub flows under cloud/ (authoring, babysit, review, shared helpers), and local execution under local/, with search/ unchanged at the top level.

What moves: flat files such as backend, keys, context, events, redaction, and pi-sdkcore/; cloud-backend, cloud-shared, github-pr, babysit modules, and review tools → nested cloud/ paths; local-backend, sim-tools, and ssh-toolslocal/.

What stays the same: pi-handler remains the entry point; mode routing, sandbox/git security behavior, and public type surfaces are not intentionally changed—only import paths and Vitest mock targets are updated (including the Pi block test that imports PI_SEARCH_PROVIDERS from core/keys).

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

@greptile-apps

greptile-apps Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR reorganizes the PI executor implementation into explicit core, cloud, and local areas without changing its public handler interface.

  • Moves shared contracts, event handling, key resolution, SDK integration, and redaction into core/.
  • Groups cloud authoring, review, babysit, GitHub, and shared sandbox code under cloud/.
  • Groups local execution and tool implementations under local/.
  • Updates runtime imports, test imports, and mocks to use the relocated modules.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/executor/handlers/pi/pi-handler.ts Preserves the PI handler entry point while redirecting mode and shared-module imports to the new folder structure.
apps/sim/executor/handlers/pi/cloud/authoring/backend.ts Relocates cloud authoring execution and updates its internal dependencies without behavioral changes.
apps/sim/executor/handlers/pi/cloud/review/backend.ts Relocates cloud review execution and consistently updates imports for review tools, GitHub helpers, and core services.
apps/sim/executor/handlers/pi/cloud/babysit/backend.ts Relocates babysit execution and updates its cloud and core dependency paths.
apps/sim/executor/handlers/pi/local/backend.ts Relocates local PI execution and redirects shared and SSH-tool imports to the organized modules.
apps/sim/executor/handlers/pi/core/backend.ts Relocates shared PI backend contracts while preserving their definitions and updating type dependencies.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Registry[Executor handler registry] --> Handler[PI handler]
  Handler --> Core[core: contracts, context, events, keys, SDK, redaction]
  Handler --> CloudAuthoring[cloud/authoring]
  Handler --> CloudReview[cloud/review]
  Handler --> Local[local: backend and tools]
  CloudAuthoring --> CloudShared[cloud/shared]
  CloudAuthoring --> Babysit[cloud/babysit]
  CloudAuthoring --> GitHub[cloud/github-pr]
  CloudReview --> CloudShared
  CloudReview --> GitHub
  CloudAuthoring --> Core
  CloudReview --> Core
  Local --> Core
  Handler --> Search[search]
  Search --> Core
Loading

Reviews (3): Last reviewed commit: "chore(pi): organize mode implementations" | Re-trigger Greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cursor review

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c193a14. Configure here.

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@greptile

@BillLeoutsakosvl346

Copy link
Copy Markdown
Contributor Author

@cursor review

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c212383. Configure here.

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