Skip to content

fix(harness): bind RuntimeContext before sandbox start#2234

Closed
yujianxin991 wants to merge 1 commit into
agentscope-ai:mainfrom
yujianxin991:codex/fix-sandbox-runtime-context
Closed

fix(harness): bind RuntimeContext before sandbox start#2234
yujianxin991 wants to merge 1 commit into
agentscope-ai:mainfrom
yujianxin991:codex/fix-sandbox-runtime-context

Conversation

@yujianxin991

Copy link
Copy Markdown

Summary

  • add a backward-compatible Sandbox.bindRuntimeContext(RuntimeContext) lifecycle hook
  • invoke it after acquire and before start for every sandbox path
  • verify binding order and cleanup when binding fails

Motivation

Sandbox implementations may need the per-call user/session identity before start creates or resumes remote resources. Previously RuntimeContext was available to SandboxLifecycleMiddleware but was not passed to Sandbox until exec, which is too late for ownership and isolation metadata.

Testing

  • mvn -pl agentscope-harness -am -Dtest=SandboxLifecycleMiddlewareRuntimeContextTest,SandboxLifecycleMiddlewareCallbackTest -Dsurefire.failIfNoSpecifiedTests=false test

6 focused tests passed.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@yujianxin991 yujianxin991 deleted the codex/fix-sandbox-runtime-context branch July 15, 2026 14:14
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants