Skip to content

feat (sandbox): decouple sandbox provider config from agent config - #1707

Closed
ananthsub wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
ananthsub:ansubramania/sandbox-config-decouple
Closed

feat (sandbox): decouple sandbox provider config from agent config#1707
ananthsub wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
ananthsub:ansubramania/sandbox-config-decouple

Conversation

@ananthsub

@ananthsub ananthsub commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #1377 addressing the config-usability feedback (thread): the inline sandbox_provider: block welded provider connection/lifecycle config (and its secret) into the agent config, making it hard to swap providers.

This decouples the two. A sandbox is now a named block<name>: { <provider>: {config} } defined in its own provider config file, and an agent points at it by name (e.g. sandbox_provider: sandbox). The framework only ever resolves a name → one provider config.

  • Single (default): ship a sandbox block; the agent defaults to sandbox_provider: sandbox.
  • Swap providers (no agent edit): every shipped provider config binds the same name sandbox, so swapping providers is swapping one +config_paths entry.
  • Multiple / mixed / same-type: give blocks distinct instance names and reference each explicitly

Changes

  • Add nemo_gym.sandbox.resolve_provider_config: resolves a sandbox name from the merged config or an inline single-key mapping to a single {provider: config} dict for create_provider.
  • Add nemo_gym/sandbox/providers/opensandbox/configs/opensandbox.yaml defining the named sandbox block (provider connection/create/probe/operations).
  • Make responses_api_agents/mini_swe_agent_2 provider-neutral: sandbox_provider accepts a name (default) or inline mapping; the reference is resolved at runtime. Renamed mini_swe_agent_opensandbox.yamlmini_swe_agent_2.yaml.
  • README documents the single concept plus single / swap / multi-sandbox usage.
  • Unit tests for the resolver and the named-reference agent path.

This PR does not add specific parse-time validation for the sandbox providers, so misconfigurations are still discovered at runtime. If needed, we can add a top-level named-block for the sandbox providers in the config for early validation to run against.

Refs #1377

Test plan

  • uv run pytest tests/unit_tests/test_sandbox.py tests/unit_tests/test_opensandbox_provider.py responses_api_agents/mini_swe_agent_2/tests/
  • End-to-end config composition verified through GlobalConfigDictParser: agent + provider YAMLs merge, the sandbox block survives, and sandbox_provider: sandbox resolves to the opensandbox config

Sandbox providers are now defined as named blocks in their own config
files (e.g. nemo_gym/sandbox/providers/opensandbox/configs/opensandbox.yaml)
that agents reference by name (sandbox_provider: sandbox). Swapping
providers becomes swapping one config path in +config_paths, with no edits
to the agent config.

- Add resolve_provider_config to resolve a sandbox name (or an inline
  single-key mapping) to a single provider config.
- Make mini_swe_agent_2's config provider-neutral and resolve the
  reference at runtime.
- Document single / swap / multiple-sandbox usage, including distinct
  instance names for mixing providers or running two configs of the same
  provider type.

Refs NVIDIA-NeMo#1377

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@ananthsub
ananthsub requested a review from hemildesai June 24, 2026 08:29
@ananthsub
ananthsub requested a review from Glorf June 24, 2026 08:29
@ananthsub ananthsub changed the title feat(sandbox): decouple sandbox provider config from agent config feat (sandbox): decouple sandbox provider config from agent config Jun 24, 2026
@ananthsub

Copy link
Copy Markdown
Contributor Author

Re-opened on upstream as a stack: #1708 (decouple sandbox provider config) → #1709 (provider default sandbox metadata). Closing this fork-based PR in favor of the stacked PRs.

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