Skip to content

feat: auto-capture agent trajectory during benchmark tasks#2

Open
hj1650782738 wants to merge 1 commit intoQuantaAlpha:devfrom
hj1650782738:feature/trajectory-auto-capture
Open

feat: auto-capture agent trajectory during benchmark tasks#2
hj1650782738 wants to merge 1 commit intoQuantaAlpha:devfrom
hj1650782738:feature/trajectory-auto-capture

Conversation

@hj1650782738
Copy link
Copy Markdown

Summary

Add automatic trajectory capture during benchmark task execution. This enables recording what actions an agent took to solve a task, which is critical for analysis, debugging, and leaderboard submissions.

3-Level Trajectory Capture

The system collects trajectory data from three sources, in priority order:

  1. Agent-written trajectory (/.epochx/trajectory.jsonl) -- Rich structured data written by the agent itself (reasoning steps, tool calls, observations)
  2. SSH command log (/.epochx/ssh_log.jsonl) -- Automatically recorded via BASH_ENV + DEBUG trap injected into the container. Captures every bash command executed over SSH, including non-interactive sessions.
  3. Git log fallback -- If no other trajectory data exists, extracts commit history as a minimal trajectory.

Changed Files

  • src/epochx/core/runtime.py -- Inject BASH_ENV + DEBUG trap into Docker container setup for auto-logging all SSH commands to /.epochx/ssh_log.jsonl
  • src/epochx/core/prompt_generator.py -- Add optional "Trajectory" section to the generated prompt, guiding agents to write rich trajectory data
  • src/epochx/runner.py -- Add _collect_trajectory() method that merges all 3 sources; attach trajectory to grading results
  • src/epochx/exporter.py -- Include trajectory and output fields in get_task_results() for export
  • src/epochx/cli.py -- Attach trajectory and output to the submit-run API payload

Add 3-level trajectory capture system:
1. Agent-written rich trajectory (/.epochx/trajectory.jsonl)
2. Auto-recorded SSH command log via BASH_ENV + DEBUG trap
3. Git log fallback for minimal trajectory data

Changes:
- runtime.py: Inject BASH_ENV + DEBUG trap into container for auto-logging SSH commands
- prompt_generator.py: Add Trajectory section to generated prompt.md
- runner.py: Add _collect_trajectory() with 3-level source merging
- exporter.py: Include trajectory/output in get_task_results()
- cli.py: Attach trajectory/output to submit-run API payload
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.

1 participant