feat(rollout): export system_prompt and tools for training data#258
Merged
Conversation
The global patch fell back to the original SDK when no ContextVar strategy was active, which meant trajectory saving (outside _fetch_response) lost all reasoning items. Now auto-detects reasoning items and uses DeepSeekReasoningStrategy as fallback to inject reasoning_content. Also removes premature filtering in ChatCompletionConverter.items_to_messages so reasoning items reach the global patch, and adds a concurrent rollout test script (examples/rollout/run_concurrent.py). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add extract_system_and_tools() to capture agent instructions and tool definitions (via Converter.tool_to_openai) in chat.completions format, so JSONL output contains all fields needed for training pipelines. 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
extract_system_and_tools()to capture agent instructions and tool definitions in OpenAI chat.completions formatsystem_promptandtoolsfields alongside messages with reasoning — ready for training pipelinesChanges
examples/rollout/run_concurrent.py: extract system prompt fromAgent.instructions, convert tools viaConverter.tool_to_openai, report in summaryCloses #253