Skip to content

Sync upstream workspace protocol and preserve beta suspension - #23

Merged
sam2tom merged 62 commits into
betafrom
codex/e2b-release-sync
Oct 10, 2026
Merged

sam2tom merged 62 commits into
betafrom
codex/e2b-release-sync

Conversation

@sam2tom

@sam2tom sam2tom commented Oct 10, 2026 •

Copy link
Copy Markdown

Synchronize MiniMax upstream main 6653f94d into beta 11956c3c while preserving beta's native E2B pause/resume, retained-state ownership, selected-Harness bootstrap, lifecycle wake hints, bounded SDK stages, and safe trace diagnostics.

The merge uses upstream's single SandboxProvider / ConfigurationAdapter contracts and independent workspace model. All ten suspension methods share one declaration; immutable allocation generations select retained compute and workspace ownership. Existing beta runtime_compute.protocol_version = "1" envelopes and E2B native receipts retain their field shapes. Core never converts them to snapshots, replays Create, or replaces a suspended sandbox with a cold allocation.

This consolidated beta delivery supersedes fork #14 (safe Environment file rejection diagnostics, previously integrated into beta by #15) and #19 (joined startup and preparation timings, previously integrated by #20). Their authored behavior and regression coverage are present here, with current upstream interfaces and the maintained codex builder. This consolidation does not claim those PRs were merged into fork main. Fork #22 remains separate: its Project diagnostics API/statistics are not included in this change.

Validation:

  • All repository Go packages and tests compile.
  • Complete database integration suite passed (372s) against disposable local PostgreSQL; Core/execution/deployment/adapter tests passed.
  • Core, microsandbox adapter, registration, configuration and server race tests passed; E2B and node full race tests passed separately.
  • E2B helper 272 Python tests and template 13 tests passed.
  • Literal beta v1 JSON round-trip and real schema 91 → 97 → 91 fixture passed: all 107 synthetic allocations, including 17 suspended, retained their JSON, ownership, generations and retention deadlines.
  • Independent review found a historical-generation workspace selection defect; fixed to read the allocation's retained generation, with regression coverage.
  • SQL projections and bundled documentation checks passed.
  • Website build and all 22 tests passed; the maintained codex Runtime builder path and Chinese suspension documentation were corrected after initial CI.
  • Independent follow-up review confirmed the historical-generation workspace repair. First CI passed Core, all database integration shards, Runtime, official client, Web acceptance, compose, and macOS/Linux native checks.

All remote checks passed on f90180de66bbc9c6bc7ba61dff4e0b5622078085, including Windows native and the aggregate check gate (run). Initial Windows temporary plugin-directory cleanup failed with EBUSY and passed on the new-head run without a production-code change. The upstream mcode settlement test still uses a 100ms deadline and failed locally on both this candidate and exact upstream 6653f94 (5/20 on upstream); Runtime CI passed, and that unrelated test remains unchanged.

Release gates — this PR is not a production approval:

  • Schema migrations 92–97 run automatically at Core startup and delete two tables and seven columns. Prior migrations commit independently. Database/receipt backup and restore capability must be verified, and the exact DDL separately approved. Down migrations do not restore all removed values; E2B idle/retention becomes 0/0 on Down.
  • Core–Runtime wire changes from 0.11.0 to 0.13.0 and rejects mismatches. The existing 17 paused production guests are not upgraded by building a new template. The installer explicitly rejects in-place daemon replacement; there is no validated retained-guest upgrade transaction. Do not deploy this Core to those guests without a separately designed and verified preservation procedure.
  • Helper/node boundaries must be upgraded together: bootstrap 2, E2B helper 4, microsandbox helper 5, node wire 7. Production currently has no sandbox nodes.
  • Live native Linux microsandbox SDK/KVM qualification remains a release requirement; passing portable adapter tests and remote CI does not establish a live KVM lifecycle.

After explicit human approval, this PR was merged into beta as c585ce1bcda7aa6f4128c636de0b86bdae7f93e7 on 2026-10-10. No production DDL, guest wake/delete/lease extension, template activation, tag or deployment was performed. The deployment workflow is manual; ordinary beta pushes do not invoke it.

RyanLee-Dev and others added 30 commits October 4, 2026 10:23
…ation-step-logs

