Skip to content

feat(rollout): export system_prompt and tools for training data#258

Merged
Lightblues merged 2 commits into
mainfrom
example/rollout
Mar 21, 2026
Merged

feat(rollout): export system_prompt and tools for training data#258
Lightblues merged 2 commits into
mainfrom
example/rollout

Conversation

@Lightblues

Copy link
Copy Markdown
Collaborator

Summary

  • Add extract_system_and_tools() to capture agent instructions and tool definitions in OpenAI chat.completions format
  • JSONL output now includes system_prompt and tools fields alongside messages with reasoning — ready for training pipelines

Changes

  • examples/rollout/run_concurrent.py: extract system prompt from Agent.instructions, convert tools via Converter.tool_to_openai, report in summary

Closes #253

Lightblues and others added 2 commits March 20, 2026 12:08
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>
@Lightblues Lightblues merged commit c2caa53 into main Mar 21, 2026
1 of 2 checks passed
@Lightblues Lightblues deleted the example/rollout branch March 21, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: concurrency-safe reasoning field patch | easons_agent

1 participant