Repository navigation
Conversation
…_legacy A `--agent-type` swap onto an environment fronted by single_agent_turn_legacy kept that server type even when the incoming agent does not implement agent sessions, so every episode failed with NotImplementedError from /v1/agent_sessions. Composition now rewrites such a server to a legacy_agent relay that calls the agent's own /run, keeping its entrypoint, agent_server and host/port. AGENT_SESSION_AGENT_TYPES in global_config is the single list of session-capable agent types; the legacy-relay migration script reads it instead of its own copy, and a unit test keeps it in step with the agent apps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: yaoyu-33 <yaoyu.094@gmail.com>
This was referenced Oct 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A
--agent-typeharness swap (harness ablation,fern/versions/latest/pages/evaluation/harness.mdx) onto an environment fronted bysingle_agent_turn_legacykept that server type even when the incoming agent does not implement agent sessions (opencode_sandboxed_agent,pi_sandboxed_agent, the swe agents,non_executing_simple_agent,tool_simulation_agent, ...). The config resolved cleanly, then every episode failed withNotImplementedErrorfrom/v1/agent_sessions. Behind alegacy_agentrelay, the same swap worked through the agent's/run.This blocks #4953, which moves ~285 simple_agent configs to
single_agent_turn_legacy. It is independent of the rest of that stack, so it is based onmain.Changes
compose_unbound_agent(innemo_gym/global_config.py): when the swapped-in agent type has no session support, eachsingle_agent_turn_legacyserver fronting a composed agent is rewritten to alegacy_agentrelay. The relay keepsentrypoint,agent_server(already retargeted), andhost/port/num_workers. It drops the session-only keys (resources_server,resources_tool_transports,agent_outcome_policy, the episode limits);legacy_agentdefaults the limits, and warns if any are set. The server keeps its environment name. An info log records the fallback./runagainst its carried-over Resources binding). AnAgentCompositionErrorwould turn a migration that should not change behavior into a regression for every session-less harness.AGENT_SESSION_AGENT_TYPESinnemo_gym/global_config.py. Composition cannot import agent apps, so this is a static list.scripts/add_legacy_agent_environment_servers.pynow imports it instead of keeping its own hard-coded set. A unit test asserts the list equals the set ofresponses_api_agents/*/app.pythat define_seed_agent_session_state, so it cannot silently drift.simple_agent,nooa_agent,stirrup_agent), and only affects instances with an explicitresources_server: null.python scripts/add_legacy_agent_environment_servers.py --checkreports 0 files touched, so no repo config changes.No issue filed: found in review of the #4952 → #4953 → #4954 stack.
Validation
pytest tests/unit_tests/test_global_config.py tests/unit_tests/test_add_legacy_agent_environment_servers.py: 304 passed. New tests:opencode_sandboxed_agent,non_executing_simple_agent) →legacy_agentrelay with onlyentrypoint+ retargetedagent_serverhermes_agent,opencode_agent) → stayssingle_agent_turn_legacy, every key preserved,agent_serverretargetedAGENT_SESSION_AGENT_TYPESmatches the agent apps that implement_seed_agent_session_statepytest tests/unit_tests: 38 failures + 2 collection errors locally (opensandbox, reward_profile, super35 launcher, telemetry imports). The same tests fail identically on the base commit, so they are not from this change.python scripts/add_legacy_agent_environment_servers.py --check: 0 files touched.pre-commit run --fileson the changed files: passed.benchmarks/gpqa/config.yamlandresources_servers/mcqa/configs/mcqa.yamlapplied locally (not committed),gym env resolvewith anopenai_modelconfig:--config responses_api_agents/opencode_sandboxed_agent/configs/opencode_sandboxed_agent.yaml→gpqa_mcqa_environment_serverislegacy_agentfrontinggpqa_mcqa_opencode_sandboxed_agent(before:single_agent_turn_legacy)opencode_agentwith its resources binding left unset → stayssingle_agent_turn_legacyfrontinggpqa_mcqa_opencode_agentRollout evidence
N/A: composition-only change. The resolved config is the same
legacy_agentrelay these swaps used onmainbefore #4953. No model rollouts were run.Compatibility
No change on
maintoday: no shipped config usessingle_agent_turn_legacyyet. After #4953, session-less harness swaps work again; session-capable swaps are unchanged.🤖 Generated with Claude Code