Add DeepSeek Harness rollout parsing - #35
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 30b121e98b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| header = next(_read_trace_events(handle, skip_invalid_lines=skip_invalid_lines), None) | ||
| if _is_deepseek_session_header(header): | ||
| sessions.setdefault(path.parent, []).append((int(match[1] or 0), path)) | ||
| continue |
There was a problem hiding this comment.
Deduplicate only files from the same session
When a directory contains canonically named DeepSeek files from different session IDs—for example, session.v1.jsonl and session.v2.jsonl copied into a flat collection—this groups them solely by parent directory and silently retains only the highest filename version. Since directory conversion otherwise supports arbitrary collections of traces, this can drop an independent rollout; include the session header ID in the grouping key (and only treat matching IDs as migration copies).
Useful? React with 👍 / 👎.
| message: dict[str, Any] = { | ||
| "role": "tool", "tool_call_id": call_id, | ||
| "content": _deepseek_text(block["content"]), | ||
| } |
There was a problem hiding this comment.
Preserve DeepSeek tool error status
When a native tool-result block has isError: true, this message construction discards that field, so the converted row represents failed tool executions identically to successful results. Other converters and message normalization preserve this as is_error, and losing it can teach the model an incorrect interpretation of error output; copy the block's error flag onto the emitted tool message.
Useful? React with 👍 / 👎.
DeepSeek Harness session logs were misclassified as Pi, and compressed logs were not discovered. Add automatic v0/v1/v2 parsing through
teich convert,load_traces(), andprepare_data()for plain JSONL and Zstandard-compressed sessions.The converter projects the effective conversation after compaction, preserves reasoning, tool-call arguments, and tool error flags, uses the latest request header for system instructions and tool schemas, and selects the newest native version per session ID within a directory when migration copies coexist. Streaming/execution records do not duplicate assembled messages. Includes a synthetic example and documentation; this adds rollout parsing only, with unresolved attachments reported explicitly.
Validation:
Docker/API integration and live tokenizer smoke tests were not run.