Skip to content

feat(e2b): return run-session handles#451

Merged
steipete merged 6 commits into
openclaw:mainfrom
kiranmagic7:kiran/e2b-run-session-20260618
Jun 18, 2026
Merged

feat(e2b): return run-session handles#451
steipete merged 6 commits into
openclaw:mainfrom
kiranmagic7:kiran/e2b-run-session-20260618

Conversation

@kiranmagic7

@kiranmagic7 kiranmagic7 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Advertises FeatureRunSession for the e2b provider now that acquire, reuse, keep, and cleanup paths are wired.
  • Returns a RunSessionHandle once e2b lease identity exists, including kept leases, sync-only paths, and keep-on-failure retained leases.
  • Adds focused coverage for capability advertisement, kept session output, keep-on-failure session output, and the generated provider matrix entry.

Verification

  • go test ./internal/providers/e2b ./internal/providers/all
  • scripts/check-docs.sh
  • git diff --check

Refs #182

@kiranmagic7
kiranmagic7 force-pushed the kiran/e2b-run-session-20260618 branch from 7f7fd89 to 4d870e2 Compare June 17, 2026 22:02
@clawsweeper

clawsweeper Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 17, 2026, 6:51 PM ET / 22:51 UTC.

Summary
The PR advertises E2B FeatureRunSession, returns RunSessionHandle metadata from the E2B run lifecycle, adds E2B session tests, and updates the provider matrix.

Reproducibility: not applicable. this is a feature PR, not a bug report. The current-main check is source-based: E2B does not advertise FeatureRunSession and --lease-output is gated before this PR.

Review metrics: 1 noteworthy metric.

  • Provider-scope diff: 5 files, +119/-16. The change is bounded to the E2B adapter, its focused tests, a core type alias, and generated provider documentation while exposing a new provider capability.

Root-cause cluster
Relationship: partial_overlap
Canonical: #182
Summary: The linked issue remains the canonical run-session adoption tracker; this PR covers the E2B provider slice rather than the whole umbrella.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted terminal output, copied live output, or logs from a real E2B crabbox run --provider e2b --keep --lease-output session.json -- true run showing the JSON handle.
  • Show the emitted cleanup command being run and a follow-up crabbox list --provider e2b --json or equivalent output proving the sandbox is gone; redact API keys, IPs, private endpoints, and other private details.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR body provides unit/docs checks but no live E2B --keep --lease-output run, cleanup command output, or redacted runtime log proving the after-fix provider path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Risk before merge

  • [P1] No live E2B lifecycle proof is attached, so mocked tests and green CI do not prove that the emitted cleanup command releases a real retained E2B sandbox.
  • [P1] The linked umbrella tracker still treats provider-by-provider run-session adoption as maintainer-reviewed lifecycle work; this PR should not merge solely on mechanical wiring.

Maintainer options:

  1. Decide the mitigation before merge
    Land this after redacted live E2B proof shows --keep --lease-output writes a usable handle and the emitted cleanup command releases the sandbox, while keeping the change scoped to the provider adapter, tests, and docs.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Contributor proof and maintainer acceptance are needed; there is no narrow code defect for an automated repair lane to fix right now.

Security
Cleared: The diff adds Go provider session-handle plumbing, tests, and docs without changing secret handling, dependencies, CI, install scripts, or package resolution.

Review details

Best possible solution:

Land this after redacted live E2B proof shows --keep --lease-output writes a usable handle and the emitted cleanup command releases the sandbox, while keeping the change scoped to the provider adapter, tests, and docs.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is a feature PR, not a bug report. The current-main check is source-based: E2B does not advertise FeatureRunSession and --lease-output is gated before this PR.

Is this the best way to solve the issue?

Unclear until live proof: the code follows the existing provider-adapter pattern, but advertising the capability should wait for redacted real E2B run/cleanup output and maintainer acceptance.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 943798f62935.

Label changes

Label changes:

  • add P2: This is a normal provider capability improvement with real orchestration value but limited blast radius and a proof gate before merge.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides unit/docs checks but no live E2B --keep --lease-output run, cleanup command output, or redacted runtime log proving the after-fix provider path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a normal provider capability improvement with real orchestration value but limited blast radius and a proof gate before merge.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body provides unit/docs checks but no live E2B --keep --lease-output run, cleanup command output, or redacted runtime log proving the after-fix provider path. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully; its provider-adapter boundary guidance is relevant because the PR keeps the new capability inside the E2B adapter plus docs/tests rather than adding provider-specific core routing. (AGENTS.md:1, 943798f62935)
  • Current main gates E2B lease output: On current main, E2B advertises only FeatureURLBridge, and run rejects --lease-output unless the provider advertises FeatureRunSession. (internal/providers/e2b/provider.go:24, 943798f62935)
  • Current E2B lifecycle is source-auditable: Current main already has E2B acquire/reuse identity, shouldStop := acquired && !req.Keep, deferred cleanup, and keep-on-failure hooks, which are the lifecycle points this PR wires into a session handle. (internal/providers/e2b/backend.go:125, 943798f62935)
  • PR diff scope: The PR changes five files: E2B backend/provider/core alias, E2B tests, and the provider matrix; it adds session construction after lease identity exists and a quoted E2B cleanup command helper. (internal/providers/e2b/backend.go:150, 4d870e2f6df1)
  • Related tracker context: The linked provider-adoption tracker remains open and its latest human audit lists E2B as ready for a small per-provider run-session PR, while still requiring provider lifecycle proof before advertising the feature.
  • Proof and checks: The PR body lists go test ./internal/providers/e2b ./internal/providers/all, scripts/check-docs.sh, and git diff --check, and GitHub reports CI checks passing, but no live E2B --keep --lease-output run or cleanup/list output is attached. (4d870e2f6df1)

Likely related people:

  • zozo123: Yossi Eliaz authored the original E2B provider commit and later authored the merged Islo run-session implementation that this PR pattern follows; they also contributed the linked tracker audit naming E2B as ready. (role: introduced E2B provider and adjacent run-session contributor; confidence: high; commits: 1b6397871cb4, c7f1c55772b4; files: internal/providers/e2b/backend.go, internal/providers/e2b/provider.go, internal/providers/islo/backend.go)
  • steipete: Peter Steinberger authored recent main commits touching the relevant provider/run surfaces in this checkout and posted the tracker status refresh requiring provider lifecycle proof before advertising run-session. (role: recent area contributor and reviewer-context source; confidence: medium; commits: 943798f62935, 008f70f30614; files: internal/providers/e2b/backend.go, internal/cli/run.go, internal/cli/provider_backend.go)
  • RomneyDa: Dallin Romney authored the original Blacksmith lease-output work that introduced the generic RunSessionHandle and FeatureRunSession contract this E2B PR extends. (role: introduced generic run-session contract; confidence: medium; commits: 76829952a9d8; files: internal/cli/provider_backend.go, internal/cli/run.go)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 17, 2026
@steipete
steipete merged commit 2775ab9 into openclaw:main Jun 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants