Skip to content

Add runtime recording#2573

Open
YuchengZhou821 wants to merge 5 commits into
mainfrom
Add-runtime-recording
Open

Add runtime recording#2573
YuchengZhou821 wants to merge 5 commits into
mainfrom
Add-runtime-recording

Conversation

@YuchengZhou821
Copy link
Copy Markdown
Contributor

This pull request introduces a new runtime data recording feature for OM1, enabling the system to log tick-level data to daily JSONL files. The main changes include the implementation of the RuntimeRecorder class, integration of recording logic into the runtime, configuration support for enabling/disabling the recorder, and comprehensive tests to ensure correct behavior.

Runtime Data Recording Feature

Implementation and Integration:

  • Added the RuntimeRecorder class (src/runtime/recorder.py) to record runtime tick data (including timestamps, ASR input, LLM input/output, and actions) to daily JSONL files, with automatic file rotation and robust error handling.
  • Integrated the recorder into the runtime lifecycle in src/runtime/cortex.py: initializes the recorder when enabled, records tick data in _tick, and ensures proper cleanup on shutdown. [1] [2] [3] [4] [5]

Configuration and Data Management:

  • Added a recorder field to the runtime config (src/runtime/config.py, src/runtime/converter.py), allowing the feature to be enabled/disabled via configuration, and ensured correct propagation through config loading and serialization. [1] [2] [3] [4]
  • Updated docker-compose.yml to mount a host directory for storing recordings.

Testing:

  • Added a comprehensive test suite for RuntimeRecorder (tests/runtime/test_recorder.py), covering directory creation, tick recording, file rotation, error handling, and persistence.
  • Added tests for recorder config passthrough and default behavior in the config converter tests.

These changes provide a robust and configurable mechanism to record and persist runtime activity, supporting future analysis and debugging.

Copilot AI review requested due to automatic review settings May 14, 2026 23:00
@YuchengZhou821 YuchengZhou821 requested review from a team as code owners May 14, 2026 23:00
@github-actions github-actions Bot added robotics Robotics code changes python Python code infrastructure Docker/Infrastructure tests Test files config Configuration files labels May 14, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an optional runtime recorder that writes tick-level runtime data to JSONL files for later debugging and analysis.

Changes:

  • Adds RuntimeRecorder for daily JSONL recording.
  • Integrates recorder setup, tick recording, and shutdown cleanup into the runtime.
  • Adds config passthrough, Docker volume mounting, and recorder-focused tests.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/runtime/recorder.py Adds JSONL runtime tick recorder with daily file rotation.
src/runtime/cortex.py Wires recorder lifecycle and per-tick recording into the runtime loop.
src/runtime/config.py Adds recorder field to runtime configuration loading/serialization.
src/runtime/converter.py Preserves recorder setting when converting single-mode configs.
tests/runtime/test_recorder.py Adds unit tests for recorder creation, writing, rotation, stopping, and restart append behavior.
tests/runtime/test_convert.py Adds converter tests for recorder passthrough/default behavior.
docker-compose.yml Mounts a host recordings directory into the container.

Comment thread src/runtime/cortex.py Outdated
Comment thread src/runtime/config.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 91.17647% with 6 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/recorder/__init__.py 92.30% 3 Missing ⚠️
src/llm/plugins/functiongemma.py 33.33% 2 Missing ⚠️
src/llm/plugins/openrouter.py 66.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration files infrastructure Docker/Infrastructure python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants