Skip to content

feat: adapt trajectory visualizer to work with results.tar.gz from OpenHands Index#36

Draft
juanmichelini wants to merge 13 commits intomainfrom
feat/adapt-for-openhands-index-v2
Draft

feat: adapt trajectory visualizer to work with results.tar.gz from OpenHands Index#36
juanmichelini wants to merge 13 commits intomainfrom
feat/adapt-for-openhands-index-v2

Conversation

@juanmichelini
Copy link
Copy Markdown
Collaborator

Summary

This PR adapts the trajectory visualizer to work with results.tar.gz archives from OpenHands Index. The archive extraction feature allows users to:

  1. Load archives via URL parameter - Use ?full_archive=<url> to load and extract tar.gz archives containing output.jsonl and output.report.json files
  2. Support archive file URLs - When ?fileUrl= points to a .tar.gz or .tgz file, the app automatically extracts and processes the contents
  3. Display extracted JSONL data - The visualizer renders the extracted JSONL content with the same viewer used for other trajectory formats

Changes

New Files

  • src/utils/archive-extractor.ts - Utility for extracting tar.gz archives using pako (gzip decompression) and tar-stream (tar parsing)
  • src/utils/__tests__/archive-extractor.test.ts - Comprehensive tests for archive extraction functionality

Modified Files

  • src/App.tsx - Added full_archive parameter handling and archive URL detection, with loading/error states
  • src/components/RunDetails.tsx - Added support for full_archive file type to render JSONL viewer
  • src/types/upload.ts - Added FullArchiveUploadContent interface
  • package.json / package-lock.json - Added dependencies: tar-stream, pako, @types/tar-stream, @types/pako

Technical Details

The archive extraction is performed client-side using:

  • pako for gzip decompression
  • tar-stream for tar archive parsing
  • The extract function looks for output.jsonl and output.report.json files within the archive

Usage Example

https://trajectory-visualizer.vercel.app/?full_archive=https://example.com/artifacts/results.tar.gz

Or with a file URL that points to an archive:

https://trajectory-visualizer.vercel.app/?fileUrl=https://github.com/org/repo/results.tar.gz

@juanmichelini can click here to continue refining the PR

…enHands Index

- Added archive-extractor utility for extracting tar.gz archives containing output.jsonl
- Added support for full_archive file type in upload types
- Integrated archive extraction into App.tsx with support for ?full_archive URL parameter
- Added support for ?fileUrl pointing to archive URLs
- Updated RunDetails component to handle full_archive JSONL viewer
- Added comprehensive tests for archive extraction
- Added tar-stream, pako dependencies for client-side archive extraction
- Fixed TypeScript build error in archive-extractor (tar-stream types)
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
trajectory-visualizer Ready Ready Preview, Comment Apr 10, 2026 8:42pm

Request Review

The tar-stream library brings in Node.js dependencies (events-universal)
that cause issues in Vercel's edge runtime. Rewrote the tar parsing
logic to use native browser APIs (TextDecoder, Uint8Array) without
external dependencies. This reduces bundle size and fixes the blank
page issue on Vercel preview deployments.
- Added /api/extract endpoint that fetches and extracts tar.gz on server
- Updates frontend to use the API instead of client-side fetching
- Bypasses CORS restrictions for external URLs
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.

2 participants