Add initialization step logs
* Move Turn transitions and completion into sessions

* Type Session model execution errors and run the Turn journal through WithTurns

SessionModelExecution returns sessions.ErrNotFound for a Session without a
frozen provider, credentialcrypto.ErrUnavailable without the credential key,
and wraps the cipher error. AppendTurnEvents runs through WithTurns, so
WithTurnJournal and the JournalExecution port are gone. Tests drop the partial
Reader fake, the shadowed ApplyTurnStatus fake and an unused store export, and
the lease test moves Turns through the leased operations.
* Move Session reads, deletion and archive into sessions

Session reads, metadata updates, deletion and the public write audit move
from store into sessions and sessionpg. GetSession, ListSessions and the
stream snapshot each read from one snapshot, and the diagnostics read uses
GetSession. sessionpg.LoadSessionActivity is the one Session activity read;
store's Session creation and administrator summary call it.

Session archive becomes deployment.ExecutionOperations.ArchiveSession and
ArchiveResetSession over deploymentpg's WithSessionArchive: the Session
lock, then the deployment's generation and reset checks in deployment,
then cancellation through the sessions procedures, device revocation,
cleanup request and audit in one leased transaction. The api archive route
calls it directly.

The Runtime observation resolver moves to deployment, and the Runtime
history scope rule into runtimehistory.Service; both storeresolver
packages are deleted.

* Address Session reads review findings
…MiniMax-AI#441)

* Move input admission and Environment input reservations into sessions

* Admit input batches through one procedure and tighten reservation reads

AdmitInputs admits a validated batch for every admission path, and
admitInput is no longer exported. GetEnvironmentInputReservation reads in
one snapshot through the bound Session transaction, the receipt and
reservation loaders lose their forwarding helpers, FindInputReservation
loads receipts only for a matching batch, and the pooled expiry calls in
execution are bounded. TestTurnInputRetriesAndRestart again checks that
admission leaves the stored Session unchanged and that its latest Turn
survives a restart.
* Move Session creation into sessions

sessions.Service.CreateSession now decides creation (idempotent intent,
hosted admission and placement, Skill freeze, execution projection,
initial files, setup, Environment and initial inputs) over one
sessionpg creation transaction that calls the placementpg, skillpg,
filepg and auditpg participants. The Worker creates Sessions through the
service and wakes after commit; the streaming creation path, the store
Session code and the Store fields of the execution owner are removed.

* Restore creation identity assertions and share the store Session service

The PostgreSQL creation tests again check that a changed intent conflicts
at the upsert, that concurrent resolutions of one intent converge on the
winner's configuration, and that of two creators racing for one key exactly
one creates. The request-hash coverage of initial inputs moves to the
sessions unit test. The store fixtures build the Session service in one
helper.
…MiniMax-AI#468)

Core sends only model, system_prompt, model_provider and harness_config
in agent_options. Delete the adapter keys no Core path produces: codex
override_system_prompt, reasoning_summary, mode, mcp_servers,
enable_features, disable_features, skills and the controls copied into
web_search/model_verbosity; mcode mode, override_system_prompt, skills,
plugins and mcp_servers. Codex reads ExecutionControls directly. The
managed Skill installer, the Runtime capability-download and skill-upload
wrappers, the Runtime capability-context flags and the no-op feature
preference removals go with them.

Dispatch now rejects any other agent_options key, and an execution
preparation with neither or both of local_environment and
disable_execution_environment, with unsupported_configuration before a
factory runs. claude_sdk's own unknown-key branch is unreachable and
removed. agent.ManagedSkillsRoot becomes StateDir, its only remaining
use.
Core never sets workspace_authoring and always sends strict_resume and
observe_tool_observations as true, so the Runtime carried code paths that
no Core request reaches. Delete them and keep only the behavior Core uses:

- Workspace authoring: the proto messages and socket variable, the
  WorkspaceAuthoring request field and capability, the daemon authoring
  bridge, its CLI wiring and companion PATH helper, the env agent option
  that only the bridge injected, and Core's capability copy and
  authoring_request rejection case.
- strict_resume: resume and recovery are always strict; mcode always runs
  its protected execution profile.
- observe_tool_observations: adapters always attach the neutral
  observation to tool_call frames.
