File size: 4,392 Bytes
b3e698c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
license: cc-by-4.0
task_categories:
  - text-generation
tags:
  - agent-trajectories
  - tool-calling
  - sft
  - openhands
  - swe-bench
  - qwen3-coder
size_categories:
  - 1K<n<10K
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-00000-of-00001.parquet
---

# openhands-train-ready

**SFT-ready normalization** of
[nebius/SWE-rebench-openhands-trajectories](https://huggingface.co/datasets/nebius/SWE-rebench-openhands-trajectories)
— 5,000 resolved OpenHands (v0.54.0) agent trajectories on real GitHub issues,
bootstrapped by `Qwen/Qwen3-Coder-480B-A35B-Instruct`, with **tool-call
arguments deserialized to objects** so chat templates just work.

## What was fixed

The upstream parquet stores `tool_call.function.arguments` as a serialized
JSON *string* "for storage efficiency" (per the Nebius README). Chat templates
that iterate `arguments|items` — including the Qwen3-Coder family — emit
empty/broken tool calls if you train on the raw rows. Every record here has:

- `arguments` deserialized `str → dict` (double-encoded JSON and Python-repr
  dicts handled),
- canonical per-role fields (`system`/`user`/`assistant`/`tool`),
- the per-trajectory `tools` list kept on the record — pass it straight to
  `apply_chat_template`.

## Usage

```python
from datasets import load_dataset
from transformers import AutoTokenizer

ds = load_dataset("asaverren/openhands-train-ready", split="train")
tok = AutoTokenizer.from_pretrained("Qwen/Qwen3-Coder-30B-A3B-Instruct")

ex = ds[0]
text = tok.apply_chat_template(ex["messages"], tools=ex["tools"], tokenize=False)
```

TRL/axolotl: point your chat-template mapping at the `messages` column;
`tools` is a per-row column for templates that accept it.

## Qwen3-Coder tool-call format (verified)

- Assistant calls render as `<tool_call><function=NAME><parameter=KEY>VALUE
  </parameter></function></tool_call>` inside the `<|im_start|>assistant` turn.
- `arguments` must be a mapping — the template iterates `arguments|items`.
  (This is the upstream storage bug this dataset fixes.)
- Tool results render as `<tool_response>...</tool_response>` inside a `user`
  turn; `name`/`tool_call_id` are kept for provenance but unused by the template.

## Counts (see `meta.json`)

| | |
|---|---|
| upstream rows scanned | 67,074 |
| upstream resolved | 32,161 |
| this shard (resolved, seed-0 sample) | 5,000 |
| tool-call arguments deserialized | 295,524 |
| unparseable arguments | 0 |
| unknown tools / missing required params | 0 / 0 |
| trajectories dropped | 0 |
| avg tokens (Qwen3-Coder tokenizer) | ≈ 49k / trajectory |

Tool calls validated against upstream `tools.json` (soft; all calls match the
5-tool OpenHands v0.54.0 set). All 5,000 records render through the real
Qwen3-Coder chat template with zero errors.

## Rebuild / extend

`run_normalize.py` (+ the `traj_normalize` package, both in this repo) reproduces this shard and can emit the full 32k resolved
set (or failure trajectories via `--include-failures`):

```bash
pip install pyarrow huggingface_hub
python run_normalize.py --input nebius/SWE-rebench-openhands-trajectories \
  --out-dir out --max-success 5000 --seed 0 --shuffle
```

`sft_success.jsonl.gz` is the raw tool output; `data/` is the same content as
parquet for `load_dataset` + viewer support.

## Honest limitations

- `resolved` is upstream's SWE-bench-style judgment — **no re-execution
  verification** was performed downstream.
- Trajectories are long (~49k tokens avg); filter/truncate to your context
  budget.
- Single bootstrap model (Qwen3-Coder-480B) and single scaffold
  (OpenHands v0.54.0) — behavior/diversity is bounded accordingly.
- Same-instance duplicates are possible (upstream samples multiple attempts
  per issue); dedupe on `instance_id` if that matters to you.

## Attribution & license

Upstream data: [Nebius](https://nebius.com/blog/posts/openhands-trajectories-with-qwen3-coder-480b),
**CC-BY-4.0**. This derivative shard redistributes normalized data under the
same license — please attribute Nebius.

```bibtex
@article{trofimova2025openhandstrajs,
  title={OpenHands Trajectories with Qwen3-Coder-480B-A35B-Instruct},
  author={Trofimova, Maria and Shevtsov, Anton and Ibragim, Badertdinov and Pyaev, Konstantin and Karasik, Simon and Golubev, Alexander},
  year={2025},
  journal={Nebius blog},
}
```