Skip to content

fix: update examples to use clientStarter and fix BrowserSandbox lazy init#101

Merged
chickenlj merged 2 commits intoagentscope-ai:mainfrom
flystar32:fix/examples-clientconfig-to-clientstarter
May 7, 2026
Merged

fix: update examples to use clientStarter and fix BrowserSandbox lazy init#101
chickenlj merged 2 commits intoagentscope-ai:mainfrom
flystar32:fix/examples-clientconfig-to-clientstarter

Conversation

@flystar32
Copy link
Copy Markdown
Contributor

Summary

Fix compilation errors and runtime exceptions in example projects caused by the sandbox module refactoring (commit 12b25af).

Changes

1. Rename clientConfigclientStarter (4 files)

The ManagerConfig.builder() method was renamed from .clientConfig() to .clientStarter() in the core module, but the examples were not updated accordingly.

Affected files:

  • simple_sandbox_tool_example/AgentConfig.java
  • structured_sandbox_tool_example/SandboxStructuredExample.java
  • custom_sandbox_example/Main.java
  • browser_use_fullstack_runtime/BrowserAgentApplication.java

2. Fix BrowserSandbox lazy initialization (2 files)

BrowserSandbox.getDesktopUrl() calls GuiMixin.getDesktopUrl() which directly invokes managerApi.getInfo() bypassing the lazy initialization in Sandbox.getInfo(). This causes a RuntimeException: Sandbox null is not healthy when the container hasn't been created yet.

Fix: Add browserSandbox.getInfo() before getDesktopUrl() to trigger container creation.

3. Fix typo

agent-sessopnagent-session in SandboxStructuredExample.java

Testing

  • All 7 example projects compile successfully
  • simple_sandbox_tool_example: Spring Boot started, Docker container created, VNC URL accessible
  • browser_use_fullstack_runtime: Spring Boot started on port 8080
  • custom_sandbox_example: SandboxService started and exited normally

… init

- Rename clientConfig to clientStarter in ManagerConfig.builder() calls across all examples to match the refactored API (commit 12b25af)

- Add browserSandbox.getInfo() before getDesktopUrl() to trigger lazy initialization, preventing 'Sandbox null is not healthy' error

- Fix typo in SandboxStructuredExample: 'agent-sessopn' -> 'agent-session'

Affected examples:

- simple_sandbox_tool_example

- structured_sandbox_tool_example

- custom_sandbox_example

- browser_use_fullstack_runtime

Change-Id: I984405de32f5e4325253614204a2df0092cd8611
Co-developed-by: Qoder <noreply@qoder.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 27, 2026

CLA assistant check
All committers have signed the CLA.

@chickenlj chickenlj merged commit 7b9032b into agentscope-ai:main May 7, 2026
2 checks passed
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