- Codex and the shared StateDir no longer derive legacy state keys from
  the conversation or run; an empty agent state key is rejected.
- clirunner always owns the child's process group (a Job object on
  Windows), because every caller now requests it.

The Core-Runtime protocol doc, Harness onboarding, CONTRIBUTING and the
Claude SDK adapter README drop the deleted fields and features.
* fix: make installation retries safe and predictable

* fix: share installation log cleanup on every retry

* fix: make retry preparation atomic and preserve running images

* fix: complete installer preparation before publishing state

* fix: publish node configuration atomically
…I#363)

* Remove the unserved daemon pairing path and runtimecrypto

`oac-daemon connect --url --token` posted to /api/v1/runtimes/pair, which
Core does not serve and no contract documents, so the path always failed.
Its envelope encryption was never wired: Core never stored or used
runner_public_key, and SealForRuntime had no caller outside its fixture
generator.

Daemon credentials come from a Provider bootstrap file, self-hosted
Environment enrollment or the oac-core-device profile, all unchanged.

- Delete pair.go, the inline pairing flags, their environment handoff and
  their tests.
- Delete internal/runtimecrypto; golang.org/x/crypto is no longer required.
- auth: drop the pairing-only Profile fields and Save, which no longer has
  a production caller; the not-found error points to oac-core-device.
- daemonize: drop ReExecOptions.ExtraEnv, which only carried the pairing
  token to the background child.
- paths: drop EnsureProfileDir, whose only caller was auth.Save.
- Reword comments and docs that described pairing.

* Remove obsolete Parsar integration naming guidance

* docs: sync bootstrap translation after pairing removal

---------

Co-authored-by: saladday <1203511142@qq.com>
Core starts every Run through execution_prepare and execution_start, so
the prompt_request frame, its daemon path and Core's unprepared delivery
branch had no caller.

- Delete proto.TypePromptRequest and its protocol rows; the daemon drops
  the frame as an unknown type. PromptRequestPayload stays as the
  execution_prepare configuration.
- Delete the daemon prompt path (prompt.go, output.go, the retained idle
  session pool, the completion barrier and the unprepared cancel and
  shutdown branches). A Run's session is now an agent.Turn, so durable
  steering support is enforced by type.
- Core deliver takes the prepared handle, Run ID and input explicitly.
- Delete ConversationID and ReleaseOnCompletion; WorkspaceReadOnly alone
  marks a read-only preparation.
- validateExecutionEnvironment owns the exactly-one local_environment /
  disable_execution_environment rule.
- Port the dispatch tests that cover behavior execution_start keeps to
  shared execution_prepare/execution_start helpers.
…niMax-AI#482)

Shutdown marks every executor invalid but closes only owners without a
Run, leaving a running owner's close to its prepared release. The release
reads r.closed and owner.invalid once, before joining operations and
retiring the Run. When Shutdown took the lock after that reuse decision
and before the Run let go of the owner, nobody closed the executor: it
stayed in r.executors with no close in flight, and Shutdown reported
"cleanup unconfirmed" for a healthy native executor. Device shutdown
has the same window and left the owner permanently invalid.

When the release retires an owner that was invalidated without a close,
start the close under shutdownWG so Shutdown waits for it. Report an
executor that remains without a close error as "cleanup has not
settled" instead of wrapping a nil error.
…iniMax-AI#476)

* feat: share Core installation across Linux macOS and Windows

* fix: recover interrupted staging and qualify native platforms

* fix: use native Web base images and one Compose startup

* test: exercise the PowerShell launcher with native oac

* test: share launcher fixtures across PowerShell script scopes

* docs: align installation guidance with shared platform support

* docs: correct secret mounts and installation locking

* docs: clarify native management command invocation
Runs start only through the Executor, so agent.Factory, Runtime.Session, Registry.Resolve, the factories map and each adapter's direct-call factory had no production caller. RegisterKind now registers only the descriptor and model configuration, and Register rejects factories on an unavailable runtime. Code that only the factories reached is deleted, and the adapter tests run through the Executor path.
* ci: review documentation consistency and ownership

* ci: split reviews and send one combined Feishu report
…-AI#489)

Every Harness now runs unattended; a human in the loop goes only through
function tools and requires_action, as in the pinned Agents API.

- mcode advertises no elicitation and answers session/request_permission
  with the ACP cancelled outcome, which mcode treats as a denial; other
  client methods get -32601.
- codex disables its blocking tools.experimental_request_user_input tool;
  under approval policy never it settles MCP elicitation itself, and any
  other server request gets the client's method-not-found reply. The
  approval policy and sandbox unions collapse to constants.
- Delete permission_request, permission_cancel, permission_decision,
  prompt_for_user_choice, prompt_for_user_choice_decision, device_shutdown,
  the Permissions capability, the responder interfaces, the daemon
  interaction routing, the gateway interaction indexes and the
  interaction_not_supported diagnostic.
- interaction_decision_ack stays for function results and cancellation;
  the daemon's applied-result replay now serves function results only.

Bumps the Core–Runtime protocol to 0.12.0, which also covers the earlier
agent_options, request-field and prompt_request removals.
SaladDay and others added 27 commits October 7, 2026 23:00
Session message inputs are stored only as the public
agent.session.input.message event, so the {"text"} branches in Item
projection and Runtime dispatch go, and the recovery fixture and tests
submit the public shape.

Items are stored with their wire encoding: MarshalStored folds into
MarshalJSON, and replayed child Items compare against the same bytes.

Sessions always freeze a model provider at creation, so the execution
guards for Sessions stored without one, ErrModelProviderRequired and its
handlers are deleted.
The TypeScript client now reads the deployment bounds and Runtime release patterns from a projection that specification-contract generates from sandbox/deployment_contract.go, so Web accepts only Core's oac-runtime microsandbox reference. The Harness catalog generator projects the model-provider protocol names from internal/modelprovider, so every client copy includes chat_completions.

A shared catalog fixture lists every error code a /core/v1 or console caller can receive outside the wire vocabulary of wire-semantics.md. A Go test requires a producer for each listed code, an exact match with core-errors.md, and a catalog entry for every other code Core's error writers produce unless it never reaches an administration caller. Web tests require both locales to localize exactly those codes. The ten administration codes that were missing are now catalogued, documented and localized; the unproduced sandbox_admin_not_configured message is deleted, and the client-only sandbox_configuration_unconfirmed code is a named client constant.
Core owns one idle suspension policy (300 seconds idle, 86400 seconds
retention) and reports it for every Provider that declares checkpoint
support. The microsandbox registry constant, its copy in the provider
description and the idle_seconds/retention_seconds deployment columns are
deleted; migration 000094 drops the columns and rewrites
runtime_deployment_setup_check without them.

Registration keeps only the declared rule that checkpoint support needs a
nodes registration. The API suspension shape is unchanged; its description
names the declaration rule instead of a vendor.
…AI#547)

- The local-environment test no longer races managed-runtime
  maintenance: it asserts the read never binds the general device,
  while maintenance may bind its own.
- Drop Docker's extra_hosts, a node setting nothing produces.
- Web's runtime_history_unavailable text matches the contract: the
  history is temporarily unavailable.
make openapi now projects the public schema onto
packages/agents-client/src/generated/public-api.ts: each schema's
TypeScript type, each enum's values and each object's field names, with
required lists and per-union field maps. make check-openapi rejects a
stale copy. The emitter takes a parsed schema dict and accepts the
Swagger 2.0 forms of the Core document (x-nullable, allOf, any ref
prefix), so the /core/v1 projection can reuse it.

The client aliases the generated types and validates responses with the
generated field sets and enums instead of hand-written copies. Where the
schema and the validators disagreed, the schema wins: snapshot events
carry no session_id, Item events require output_index, terminal Turn
events require usage, list envelopes are complete, input_image is
accepted in user messages, and older-Core allowances are gone. The
client no longer re-checks limits Core enforces.

Core now sends turn_id null on Environment events, null cwd, output,
exit_code and duration_ms on command_execution Items, and param null on
the stream interruption error, as the pinned schema requires.
…I#638)

* Separate persistent workspace storage from sandbox compute

* Settle workspace refusals before native creation

* Align filesystem observations and optional bootstrap projections

* Settle absent initial compute before workspace cleanup
@sam2tom
sam2tom marked this pull request as ready for review October 10, 2026 15:25
@sam2tom
sam2tom merged commit c585ce1 into beta Oct 10, 2026
25 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-10T15:26:07.866349Z f90180d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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