Skip to content

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

Merged
icecrasher321 merged 46 commits into
stagingfrom
feat/func-cli-resolver
Aug 6, 2026
Merged

feat(code): cli sandboxes, enterprise timeouts, secrets projections, resolver lift, workflow exec cancellations#6247
icecrasher321 merged 46 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 with @Sg312

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 6, 2026 2:17am

Request Review

@cursor

cursor Bot commented Aug 4, 2026

Copy link
Copy Markdown

PR Summary

High Risk
Changes touch authentication-adjacent secret handling, model-bound data projection, remote sandbox supply chain, and distributed execution/cancellation across Trigger.dev and cleanup cron paths—a broad, security-sensitive surface with many integration points.

Overview
This PR expands remote Function sandboxes with Shell as a language, Debian system packages, and a curated managed CLI catalog (pinned vendor artifacts with checksum-verified server recipes and content-addressed image identity). Docs and agent skills describe how to add CLIs and configure dedicated E2B/Daytona Function bases separately from Mothership shell images.

Secrets and code execution move behind a shared code-placeholder compiler for JavaScript, Python, and Shell: {{KEY}} is bound at the execution boundary instead of pasted into source, with Shell quote/heredoc-aware lowering. Tool and Function paths add opt-in provenance (modelInput projection, opaqueModelInput rejection, secretProvenance for durable sinks) so model-visible and persisted data fail closed without blanket sanitizing third-party API results. A new CI check audits tool request transport boundaries.

Runtime policy: Enterprise workspaces can raise async workflow timeouts up to seven days; async API callers may shorten a run via X-Execution-Timeout-Seconds (never extend policy). Stale execution cleanup respects executionDeadlineAt, uses batched FOR UPDATE SKIP LOCKED pages, and aligns async-job failure messages with per-job max duration. Workflow cancellation is extended so background Trigger.dev work is cancelled alongside in-app execution state.

Smaller contract fixes include upload receipt tokens on batch presigned URLs, distinct execution attachment keys for multipart uploads, Azure multipart completion passing uploadId, and storage CORS/header docs for create-only uploads.

Reviewed by Cursor Bugbot for commit 05e6447. 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 handling while expanding sandbox, timeout, and cancellation capabilities.

  • Adds curated managed CLIs and Shell execution to Function sandboxes.
  • Adds configurable Enterprise asynchronous execution timeouts and exposes per-request timeout controls through the SDKs.
  • Extends cancellation across local, database-backed, Trigger.dev, resumed, and grouped workflow executions.
  • Projects resolved secrets out of traces and model-visible tool results.
  • Updates database schema, API contracts, documentation, UI configuration, and tests for the new behavior.

Confidence Score: 5/5

The PR appears safe to merge within the scope of this follow-up review.

No blocking failure remains in the eligible follow-up review scope.

Important Files Changed

Filename Overview
apps/sim/executor/variables/resolver.ts Centralizes code-context resolution while preserving environment placeholders for execution-boundary compilation.
apps/sim/lib/execution/code-placeholders/index.ts Introduces the shared JavaScript, Python, and Shell placeholder-compilation boundary.
apps/sim/lib/execution/remote-sandbox/cli-tools.server.ts Defines pinned, checksum-verified server-side installation recipes for managed sandbox CLIs.
apps/sim/lib/billing/execution-timeout-defaults.ts Resolves plan and Enterprise-specific execution timeout policies.
apps/sim/app/api/workflows/[id]/executions/[executionId]/cancel/route.ts Coordinates durable cancellation state, backend job cancellation, local aborts, resumed executions, and terminal event publication.
apps/sim/lib/core/async-jobs/backends/trigger-dev.ts Adds execution-scoped Trigger.dev cancellation using tags and payload verification.
packages/db/schema.ts Adds persisted metadata supporting configurable Enterprise execution limits and related sandbox behavior.

Sequence Diagram

sequenceDiagram
  participant Client
  participant API as Execution API
  participant Policy as Timeout Policy
  participant Queue as Async Backend
  participant Executor
  participant Sandbox
  participant Projection as Secret Projection

  Client->>API: Start workflow
  API->>Policy: Resolve account and request timeout
  Policy-->>API: Effective deadline
  API->>Queue: Enqueue execution with deadline
  Queue->>Executor: Run workflow
  Executor->>Sandbox: Execute Function or Shell with managed CLIs
  Sandbox-->>Executor: Block output
  Executor->>Projection: Sanitize traces and model-visible output
  Projection-->>Client: Stream projected result
  Client->>API: Cancel execution
  API->>Queue: Cancel queued or running job
  API->>Executor: Signal local or resumed execution
Loading

Reviews (14): Last reviewed commit: "run from block ui disabling" | 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
…lver

# Conflicts:
#	apps/docs/content/docs/en/workflows/blocks/function.mdx
#	apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/code/code.tsx
#	apps/sim/lib/copilot/request/tools/executor.test.ts
#	apps/sim/tools/generated/tool-metadata.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

bugbot run

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

# Conflicts:
#	packages/db/migrations/meta/0282_snapshot.json
#	packages/db/migrations/meta/_journal.json
…lver

# Conflicts:
#	apps/sim/lib/copilot/tools/handlers/materialize-file.test.ts
#	apps/sim/lib/copilot/tools/handlers/materialize-file.ts
@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@greptile

@icecrasher321

Copy link
Copy Markdown
Collaborator Author

@cursor review

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Too many files changed for review (826 files, 500 file limit).

@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 b6109c4. 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 05e6447. Configure here.

@icecrasher321
icecrasher321 merged commit 117fe31 into staging Aug 6, 2026
28 of 29 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/func-cli-resolver branch August 6, 2026 02:26
waleedlatif1 added a commit that referenced this pull request Aug 6, 2026
…ema (#6323)

createTableWriteProvenanceTargets (added in #6247) required every submitted
column to translate to exactly one storage id and threw otherwise. The wire
translator has always dropped keys naming no column in the schema, so any
internal-JWT write carrying such a key threw an uncaught error and surfaced
as a 500 — where the same write previously succeeded, since the write path
drops the column identically.

Give a dropped column a null column id instead of throwing. It still gets a
target, so the bundle completeness check that pairs one selection per
submitted column is unchanged, but no provenance is recorded for a value
that is never stored.
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.

3 participants