feat: Add submit_final_answer synthetic tool for carlisle tasks#11
Merged
Conversation
Carlisle tasks (354 total, 8 in eval) require models to call submit_final_answer to submit results, but this tool is a harness-level synthetic injected by the orchestrator's SessionWorkflow, not an MCP tool. OpenEnv connects directly to MCP servers, so the tool was missing — causing 0% scores across all carlisle tasks in training. Changes: - Inject submit_final_answer into tool list when prompt references it - Intercept calls locally (not routed to MCP), store the answer - Pass final_answer to verifier via Fleet SDK's verify_detailed() - Run verifier in close()/close_async() for orphaned rollouts - Add unit tests for the synthetic tool Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| # so that models can submit answers during SkyRL training exactly as | ||
| # they would in a Fleet harness session. | ||
| if self.modality == "tool_use" and "submit_final_answer" in self.prompt: | ||
| self._tools_cache.append(SUBMIT_FINAL_ANSWER_TOOL) |
There was a problem hiding this comment.
Shared mutable dict reference risks cross-instance corruption
Low Severity
SUBMIT_FINAL_ANSWER_TOOL is a mutable module-level dict that gets appended by reference to _tools_cache. The tools list is then exposed in observations via obs["tools"]. If any downstream consumer (e.g., training framework, logging, serialization) mutates a tool dict in-place, it would corrupt the shared constant for all future FleetTaskEnv instances. A shallow copy (e.g., copy.deepcopy(SUBMIT_FINAL_ANSWER_TOOL)) at append time would prevent this.
Additional Locations (1)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.


Summary
submit_final_answeras a synthetic tool for tasks whose prompt references it (mirrors the harness'sANSWER_SUBMISSION_TOOLfromorchestrator/temporal/workflows/constants.py)final_answerto verifier via Fleet SDK'sverify_detailed(**kwargs)so carlisle verifiers likeverify(env, final_answer=None)receive the submitted answerclose()/close_async()for orphaned rollouts (context overflow, max_turns) instead of defaulting to 0.0Context
All 354 carlisle tasks reference
submit_final_answerin their prompts, but this tool is a harness-level synthetic — not an MCP tool. OpenEnv connects directly to the MCP server (13 tools: bash, duckdb_query, etc.), so the tool was missing. Models would call it, get "Tool not found on any active MCP endpoint", and loop until max turns. This is why carlisle is 0% across all training iterations.Test plan
TestSubmitFinalAnswer)🤖 Generated with Claude Code