Skip to content

feat(code): cli sandboxes, enterprise timeouts, secrets projections, resolver lift, workflow exec cancellations - #6247

Open
icecrasher321 wants to merge 17 commits into
stagingfrom
feat/func-cli-resolver
Open

feat(code): cli sandboxes, enterprise timeouts, secrets projections, resolver lift, workflow exec cancellations#6247
icecrasher321 wants to merge 17 commits into
stagingfrom
feat/func-cli-resolver

Conversation

@icecrasher321

@icecrasher321 icecrasher321 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Allow CLIs in Sandboxes (with 25 managed CLIs out of the box)
  • Add Shell as supported language in function block
  • Enterprise metadata can set custom timeouts now
  • Resolver lifted to be central compiler adhering to secrets mgmt policies and applying across the board
  • Workflow execution cancellations to cancel trigger dev side too

Type of Change

  • New feature

Testing

Tested manually

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)

…lver

# Conflicts:
#	apps/sim/components/settings/navigation.test.ts
#	apps/sim/components/settings/navigation.ts
#	apps/sim/providers/index.test.ts
@icecrasher321
icecrasher321 requested a review from a team as a code owner August 4, 2026 08:23
@gitguardian

gitguardian Bot commented Aug 4, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
35640005 Triggered Generic Password 1a7c79b apps/desktop/src/main/browser-import/import-service.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 4, 2026 9:28pm

Request Review

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Touches secret handling, remote sandbox supply chain, and core execution/timeout/cleanup paths across API, cron, and Function routes—high blast radius if binding, deadlines, or image recipes regress.

Overview
This PR expands remote Function sandboxes with a curated managed-CLI catalog (pinned vendor artifacts, checksums, client/server registry split, content-addressed image identity) plus agent skills/commands for adding CLIs safely. Workspace sandboxes can also declare system packages alongside pip/npm deps; docs and self-hosted guides now spell out dedicated Function base images for E2B/Daytona vs separate Mothership shell images.

Function execution gains Shell as a remote language, Python as real modules (__sim_result__ / __main__), stricter sandbox output size and file-type limits, Mothership-only trusted sandbox profiles, and clearer timeout vs cancel vs workflow-deadline handling across local VM, remote JS/Python, and shell paths.

A central code compiler/resolver now binds {{KEY}} secrets at the execution boundary (opaque bindings, regex/heredoc/shell cases) instead of pasting values into source; provenance and model-facing projection replace exact secret values before agent/tool continuations while execution logs keep masked copies. Custom Tool and credentials docs reflect this.

Async workflow policy: Enterprise can configure longer runs (up to 7 days); direct async API/SDK callers may send X-Execution-Timeout-Seconds / executionTimeoutSeconds to shorten a run within account policy, not extend it. OpenAPI and Python/TS SDK docs are updated.

Stale execution cleanup is reworked for scale: deadline-aware workflow failure, bounded batched mutations with FOR UPDATE SKIP LOCKED, separate table-job thresholds, and async job cleanup keyed off per-job maxDurationSeconds when present.

Reviewed by Cursor Bugbot for commit 5cbafee. Configure here.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

Comment thread apps/sim/app/api/cron/cleanup-stale-executions/route.ts
@greptile-apps

greptile-apps Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR centralizes execution-time placeholder and secret resolution while expanding sandbox capabilities and configurable enterprise execution deadlines.

  • Adds curated managed CLIs and Shell support to Function sandboxes across provisioning, API contracts, and workspace settings.
  • Applies centralized variable resolution and secret-safe projection across workflow handlers, logs, traces, and Copilot tool execution.
  • Adds account-policy and request-level timeout handling for asynchronous executions.
  • Updates SDKs, database metadata, documentation, and tests for the new execution contracts.

Confidence Score: 5/5

The PR appears safe to merge based on the review findings available in this follow-up.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/executor/variables/resolver.ts Centralizes execution input and secret-reference resolution for block handlers.
apps/sim/lib/execution/code-placeholders/index.ts Exposes the shared compiler contract for language-aware code placeholders.
apps/sim/lib/execution/remote-sandbox/cli-tools.server.ts Defines server-only, pinned installation recipes for curated sandbox CLIs.
apps/sim/lib/execution/remote-sandbox/resolve.ts Resolves sandbox specifications, packages, managed CLIs, and provider behavior.
apps/sim/lib/billing/execution-timeout-defaults.ts Introduces centralized defaults and policy handling for execution timeouts.
apps/sim/app/api/workflows/[id]/execute/route.ts Propagates request-level asynchronous execution deadlines through workflow admission and dispatch.
packages/db/schema.ts Extends persisted enterprise metadata needed by configurable execution policies.
packages/ts-sdk/src/index.ts Adds the asynchronous server-side execution timeout option to the TypeScript SDK.
packages/python-sdk/simstudio/init.py Adds the corresponding asynchronous execution timeout option to the Python SDK.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Trigger[Workflow trigger] --> Preprocess[Admission and timeout policy]
  Preprocess --> Resolver[Central variable and secret resolver]
  Resolver --> Executor[Workflow executor]
  Executor --> Function[Function sandbox]
  Function --> Runtime{Runtime}
  Runtime --> JavaScript[JavaScript]
  Runtime --> Python[Python]
  Runtime --> Shell[Shell]
  Function --> ManagedCLI[Managed CLI environment]
  Executor --> Projection[Secret-safe output projection]
  Projection --> Logs[Logs and traces]
  Projection --> Agent[Agent and Copilot consumers]
Loading

Reviews (12): Last reviewed commit: "Merge remote-tracking branch 'origin/sta..." | Re-trigger Greptile

Comment thread apps/sim/lib/execution/code-placeholders/javascript.ts Fixed
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/cron/cleanup-stale-executions/route.ts
Comment thread apps/sim/app/api/cron/cleanup-stale-executions/route.ts Outdated
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/cron/cleanup-stale-executions/route.ts Outdated
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/cron/cleanup-stale-executions/route.ts

@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 6a257db. Configure here.

…lver

# Conflicts:
#	apps/sim/background/schedule-execution.test.ts
#	apps/sim/background/schedule-execution.ts
#	apps/sim/lib/copilot/chat/workspace-context.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator 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 93c6320. Configure here.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator 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 7845110. Configure here.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator 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 54e828f. Configure here.

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator 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 9f0d229. Configure here.

@icecrasher321 icecrasher321 changed the title feat(code): cli sandboxes, enterprise timeouts, secrets projections, resolver lift feat(code): cli sandboxes, enterprise timeouts, secrets projections, resolver lift, workflow exec cancellations Aug 4, 2026
…lver

# Conflicts:
#	apps/sim/lib/copilot/vfs/workspace-vfs.ts
#	apps/sim/lib/core/config/env-flags.ts
#	apps/sim/lib/execution/remote-sandbox/pi-lifetime.test.ts
#	apps/sim/lib/execution/remote-sandbox/pi-lifetime.ts
#	apps/sim/lib/execution/remote-sandbox/provider.ts
#	scripts/setup/checks.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

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

2 participants