Skip to content

chore(server): drop redundant ray_enabled = False declarations - #4470

Merged
marta-sd merged 1 commit into
mainfrom
ananthsub/drop-redundant-ray-enabled
Oct 13, 2026
Merged

marta-sd merged 1 commit into
mainfrom
ananthsub/drop-redundant-ray-enabled

Conversation

@ananthsub

Copy link
Copy Markdown
Contributor

What changed

ray_enabled defaults to False since #4307, so only servers that use Ray need to declare it.

  • Server classes: removes the explicit ray_enabled = False from the 212 classes that set it, across resources, agent, model and environment servers. The 18 servers that use Ray keep ray_enabled = True.
  • Scaffold: the templates for new resources and agent servers no longer emit ray_enabled = False.
  • Audit (tests/unit_tests/test_ray_opt_out.py): checks that a server class declares ray_enabled = True exactly when it uses Ray. It still accepts an explicit False, so syncing this change into a branch that still has those lines doesn't fail.
  • Docs: the deployment topology and system design pages say "servers that don't declare ray_enabled = True" instead of "servers declaring ray_enabled = False".

Why

The explicit declarations were needed while an undeclared server still defaulted to using Ray. Now they're noise, and the scaffold kept copying them into new servers. The only declaration that carries information is ray_enabled = True.

Part of #3669.

Validation

  • No behavior change: before removing each line, I followed every affected class up through its base classes, across modules, to confirm none declared False to override a parent that declares True. All 212 inherit False. Seventeen of them inherit through the GymnasiumServer, AviaryResourcesServer and LangGraphAgentAdapter base classes, which I checked directly.
  • The audit still catches mistakes:
    • deleting True from code_gen fails it with "uses Ray but doesn't declare ray_enabled = True";
    • adding True to mcqa fails it with "declares ray_enabled = True but doesn't use Ray".
  • Unit tests: the full tests/unit_tests/ run with -m "not sandbox" in the core CI job's environment (with --extra ray) passes.
  • Compilation and lint: every changed Python file compiles. One file with CRLF line endings keeps them.
  • fern check passes.
  • pre-commit run on the changed files.

Rollout evidence

Smoke run: gym env start with example_single_tool_call and openai_model. All four servers (resources, simple agent, legacy agent environment server and OpenAI model) no longer mention ray_enabled. All four reached ready without starting Ray and without warnings. No model requests were sent. Declarations only; this doesn't change prompts, trajectories, verification or rewards.

Compatibility

None. Servers that don't declare ray_enabled already get False. External servers that still declare ray_enabled = False keep working.

ray_enabled now defaults to False, so only servers that use Ray need to
declare it. Remove the explicit `ray_enabled = False` from the 212
server classes that set it, and from the scaffold templates for new
resources and agent servers.

Before removing each line, I checked that no class declared False to
override a parent that declares True: every one inherits False from
its parents, so behavior is unchanged.

The source audit now checks that servers declare ray_enabled = True
exactly when they use Ray. It accepts an explicit False on other
servers, so syncing this into a branch that still has them doesn't
fail.

Signed-off-by: Ananth Subramaniam <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

@yaoyu-33 yaoyu-33 added area:core Shared APIs, servers, telemetry, health, and registries complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer labels Oct 12, 2026
@ananthsub
ananthsub requested a review from hemildesai October 12, 2026 17:23
@marta-sd
marta-sd added this pull request to the merge queue Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Merge queue validation started! You can track the progress here: https://github.com/NVIDIA-NeMo/Gym/actions/runs/38381015082

Merged via the queue into main with commit 1c1d208 Oct 13, 2026
54 checks passed
@marta-sd
marta-sd deleted the ananthsub/drop-redundant-ray-enabled branch October 13, 2026 10:20
tanishku added a commit to tanishku/Gym that referenced this pull request Oct 14, 2026
Complying with NVIDIA-NeMo#4470, we have removed the line.

Signed-off-by: Tanish Kushalkar <[email protected]>
yaoyu-33 added a commit to yaoyu-33/Gym that referenced this pull request Oct 19, 2026
Resolves three modify/delete conflicts in
`responses_api_agents/hermes_sandboxed_agent/` by keeping this branch's
deletion. Since the merge base, main changed that directory in four commits:

- NVIDIA-NeMo#3886 made the adapter a checkpoint participant, sending
  `CHECKPOINT_CLOSE_FOLLOWS_HEADER` on close.
- A hardening change added `MAX_OUTPUT_BYTES` and `_download_output_tail`,
  bounding harness output inside the sandbox before transfer.
- NVIDIA-NeMo#3902 and NVIDIA-NeMo#4470 made incidental edits.

Discarding that work is deliberate. The checkpoint participation it added is
not lost: NVIDIA-NeMo#3886 gave the same header to the environment servers, so
`environment_servers/single_agent_turn/app.py` already sends it on the session
path this branch migrates to. The output-bounding change applied only to the
removed runner; the retained agent reads its harness log through
`SandboxSession.read_output_log`, which is unbounded, so that gap is tracked
separately against the retained path rather than carried here.

No reference to the removed component survives outside the migration note in
`responses_api_agents/hermes_agent/README.md`, and nothing main added since
the merge base refers to it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@linear-code linear-code Bot mentioned this pull request Nov 12, 2026
8 of 26 tasks

This branch was previously deployed

1 inactive deployment
public — cedf7a1d Deployed Oct 12, 2026 by copy-pr-bot[bot] via release / finalize / notify #5033
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core Shared APIs, servers, telemetry, health, and registries complexity:medium Single-domain change with interacting parts or a moderate review surface feature New capabilities, enhancements, or enablement work needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants