SWE-Pruner Pro: The Coder LLM Already Knows What to Prune
Paper • 2607.18213 • Published • 71
Error code: DatasetGenerationError
Exception: TypeError
Message: Couldn't cast array of type
struct<command: string, keystrokes: string, duration: double>
to
{'command': Value('string')}
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1816, in _prepare_split_single
for key, table in generator:
^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 613, in wrapped
for item in generator(*args, **kwargs):
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
self._cast_table(pa_table, json_field_paths=json_field_paths),
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
pa_table = table_cast(pa_table, self.info.features.arrow_schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2369, in table_cast
return cast_table_to_schema(table, schema)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2303, in cast_table_to_schema
cast_array_to_feature(
~~~~~~~~~~~~~~~~~~~~~^
table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
feature,
^^^^^^^^
)
^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1852, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2059, in cast_array_to_feature
_c(array.field(name) if name in array_fields else null_array, subfeature)
~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1854, in wrapper
return func(array, *args, **kwargs)
File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2149, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
TypeError: Couldn't cast array of type
struct<command: string, keystrokes: string, duration: double>
to
{'command': Value('string')}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
~~~~~~~~~~~~~~~~~~~~~~~~~^
builder, max_dataset_size_bytes=max_dataset_size_bytes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1683, in _prepare_split
for job_id, done, content in self._prepare_split_single(
~~~~~~~~~~~~~~~~~~~~~~~~~~^
gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1869, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
instance_id string | step_idx int64 | tool_call dict | tool_response string | kept_frags list | total_lines int64 | history list | next_turn list | _labeler string | _model string | _source string | _skeleton bool | _reasoning string | _confidence string |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mswe_javascript_iamkun__dayjs-1019 | 15 | {
"name": "execute_bash",
"arguments": {
"command": "edit 21:37\nend_of_edit\n"
}
} | [File: /home/dayjs/reproduce.js (20 lines total)]
1:const dayjs = require('./dayjs.min.js');
2:
3:// First ensure the localeData plugin is loaded
4:dayjs.extend(require('./plugin/localeData'));
5:
6:console.log('Testing global localeData:');
7:try {
8: const globalWeekdays = dayjs.localeData().weekdays();
9: console.... | [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21
] | 22 | [
{
"role": "assistant",
"content": "DISCUSSION\nOkay, let's start by reproducing the bug as described in the issue. I'll create a Javascript file named `reproduce.js` and put the code snippets from the issue description into it.\n\ncreate reproduce.js\n"
},
{
"role": "tool",
"content": "[File: /h... | [
{
"role": "assistant",
"content": "DISCUSSION\nIt looks like `src/index.js` is the entry point. Let's modify `reproduce.js` again to require `'./src'` instead of `'.'`. Node.js should automatically resolve this to `src/index.js`.\n\nedit 1:1\nconst dayjs = require('./src');\nend_of_edit\n"
},
{
"rol... | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | The agent just updated reproduce.js and the final file content is what matters for next steps. | confident |
mswe_javascript_iamkun__dayjs-1019 | 3 | {
"name": "execute_bash",
"arguments": {
"command": "node reproduce.js\n"
}
} | node:internal/modules/cjs/loader:1215
throw err;
^
Error: Cannot find module './index'
Require stack:
- /home/dayjs/reproduce.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
at Module._load (node:internal/modules/cjs/loader:1043:27)
at Module.require (node:internal/modules/cjs/... | [
5
] | 22 | [
{
"role": "assistant",
"content": "DISCUSSION\nOkay, I understand the issue. The `dayjs.duration()` function doesn't seem to correctly parse the week component (`W`) from ISO 8601 duration strings.\n\nFirst, I'll create a script to reproduce the bug as described in the issue. I'll name it `reproduce_bug.js`... | [
{
"role": "assistant",
"content": "DISCUSSION\nAh, it seems the `dayjs` module is not installed in this environment. I need to install the project dependencies first. I'll check if there's a `package.json` file and then use `npm` to install the dependencies.\n\nls package.json\n"
},
{
"role": "assis... | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | Agent needs to see the error to understand the module not found issue. Key lines are the error message. | confident |
mswe_javascript_iamkun__dayjs-1019 | 25 | {
"name": "execute_bash",
"arguments": {
"command": "open reproduce.js\n"
}
} | [File: /home/dayjs/reproduce.js (20 lines total)]
1:const dayjs = require('./dayjs.min.js');
2:
3:// First ensure the localeData plugin is loaded
4:dayjs.extend(require('./plugin/localeData'));
5:
6:console.log('Testing global localeData:');
7:try {
8: const globalWeekdays = dayjs.localeData().weekdays();
9: console.... | [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21
] | 21 | [
{
"role": "assistant",
"content": "DISCUSSION\nOkay, let's start by reproducing the bug as described in the issue. I'll create a Javascript file named `reproduce.js` and put the code snippets from the issue description into it.\n\ncreate reproduce.js\n"
},
{
"role": "tool",
"content": "[File: /h... | [
{
"role": "assistant",
"content": "DISCUSSION\nOops! The edit command updated the wrong file. It seems we're still editing the localeData plugin file, but we meant to update the reproduce.js file. Let's undo this change and then properly update the reproduce.js file.\n\nFirst, let's restore the original loc... | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | The agent is viewing reproduce.js to understand its current state before making edits. All lines are relevant as the file is short and the agent needs the full context. | confident |
mswe_javascript_iamkun__dayjs-1019 | 10 | {
"name": "execute_bash",
"arguments": {
"command": "edit 1:2\n{\n \"name\": \"dayjs\",\nend_of_edit\n"
}
} | [File: /home/dayjs/package.json (101 lines total)]
1:{
2: "name": "dayjs",
3: "version": "0.0.0-development",
4: "description": "2KB immutable date time library alternative to Moment.js with the same modern API ",
5: "main": "dayjs.min.js",
6: "types": "index.d.ts",
7: "module": "dayjs.min.js",
8: "scripts": {
9... | [
1,
2,
3,
4,
5,
6,
7,
103
] | 103 | [
{
"role": "assistant",
"content": "DISCUSSION\nOkay, let's start by reproducing the bug as described in the issue. I'll create a Javascript file named `reproduce.js` and put the code snippets from the issue description into it.\n\ncreate reproduce.js\n"
},
{
"role": "tool",
"content": "[File: /h... | [
{
"role": "tool",
"content": "ls: cannot access 'dist/': No such file or directory"
}
] | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | The agent is fixing package.json which got corrupted. The key lines are the first few showing the fix worked correctly. | confident |
mswe_javascript_iamkun__dayjs-1019 | 14 | {
"name": "execute_bash",
"arguments": {
"command": "edit 1:3\nconst dayjs = require('./dayjs.min.js');\n\n// First ensure the localeData plugin is loaded\ndayjs.extend(require('./plugin/localeData'));\n\nconsole.log('Testing global localeData:');\ntry {\n const globalWeekdays = dayjs.localeData().weekdays();\... | [File: /home/dayjs/reproduce.js (37 lines total)]
1:const dayjs = require('./dayjs.min.js');
2:
3:// First ensure the localeData plugin is loaded
4:dayjs.extend(require('./plugin/localeData'));
5:
6:console.log('Testing global localeData:');
7:try {
8: const globalWeekdays = dayjs.localeData().weekdays();
9: console.... | [
1,
2,
4,
5,
7,
8,
9,
10,
11,
12,
14,
15,
16,
17,
18,
19,
20,
21,
22,
37,
38,
39
] | 39 | [
{
"role": "assistant",
"content": "DISCUSSION\nOkay, let's start by reproducing the bug as described in the issue. I'll create a Javascript file named `reproduce.js` and put the code snippets from the issue description into it.\n\ncreate reproduce.js\n"
},
{
"role": "tool",
"content": "[File: /h... | [
{
"role": "assistant",
"content": "DISCUSSION\nGreat! The build succeeded. Now let's update our reproduction script to use the built version.\n\n\nedit 1:3\nconst dayjs = require('./dayjs.min.js');\n\n// First ensure the localeData plugin is loaded\ndayjs.extend(require('./plugin/localeData'));\n\nconsole.l... | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | The agent is updating reproduce.js to use the built dayjs.min.js and needs to see the current file state, particularly that lines 21-37 contain duplicate/leftover content that needs to be removed. | confident |
mswe_javascript_iamkun__dayjs-1019 | 36 | {"name":"execute_bash","arguments":{"command":"edit 20:26\n firstDayOfWeek: () => this.$locale((...TRUNCATED) | "[File: /home/dayjs/src/plugin/localeData/index.js (54 lines total)]\n1:export default (o, c, dayjs)(...TRUNCATED) | [1,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,46,47,4(...TRUNCATED) | 56 | [{"role":"assistant","content":"DISCUSSION\nOkay, let's start by reproducing the bug as described in(...TRUNCATED) | [{"role":"assistant","content":"DISCUSSION\nPerfect! Now I can see the original file. The issue is t(...TRUNCATED) | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | "Agent just edited the file and needs to verify the result is correct. The key lines are the updated(...TRUNCATED) | confident |
mswe_javascript_iamkun__dayjs-1019 | 7 | {
"name": "execute_bash",
"arguments": {
"command": "edit 20:36\nend_of_edit\n"
}
} | "[File: /home/dayjs/reproduce.js (19 lines total)]\n1:const dayjs = require('./src/index');\n2:\n3:/(...TRUNCATED) | [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21
] | 21 | [{"role":"assistant","content":"DISCUSSION\nOkay, let's start by reproducing the bug as described in(...TRUNCATED) | [{"role":"assistant","content":"DISCUSSION\nLooks like the edit duplicated the test blocks. Let's cl(...TRUNCATED) | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | "Agent is verifying the file looks correct after cleanup. The full file content is needed to confirm(...TRUNCATED) | confident |
mswe_javascript_iamkun__dayjs-1019 | 31 | {"name":"execute_bash","arguments":{"command":"edit 24:30\n (instance ? instance.format('ddd'(...TRUNCATED) | "[File: /home/dayjs/src/plugin/localeData/index.js (55 lines total)]\n1:export default (o, c, dayjs)(...TRUNCATED) | [1,2,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(...TRUNCATED) | 57 | [{"role":"assistant","content":"DISCUSSION\nOkay, let's start by reproducing the bug as described in(...TRUNCATED) | [{"role":"assistant","content":"DISCUSSION\nLet's add a unit test to verify both global and instance(...TRUNCATED) | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | "Agent is verifying the localeData plugin file looks correct after edits. Key structural lines neede(...TRUNCATED) | confident |
mswe_javascript_iamkun__dayjs-1019 | 26 | {"name":"execute_bash","arguments":{"command":"edit 2:2\nconst localeData = require('./plugin/locale(...TRUNCATED) | "[File: /home/dayjs/reproduce.js (23 lines total)]\n1:const dayjs = require('.');\n2:const localeDat(...TRUNCATED) | [
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
] | 25 | [{"role":"assistant","content":"DISCUSSION\nOkay, let's start by reproducing the bug as described in(...TRUNCATED) | [{"role":"assistant","content":"DISCUSSION\nGreat! Let's update the reproduce.js file to add a succe(...TRUNCATED) | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | false | "Agent is editing reproduce.js to fix duplicate line and add success message. Needs to see current f(...TRUNCATED) | confident |
mswe_javascript_anuraghazra__github-readme-stats-1378 | 15 | {
"name": "execute_bash",
"arguments": {
"command": "open src/cards/repo-card.js\n"
}
} | "[File: /home/github-readme-stats/src/cards/repo-card.js (180 lines total)]\n1:const {\n2: kFormatt(...TRUNCATED) | [1,2,3,4,5,6,7,8,9,10,11,12,13,14,21,22,41,42,43,44,45,46,47,50,51,52,69,70,71,72,73,74,75,76,77,78,(...TRUNCATED) | 102 | [{"role":"assistant","content":"DISCUSSION\nLet's start exploring the issue that needs to be fixed. (...TRUNCATED) | [{"role":"assistant","content":"DISCUSSION\nLet me open the repo-card.js file again and then make th(...TRUNCATED) | claude | claude-sonnet-4-6 | ByteDance-Seed/Multi-SWE-bench_trajs | true | "Agent is viewing repo-card.js to make edits. Keep structural landmarks and the renderRepoCard funct(...TRUNCATED) | skeleton |
Training data for SWE-Pruner Pro, a lightweight in-agent context pruner for long-horizon coding agents.
| Field | Description |
|---|---|
| instance_id | SWE-bench instance identifier |
| step_idx | Step index within the trajectory |
| tool_call | The agent tool call that produced the response |
| tool_response | Raw tool response (to be pruned) |
| kept_frags | Line ranges marked as "keep" |
| total_lines | Total lines in tool_response |
| history | Preceding conversation context |
| next_turn | The agent's next action (used to verify pruning doesn't lose info) |
| _labeler | Annotation tool (claude) |
| _model | Specific model used for annotation |
| _source | Source trajectory dataset |
| _skeleton | Whether this is a skeleton-format sample |
| _reasoning | Natural language explanation of keep/prune decisions |
| _confidence | Annotator confidence level |
from datasets import load_dataset
dataset = load_dataset("ayanami-kitasan/swe-pruner-pro-training-corpus")
For training and inference usage, please refer to the GitHub repository.