Repository navigation
Conversation
Signed-off-by: ashors1 <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
terrykong
left a comment
There was a problem hiding this comment.
Review Summary
Nice work adding the tau-bench multi-turn environment — the architecture is clean and the mock mode is a thoughtful addition for testing without LLM credentials. Two critical issues need attention before merge:
-
_tokenize_env_observationsilently breaks all existing multi-turn environments — the new function passesrole="environment"toapply_chat_template, which silently drops the message on Qwen/Llama templates. Math, code, sliding_puzzle, vlm, and reward_model environments would lose all observation feedback in rollouts. -
TestCallJudgeis entirely broken — fixture missing_mock_modeattribute, and all tests mockrequests.postinstead oflitellm.completion.
Additional notes (not tied to specific diff lines)
-
Documentation: This is a new feature (
feat:) but there is no user-facing documentation.docs/guides/environments.mddoes not mention tau-bench, and there is no guide analogous todocs/guides/grpo-sliding-puzzle.md. Consider adding a section. -
Design note: The pre-step mechanism wastes one generation turn per episode (~2% overhead with
max_steps=50). The tradeoff is documented in the code and reasonable, but worth noting. -
Global litellm monkey-patch: Mock mode at tau_bench_environment.py:149 patches
litellm.completionglobally at the module level. Any other code in the same worker process that useslitellm.completionwould also get the mock. Consider a more targeted patch. -
Env var clobbering:
os.environ["OPENAI_API_KEY"] = user_api_keyat tau_bench_environment.py:188 unconditionally overwrites any existing key (defaults to"dummy"from config fallback). Guard withif user_api_key:.
Generated by Claude Code
| judge_api_key="dummy", | ||
| max_steps=30, | ||
| ): | ||
| """Return a bare TauBenchWorker instance without spawning a Ray actor.""" |
There was a problem hiding this comment.
test_tau_bench_environment.py:74-92 — Broken test fixture
_make_worker() never sets _mock_mode or _mock_latency_s. When _call_judge runs if self._mock_mode: (line 266), it raises AttributeError.
Additionally, all TestCallJudge tests mock requests.post but the implementation uses litellm.completion. The mocks are never hit — tests either fail or pass for the wrong reason (the broad except Exception returns 0.0).
Suggested fix: add worker._mock_mode = False and worker._mock_latency_s = 0.0 to _make_worker(), then replace mock.patch("requests.post", ...) with mock.patch("litellm.completion", ...) and build mocks matching litellm's return type (resp.choices[0].message.content).
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
…dels Signed-off-by: Anna Shors <[email protected]>
6229f3f to
f32be23
Compare
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
Signed-off-by: Anna Shors <[email protected]>
|
/ok to test 5499b99 |
|
/ok to test a370039 |
Signed-off-by: ashors1 <[email protected]>
|
/ok to test ff60101 |
Signed-off-by: ashors1 <[email protected]>
|
/ok to test 09413fe |
Signed-off-by: ashors1 <[email protected]>
|
/ok to test 991e22f |
Signed-off-by: ashors1 <[email protected]>
|
/ok to test 5a71574 |
Signed-off-by: ashors1 <[email protected]>
|
/ok to test 224baa0 |
Signed-off-by: ashors1 <[email protected]>
|
/ok to test 9956bf7 |
Signed-off-by: ashors1 <[email protected]>
|
/ok to test ac5713b |
Signed-off-by: ashors1 <[email protected]>
|
/ok to test 7a01135 |
|
/ok to test 7a01135 |
What does this PR do ?
This PR adds a Tau bench environment to serve as an example of a multi-turn environment with an option for LLM-as-a-judge. This can be used to analyze the performance of more complicated multi-turn environments natively in NeMo-RL.
Note that we provide the option to mock user and judge models using
user_strategy='mock'andjudge_model='mock'.Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information