Skip to content

fix(sandbox,db): keep a short workbench run's output on timeout; require dev push for the Project bootstrap switch - #9617

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/release-0942-short-run-output
Nov 3, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/release-0942-short-run-output

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Workbench runs with a budget of 20 s or less give the command the whole budget, so the run's own deadline could fire before E2B's timeout reply. The run then threw a bare timeout and dropped the output it had already streamed. The E2B session adapter now treats a timeout-reason abort like E2B's own timeout and returns the streamed output with timedOut: true. throwIfRunTimedOut lets only the run's own deadline through (throwIfCancelled) and runs before the post-run abort check, so the caller gets the SandboxExecutionTimeoutError progress report. A Stop is still a cancellation, and one-shot sandboxes still get the plain timeout. This fix works alongside the report reserve from fix(release): report short workbench timeouts, gate Sim links in Chat settings, scope the Chat plan modal #9616: that reserve usually lets E2B's timeout answer first, and this change covers the case where the call's deadline still fires first. It takes no additional budget.
  • Daytona is unchanged because it has no workbench (session) support.
  • The nullable workspace.project_id dev-push bootstrap switch now also requires SIM_DEV_DB_PUSH=1, the same way hnswIndexOptions does. A stray SIM_DB_PUSH_PROJECT_BOOTSTRAP can no longer make a non-dev push or db:generate drop NOT NULL.

Type of Change

  • Bug fix

Testing

  • Each new regression test fails when its guard is reverted:
    • session-sandbox.test.ts: the deadline fires before the provider replies, for both code and shell, and the run reports the streamed output; it still throws a bare AbortError: timeout on staging with fix(release): report short workbench timeouts, gate Sim links in Chat settings, scope the Chat plan modal #9616. A Stop stays a cancellation on a workbench, and also on a provider without workbenches.
    • e2b-session.test.ts: a deadline abort returns the streamed stdout for both code and command. A Stop of code still rejects. A Stop of a command is never reported as a timeout. A one-shot sandbox's deadline still rejects.
    • dev-push.test.ts: with only the bootstrap flag set, project_id stays NOT NULL; with both flags it is nullable.
  • packages/db suite; remote-sandbox session, E2B, conformance and session-files tests; execute-request.test.ts
  • drizzle-kit generate produces no migration
  • lint, check:comment-hygiene, check:test-patterns, check:utils, check:explicit-any. CI runs the full gate.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • 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 Nov 3, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 3, 2026 6:37am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Preserves streamed output when a workbench run's deadline fires before E2B replies.

  • Short E2B workbench runs keep streamed output when their deadline fires.
  • The Project bootstrap makes workspace.project_id nullable only during development pushes.

Reviews (2) · Last reviewed commit: "fix(sandbox,db): keep a short workbench ..." · Reviewed by Greptile

…ire dev push for the Project bootstrap switch

- A workbench run with a budget of 20 s or less hands the command its whole
  budget, so the run's own deadline can fire before the provider's timeout
  reply. The E2B session adapter now treats that timeout-reason abort like the
  provider's own timeout and returns the output it already streamed, and
  throwIfRunTimedOut lets only the run's deadline through, so a Stop stays a
  cancellation. No budget is taken from short runs.
- The nullable workspace.project_id switch now also requires SIM_DEV_DB_PUSH=1,
  like hnswIndexOptions, so a stray bootstrap flag cannot make an ordinary push
  or generation drop NOT NULL.
@waleedlatif1
waleedlatif1 force-pushed the fix/release-0942-short-run-output branch from 225812c to 94d61e4 Compare November 3, 2026 06:37
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 2ec4e89 into staging Nov 3, 2026
78 of 79 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/release-0942-short-run-output branch November 3, 2026 17:35

This branch was previously deployed

1 inactive deployment
Preview — 94d61e4e Deployed Nov 3, 2026 by vercel[bot]
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