Repository navigation
Description
Describe the bug
When trying to requery the same server_client instance in multi-turn scenarios, the session_id isn't always consistent. This makes it difficult to maintain environment state across multiple turns.
User's workaround: Currently passing session_id manually with each step command.
# 1. Create server_client and get initial session_id from seed_session
server_client = ServerClient.load_from_global_config()
reset_task = await server_client.post(
server_name="tales",
url_path="/seed_session",
json={
"framework": framework,
"task_no": task_no,
"max_episode_steps": max_steps,
"seed": seed,
"split": split,
},
)
output = await reset_task.json()
session_id = output["session_id"] # Store session_id manually
# 2. On subsequent calls in multi-turn loop, must explicitly pass session_id
for _ in range(25):
# Query model...
# Must manually pass session_id with each command
action_task = await server_client.post(
server_name="tales",
url_path="/execute_command",
json={"command": action, "session_id": session_id}, # <-- Manual session_id
)
output = await action_task.json()
Steps/Code to reproduce bug
Please list minimal steps or code snippet for us to be able to reproduce the bug.
A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports.
Expected behavior
Session ID should remain consistent for the same server_client instance throughout a multi-turn interaction.
server_client = ServerClient.load_from_global_config()
# Session created
reset_task = await server_client.post(server_name="tales", url_path="/seed_session", json={...})
# Subsequent calls automatically use same session without manual session_id
action_task = await server_client.post(
server_name="tales",
url_path="/execute_command",
json={"command": action} # No session_id needed
)
Additional context
@christopherzc mentioned in PR: #203
resources_servers/tales/example_scripts/multi_turn/generate_gpt_rollouts.py lines 54, 75
resources_servers/tales/example_scripts/single_turn/generate_single_turn_gpt_rollouts.py lines 70, 103
Activity
christopherzc commentedon Oct 27, 2025
I've added a script to illustrate this behavior.
This script calls the 'execute_bug' function from the server, which is a replica of the 'execute_command' function without the workaround. This results in the code erroring out due to the request returning the following error despite the environment having been initialized prior to the loop:
{'detail': 'Session id: 6027bff9-8011-4263-ab52-bdc52cd79dbb not initialized. Please call seed_session first.'}cwing-nvidia commentedon Oct 30, 2025
Also impacts swe agent, need to address this as fast-follow after v0.1.0
fix(nemotron_3.5_super): pin a vllm-router build with prefix affinity…
fix(nemotron_3.5_super): repin vllm-router to the current head of #238 (
fix(nemotron_3.5_super): pin a vllm-router build with prefix affinity…
fix(nemotron_3.5_super): repin vllm-router to the current head of #238 (