Skip to content

fix(sandbox): initialize workbench history before honoring a stop during creation - #9549

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/workbench-history-stopped-create
Nov 1, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/workbench-history-stopped-create

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • A chat workbench created while the caller stopped (e.g. Stop pressed during the first run_code) keeps existing for the next call to reuse, but ensureSessionSandbox checked the abort before initializing the machine's input history
  • The next call then reuses a machine with no history, the history script records it as unknown, and every later code/shell result in that chat is withheld ("Tool execution settled, but its result could not be returned safely") until the machine is discarded — even when the code succeeded
  • Initialize the history for a newly created machine before honoring the abort. A machine this call just created has received no input, so empty history is exact; nothing changes on the non-abort path
  • Existing machines latched before this ships are discarded by the paused-session sweep shortly after their last use, so no cleanup is needed

Type of Change

  • Bug fix

Testing

  • Added a case to session-input-certification.integration.ts (real Redis history script, code + shell): the caller stops while the provider is creating the machine, then the next call reuses it and must return its result with clean history
  • Red on the pre-fix code with Workbench output withheld because its secret provenance is unavailable, green with the fix; existing certification cases unchanged
  • session-file-provenance.integration.ts and all lib/execution/remote-sandbox unit tests pass (574)
  • Lint, type-check, audits, and full suites run in CI

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)

…ing creation

A chat workbench created while the caller stopped kept running for the next
call to reuse, but the abort check ran before its history was initialized.
The reused machine then had no history, so it could never be certified and
every later code result in that chat was withheld.
@vercel

vercel Bot commented Nov 1, 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 1, 2026 7:17pm 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 2 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 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Initializes a newly created workbench's input history before honoring cancellation, so the next call can safely reuse it.

  • A stopped workbench creation leaves history ready for the next call.

Reviews (2) · Last reviewed commit: "fix(sandbox): type the certification run..." · Reviewed by Greptile

@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 1, 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 2 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 cdff0e5 into staging Nov 1, 2026
69 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/workbench-history-stopped-create branch November 1, 2026 19:28

This branch was previously deployed

1 inactive deployment
Preview — dfa8d7c1 Deployed Nov 1, 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